I don't know about the rest of your
code, but "C > BuyPrice*1.2" is 20%, not 2%.
rockergab wrote:
Hi there,
I want AFL doing this kind of behavior:
Enter a trade by my own opinion
Exit the trade if price falls by 3%
When price increases over 2% I want a trailing stop 0.5% under
highest value
I tried with this code but it doesn't work.
TradeStart = 1060505
Buy = DateNum()==TradeStart;
Sell = 0;
ApplyStop(stopTypeLoss,stopModePercent,3,1,0,1);
IIf(C > BuyPrice*1.2,ApplyStop
(stopTypeTrailing,stopModePercent,0.5,1,1,1),0);
I always obtain a trailing stop by 0.5% without the filter that I
fixed by 2% over buyprice.
I wonder if anybody could help me. Thanks to everybody!
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS
|
- Re: [amibroker] How can I trigger ApplyStop? Keith McCombs
-