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 aa731, Today, 02:54 AM
        0 responses
        4 views
        0 likes
        Last Post aa731
        by aa731
         
        Started by thanajo, 05-04-2021, 02:11 AM
        3 responses
        470 views
        0 likes
        Last Post tradingnasdaqprueba  
        Started by Christopher_R, Today, 12:29 AM
        0 responses
        10 views
        0 likes
        Last Post Christopher_R  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        166 responses
        2,237 views
        0 likes
        Last Post sidlercom80  
        Started by thread, Yesterday, 11:58 PM
        0 responses
        4 views
        0 likes
        Last Post thread
        by thread
         
        Working...
        X