[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Trailing Stops - AFL help



PureBytes Links

Trading Reference Links

Is there a way to turn a trailing stop "on" or "off" at certain 
events in backtesting?

I understand that the basic command for a 35 pip trailing stop (for 
example) is 

applystop(2,2,0.0035,True,False)

However, I use the "powerbot" trading robot and it allows a trailing 
stop to be activiated at a certain profit level. For example, you 
can tell it to use a 35 pip trailing stop but only after you hit 50 
pips of profit in a given trade. 

How can I program that in AFL? I tried using the "if else" feature, 
but it doesn't work for arrays. I tried using the iff function, but 
that seems to just return a value rather than performing an action. 

Thanks in advance for your help!

James



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/