PureBytes Links
Trading Reference Links
|
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);
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|