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