Hello,
 
I try to "Back Test" a simple strategy.
In a sideways trend with a sample bands:
- open long position when price goes to the bottom band, just at this
level;
- open short position when price goes to the bottom band, just at this
level;
- take small profit.

I created a sample code for this strategy ( see the AFL code below), but
when I back-test it, I obtain a lot of ApplyStop/stopTypeProfit  false
signals, as shown on the picture
http://img16.imageshack.us/img16/8628/94786203.gif  

Can somebody help how to solve this problem ?

Best regards
Rem  

--------
ApplyStop(stopTypeProfit, stopModePoint, 10*TickSize, 1); 

bottomLevel = Open - 10*TickSize; // = Buy level
Buy = bottomLevel >= Low ;
BuyPrice = bottomLevel ; 

topLevel = Open + 10*TickSize; // = Short level
Short = topLevel <= High ;
ShortPrice = topLevel ; 
Cover= Buy ;
Sell= Short ;

CoverPrice= IIf( bottomLevel >= Low, BuyPrice, Close); 
SellPrice= IIf(topLevel <= High, ShortPrice, Close); 

Plot(topLevel, "topLevel", colorRed);
Plot(bottomLevel, "bottomLevel", colorGreen);




Reply via email to