Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

session[0]<>session[1]....how code it?

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

    session[0]<>session[1]....how code it?

    hi,


    This session is different of previous session? ....



    i would to code it..

    #2
    Hello esignal,

    Thanks for your post.

    To detect if you are entering a new session you can check to see if (Bars.IsFirstBarOfSession) is true. Reference: http://ninjatrader.com/support/helpG...rofsession.htm

    For other questions regarding the session, please see the available methods and properties of the session Iterator in the helpguide here: http://ninjatrader.com/support/helpG...oniterator.htm

    Comment


      #3
      If use chart daily it don't run...
      I want a code that run correctly in chart intraday and in chart daily
      Last edited by esignal; 09-22-2017, 07:01 AM.

      Comment


        #4
        Hello esignal,

        Thanks for your reply.

        Can you elaborate with further detail so I can better understand what you are trying to accomplish. Also what Calculate mode are you using?

        Comment


          #5
          Onbarclose

          Comment


            #6
            Hello esignal,

            Thanks for your reply.

            Using OnBarClose mode with daily bars means you will not know of the forming bar until it closes.
            If you are trying to detect the newly forming day bar then you would need to use Calculate.OnEachTick and in this mode Close[0] would be the current price and Close[1] would be yesterdays close (when using daily bars). You could also use Calculate.OnPriceChange which only runs OBU when price changes so would not update OBU as frequently as OnEachTick

            If you have code that you only want to run once per bar you can use those modes and segment your code based on the bool IsFirstTickOfBar. You can review a reference sample here: http://ninjatrader.com/support/forum...ad.php?t=19387

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            668 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            377 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            110 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            580 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X