Profile Picture

OrderFilled() & BarClosing()

Posted By maysec 3 Years Ago
Posted Tuesday June 17 2014
A quick question about paper broker event order.

a) For a given bar I believe BarClosing() is called before NewBar() - that is correct is it not ?

b) Does the PaperBroker process bar open orders and call OrderFilled() before there is a call to BarClosing() ?

c) Specifically from within BarClosing() will PositionManager.GetOpenPositions() return all open positions including those executed on the given bar's open?

Posted Thursday June 19 2014
I would like to know the answer to this question as well.

It helps to know the cycle of events when programming. Even though it is an event driven model, there should be a sequence to how things are normally processed.

For instance, let say I have a daily frequency and I place orders when processing NewBar, what event should I process to know when the end of day (end of frequency) is complete?

Like if I wanted to log what I did in a given day to a file...

Posted Friday June 20 2014
a)   BarClosing is called before Close. SystemData.EnableTradeOnClose and SystemData.CreateTicksFromBars should also be set to true. Set these within System Startup().

b)   OrderFilled will be called on the tick that it is executed on. So if it is executed on Open, yes OrderFilled will be called before BarClosing(). Settings in a) above must be set.

c)   Yes

Based on your questions, it appears the setting in a) may be set to false.


Similar Topics

Reading This Topic

2005-2017 © RightEdge Systems