PDA

View Full Version : 2 Questions


mazachan
09-07-2007, 07:49 AM
I have a question with regards to how the strategy session time works. If I have a session start at 8:30 on the 3 minute time frame, and I call the Close[1] right at the start, will the strategy see the 8:27 bar or the bar from the previous session? If I set it to 8:30-15:00, would it use the 15:00 bar for the Close[1]?

Also, if I have strategy A that has an Open position and calls a helper method in strategy B, and strategy B calls MarketPosition.Position == Position.Flat, will it see the position as flat or would it recognize the open position and act accordingly?

Thanks

NinjaTrader_Ray
09-07-2007, 07:56 AM
On the close of the 8:33 bar (1st bar of the session), Close[1] will return the last bar of the prior session. If you session time ended at 3:15 PM, it would reference the last bar of around that time.

Position only returns the position of that strategy, not the underlying account.

mazachan
09-07-2007, 08:05 AM
So in order to avoid using the bar from the previous session, I need to do something like
if (Bars.BarsSinceSession > 1){return;}?

NinjaTrader_Ray
09-07-2007, 08:21 AM
Yes, that approach would work.