PDA

View Full Version : Exits


arpad_37
24th May 2003, 10:30 AM
Hi All,

One question: Why doesn't the code below let me exit on today's open once yesterday's close price is below the initialStop?

ExitPrice:=OPEN;
ExitTrigger:=Ref(CLOSE<InitialStop,-1);

BTW I know that I can use the "ExtFml("TradeSim.EnableProtectiveStop",0);" but that is using the LOW price for the trigger not the CLOSE

Regards,

Arpad

David Samborsky
24th May 2003, 01:31 PM
Because to Metastock your InitialStop is a value which changes from bar to bar rather than the value it was when you entered the trade so the InitialStop comparison will not work the way you want it to because Metastock does not take a snapshot of its value when your entry trigger is valid and the trade is entered.

This is why it only works within the RecordTrades function only because the RecordTrades function knows that you only want to refernce the value of the InitialStop at the start of the trade and not as its value varies throughout the trade. Hope this makes sense.

arpad_37
25th May 2003, 09:47 AM
Thank you David, I thought I was going nuts.

Regards,
Arpad

arpad_37
25th May 2003, 09:51 AM
Can this be a possible improvement for TradeSim? ie to calculate the Stop loss on Close not LOW?

Arpad

David Samborsky
25th May 2003, 12:59 PM
Do a search on the following function in the TradeSim User Manual.

UseClosingPriceAsStopThreshold

This should do what you want.

arpad_37
25th May 2003, 11:26 PM
Excellent - Thank You!