PDA

View Full Version : initial stop used with trailing stop


gawdib
12th March 2004, 04:44 PM
no matter what values i use in this formula, the results are the same. I have read over the manual many many times, but i just cannot get what it means. please explain. thank you. in the below examples i put in 2 different valuse for trailing stop and inital stops. all 4 results yield identical answers. If i leave out the parts about inital stop and trailing stop, i have no problem getting defferent answers, whenever i change the values in the exit trigger. thank you. geoffrey

a:
EntryTrigger:=Fml("buycombofeb29") ; EntryPrice:=close; ExitTrigger:=ROC(Fml("voltrgapdivervoldiff3"),2,%)<0 ;

ExitPrice:=close; initialstop:=.76*entryprice;

extFml("TradeSim.Initialize"); ExtFml("tradesim.enableprotectivestop",3);

ExtFml("tradesim.trailingstop",trigger,long, .24* c ,HHV(C,10) ,low) ;

ExtFml("tradesim.setTIMEstop",100); ExtFml("tradesim.setstopgappricetoopen"); ExtFml( "TradeSim.RecordTrades", " 27",LONG, EntryTrigger, EntryPrice, INITIALSTOP, ExitTrigger, ExitPrice, START);


b:
EntryTrigger:=Fml("buycombofeb29") ; EntryPrice:=close; ExitTrigger:=ROC(Fml("voltrgapdivervoldiff3"),2,%)<0 ;

ExitPrice:=close; initialstop:=.96*entryprice;

ExtFml("TradeSim.Initialize"); ExtFml("tradesim.enableprotectivestop",3);

ExtFml("tradesim.trailingstop",trigger,long, .04* c ,HHV(C,10) ,low) ;

ExtFml("tradesim.setTIMEstop",100); ExtFml("tradesim.setstopgappricetoopen"); ExtFml( "TradeSim.RecordTrades", " 27",LONG, EntryTrigger, EntryPrice, INITIALSTOP, ExitTrigger, ExitPrice, START);

David Samborsky
15th March 2004, 02:02 AM
The trailing stop function works independently of the RecordTrades function so you have to assign it to something otherwise by itself it will do nothing.

Example A:

EntryTrigger&#58;=Fml&#40;"buycombofeb29"&#41; ;
EntryPrice&#58;=close;
ExitTrigger1&#58;=ROC&#40;Fml&#40;"voltrgapdivervoldiff3"&#41;,2,%&#41;<0 ;
ExitPrice&#58;=close;
initialstop&#58;=.76*entryprice;

extFml&#40;"TradeSim.Initialize"&#41;;
ExtFml&#40;"tradesim.enableprotectivestop",3&#41;;
ExitTrigger&#58;=ExitTrigger1 OR ExtFml&#40;"tradesim.trailingstop",trigger,long, .24* c ,HHV&#40;C,10&#41; ,low&#41; ;

ExtFml&#40;"tradesim.setTIMEstop",100&#41;; ExtFml&#40;"tradesim.setstopgappricetoopen"&#41;;
ExtFml&#40; "TradeSim.RecordTrades", " 27",LONG, EntryTrigger, EntryPrice, INITIALSTOP, ExitTrigger, ExitPrice, START&#41;;



Example B:

EntryTrigger&#58;=Fml&#40;"buycombofeb29"&#41; ;
EntryPrice&#58;=close;
ExitTrigger1&#58;=ROC&#40;Fml&#40;"voltrgapdivervoldiff3"&#41;,2,%&#41;<0 ;

ExitPrice&#58;=close;
initialstop&#58;=.96*entryprice;

ExtFml&#40;"TradeSim.Initialize"&#41;;
ExtFml&#40;"tradesim.enableprotectivestop",3&#41;;

ExitTrigger&#58;=ExitTrigger1 OR ExtFml&#40;"tradesim.trailingstop",trigger,long, .04* c ,HHV&#40;C,10&#41; ,low&#41; ;

ExtFml&#40;"tradesim.setTIMEstop",100&#41;; ExtFml&#40;"tradesim.setstopgappricetoopen"&#41;;
ExtFml&#40; "TradeSim.RecordTrades", " 27",LONG, EntryTrigger, EntryPrice, INITIALSTOP, ExitTrigger, ExitPrice, START&#41;;

gawdib
1st May 2004, 06:25 PM
fantastic. i would never have guessed.
One final item, please:
1:To say in words what your trailing stop function is doing, would it be correct to say, in your b example, above, that: On the day that the low of the day has gone below the highest high value of the close(of the past 10 bars) MINUS a value which is .04*times the close(actually for it to work it should have been yesterday's close), then the trade is exited at the day's closing price?

thanks greatly, geoffrey