PDA

View Full Version : tradesim way of analizing if sell is not at open or close


gawdib
7th May 2004, 04:50 PM
I understand about putting in orders to brokers and contingincy orders.

What I did not understand, when i put in my question, was how does tradesim do its evaluation of trailing stops? If i do have access to contingency orders ( in otherwords, I CAN put in an order to sell so that if the travel of the price crosses over the price I have stipulated, then the stock is sold at that moment. There is no wait to the end of the day (close) or to the next day (at the open). so how do I program your tradesim so that Tradesim will do an analysis of my system when I can have this immediate type of "sale" take place? Thank you very much. regards, Geoffrey

David Samborsky
9th May 2004, 01:11 AM
If you are coding your trailing stop using the MS language then you could could assign the trailing stop band to the ExitPrice parameter.

For example on the long side you could use the following code:-


Period:=10;
ARC:=3;
Stop:=C+ARC*ATR(Period);

BandLong&#58;=If&#40;L<=PREV,Stop,If&#40;Stop>PREV,Stop,PREV&#41;&#41;;
ExitTrigger&#58;=&#40;L <= ref&#40;BandLong,-1&#41;&#41;;
ExitPrice&#58;=ref&#40;BandLong,-1&#41;;


You could also do this using the fast trailing stop functions as well.


Period&#58;=10;
ARC&#58;=3;
Stop&#58;=C+ARC*ATR&#40;Period&#41;;

ExitTrigger&#58;=ExtFml&#40; "TradeSim.TrailingStop", TRIGGER, LONG, Volatility, CLOSE,LOW&#41;;

BandLong&#58;=ExtFml&#40; "TradeSim.TrailingStop", BAND, LONG, Volatility, CLOSE LOW&#41;;

ExitPrice&#58;=ref&#40;BandLong,-1&#41;;