Mechanic of next(self) function. Explain me please by experience
-
Last 2 days I am testing live data feed. I noticed, that first resample timeframe is major for "next(self):" function. right?
So, if all logic calculates inside of this "loop" it will calculates at the same "speed" as your major timeframe, right?
My major resample timeframe is 1 minute, and when I receive signal my order create and it executes after 1 minute...or I am wrong? On backtesting I didn't understant this moment untill try live data, so looking for asnwer from experienced guys. Thx! -
If you place an order, it will be execute on the next bar by open price. If you send order to broker, and this order is market - it will be execute from order book(from takers).
-
Sorry, *if you send order to broker in live mode
-
@Yaroslav-Horyslavets thx for reply. Looks like I can't understand it because I test it without broker platfrom (only live feed) and my logs show after each "next()".
-
next()
is called on every bar of all data feeds (resampled or not resampled). -
@ab_trader how to check what minimal timeframe data feed can send?
-
have the data feeds names related to the time frames. print data feed
self.datas[x]._name
name on eachnext()
usinglog
function. this will also give the date and time. -
@ab_trader all my questions about orders event handling. But I understand that if I had broker terminal I wasn't confused with logs output and
next()
. Anyway, thank you for replies! -
In this case I am not sure what is your confusion. Live broker or simulation broker - approach is the same.