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

[amibroker] Help with Trailing Stop



PureBytes Links

Trading Reference Links

Having problems trying to get ApplyStop to do exactly as I want.

The TrailingStop in the following simplified code correctly closes a 
position and remains out of the market until the next entry signal 
fires.

ApplyStop(stopTypeTrailing,stopModePercent,20,True);
Buy=Cross(C,MA(C,60));
Sell=Cross(MA(C,60),C);
Equity(1);
Short=Sell;Cover=Buy;

Instead of staying out of the market during this time I want to 
reverse the position. So,for example, if I am stopped out while Long, 
I want to go immediately Short pending the next entry signal. How can 
I modify this code - or am I completely on the wrong track:

Keith



------------------------ 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/l.m7sD/LIdGAA/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/