PDA

View Full Version : entry and exit on the same bar


abin
6th November 2003, 12:04 PM
Could anyone tell me whether it is possible to define a strategy in tradesim that enters on a bar (eg a daily bar) and also exits on the same daily bar (eg because a target or stop has been hit inside that bar) ?

Tks Abin

David Samborsky
8th December 2003, 03:15 AM
Would need to add a target stop function to the plugin.

abin
8th December 2003, 05:44 AM
Thank you for your response David.

You say a target stop would have to be added to tradesim to permit a target exit to occur on the day of entry. (I assume a stop loss set on the day of entry would get you out on the same day if the price falls to that level).

Is adding a same day target exit easy to do ? I assume this requires a program change, debugging, testing and distribution to existing users. Is it likely that it would be done in a short time frame, or something that would go onto the end of the wishlist, to be considered some time in the future ?

Obviously the reason I ask, is that I am looking to test very short term strategies, that potentially need to be able to exit (either on profit or loss) on the same day that the trade is entered.

Regards Abin

David Samborsky
10th December 2003, 02:23 AM
Why not try this

EntryTrigger:=YourTrigger;

ExitTrigger:=EntryTrigger AND (PriceCondition);

For example a profit threshold stop of 10% could be coded as follows;

PriceCondition:=(High-EntryPrice)/EntryPrice > 0.1;

Normally this would not work because the EntryPrice array is not constant and varies from bar to bar but in this case because we know in advance that we will exit on the same bar as we entered providing that the price condition is met so the EntryPrice used in the PriceCondition will be valid when it is used in the PriceCondition expression.

abin
17th December 2003, 12:35 PM
Thank you again David for the thought you have put into my question.

I do not at this time have tradesim and therefore am not in a position to try your suggestion.

It would seem then that tradesim is meant to evaluate trades lasting more than one bar.

I will keep this in mind in making my purchasing decision.

Regards Martin

David Samborsky
18th December 2003, 02:36 AM
TradeSim was not designed for intraday analysis although it is possible to enter and exit on the same bar, the information available using EOD data as well as the Metastock formula language can sometimes be a limitation.