Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

2 Questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    2 Questions

    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

    #2
    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.
    RayNinjaTrader Customer Service

    Comment


      #3
      So in order to avoid using the bar from the previous session, I need to do something like
      if (Bars.BarsSinceSession > 1){return;}?

      Comment


        #4
        Yes, that approach would work.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by junkone, Today, 11:37 AM
        2 responses
        13 views
        0 likes
        Last Post junkone
        by junkone
         
        Started by frankthearm, Yesterday, 09:08 AM
        12 responses
        43 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by quantismo, 04-17-2024, 05:13 PM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by proptrade13, Today, 11:06 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        35 views
        0 likes
        Last Post love2code2trade  
        Working...
        X