AtMarket vs. AtClose
Author: lspinv
Creation Date: 3/5/2010 9:42 AM
profile picture

lspinv

#1
After having read the description in the Programming Guide, I still am not completely clear regarding the Buy AtMarket vs. Buy AtClose trade signals (i.e. – when is the Condition evaluated and when is it executed?).

If bar parameter = daily, and if at 2:00pm on 03/01/2010 a real-time Buy Condition would become True, when would a Buy AtMarket Trade Signal be evaluated and when would it be executed – 03/01 @ 2:00pm? 03/01 @ 4:00pm? 03/02 @ 9:30am? Other?

For the same criteria, when would a Buy AtClose Trade Signal be evaluated and when would it be executed?

profile picture

Cone

#2
Conditions are evaluated based on how you code them in a strategy. They should be evaluated based on the data at the "end" (close) of the current bar, the trading loop index.

QUOTE:
If bar parameter = daily, and if at 2:00pm on 03/01/2010
This is invalid. You should not be evaluating EOD strategies mid day. But if you do, and you're using the Y! provider's latest data, the strategy assumes that the bar is complete, i.e., EOD.

QUOTE:
when would it be executed
It's "executed" the moment it's run in the Strategy. Though, I'm not sure what you mean by this. If you mean, "when would an AtMarket order be placed?", then it would be at the open of the next day, i.e., bar + 1, if that's how you coded it (you should).

An AtClose order would be placed "immediately" on the Close of the day, if you execute it on bar. You can program a Strategy to execute on the close of the next bar, i.e., bar + 1, that's perfectly fine too. However, since AtClose orders are not supported in live trading, the Programming Guide discussion has more details about how to realistically create this order.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).