in Search

System Coding

Last post 08-13-2007, 0:06 by *PP. 1 replies.
Sort Posts: Previous Next
  •  08-12-2007, 20:36 25004

    System Coding

    Hi guys.

    Iv recently bought metastock version 9 and I have a system in mind but no idea how to code it.

    What im looking for is to BUY the next days open when a stock closes on an all time high.

    Initial stop of 10% from the purchase price.

    Trailing exit to sell on the next days open if it closes below the 200dma (of the closes).

    Money management is 10% of initial capital. So for example, if we start with 100k, first parcel is 10k, second parcel is 9k, third parcel 8.1k.

    So maximum loss is any case will be 1%.

    Is this a better idea for position sizing you think compared to 10k fixed dollar size units?

    Does it sound like a good system??

    Any help here would be much appreciated.

    Regards,

    Nizar

     

     

  •  08-13-2007, 0:06 25007 in reply to 25004

    Re: System Coding

    Hi Nizar,

    Entrycode:=C>Ref(Highest(C),-1);
    Exitcode:=Cross(Mov(C,200,E),C);
    status:=BarsSince(Entrycode)<BarsSince(Exitcode);

    status:= ExtFml( "Forum.Latch",Entrycode ,Exitcode ,0 ,0 );

    If(status=1 AND Ref(status,-1)=0,1,If(status=0 AND Ref(status,-1)=1,2,0)) {this will plot 1 on Entry signal and 2 on Exit signal}

    The code above does not include stop loss of 10% under entry price and i have replaced dema with a simple moving average...if u ask me, actually if one makes a test will see that it really does not matter if dema, ema, simple, tema, moing averages are used but everyone is free to complicate things as much as he/she likes.

    10k fixed dollar units will always give less smaller returns with smaller drawdowns than 10% of availiable capital and thats all. the choice is yours

    If its a good system or not u will see by testing it

     

    Cheers,,

    PP

    www.draculasystems.com

View as RSS news feed in XML