PDA

View Full Version : exit price prevents explorations


gawdib
8th May 2004, 01:50 PM
My way of selling (ending the trade) is to put in an order to the broker to sell at the day and moment when the low of the day touches my trailing stop that i have set up the night before.
therefore, I need the tradeesim to register the "exitprice" , in metastock language, as
exitprice:= min(fml("yesterdays set trailing stop"), open);.

However, when I do this in the metastock exploration, it causes the exploration to reject about 73% of the list of stocks! If i put the exit price as simply open, it rejects only about 2%! What is wrong? How can i write up an exploration that will reflect my trading pattern? thank you very much, regards, Geoffrey

David Samborsky
9th May 2004, 12:57 AM
That's right!

If either your entry or exit price falls outside their repected daily range then the trade will be rejected and the error reported in the error log. This is done to make sure your simulations use real data not synthesized data.

You need to either filter the price using some extra code (do a search for price filter) or use the built in price filter available in 4.2.2 of the TradeSim/Metastock plugin.

gawdib
9th May 2004, 01:25 AM
As I indicated before, I used the metastock min function. Thus, tradesim can choose between either of 2 prices. since one of the choices i give it is always "open" , then it is impossible for the day's price excursion not to include an open. Please assist. thank you and best regards, geoffrey

David Samborsky
10th May 2004, 01:39 AM
If the price chosen is the opening price then the trade will always be accepted. However if the alternate is chosen and this price happens to lie outside the daily range then the trade will be rejected.

My suggestion is to put the following after the call to Initialize function.

ExtFml( "TradeSim.EnablePriceFilter");

Note that v4.2.2 of the TradeSim.dll is required for this.

gawdib
11th May 2004, 02:53 AM
I did a search in the tradesim manual to try and find out how to use the ExtFml( "TradeSim.EnablePriceFilter");

The search came up with nothing. Please help me find out where information is about this extfml.

I still do not see how it is possible for tradesim not to register.
after all, IN the exit trigger, I already instruct the system not to exit unless todays low is lower than the value of yesterday's trailing stop, then in the exit price tradesim always has "Exitprice":= min(fml("yesterday's trailing stop value"),open); Thus, it is never possible that today's price excursion would not include either the open or yesterdays trailing stop value. therefore the trade shuld always be accepted. Thank you, regards, geoffrey