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

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
    Paul H.NinjaTrader Customer Service

    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?
        Paul H.NinjaTrader Customer Service

        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
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by BarzTrading, Today, 07:25 AM
            1 response
            9 views
            1 like
            Last Post NinjaTrader_Clayton  
            Started by EB Worx, 04-04-2023, 02:34 AM
            7 responses
            161 views
            0 likes
            Last Post VFI26
            by VFI26
             
            Started by Mizzouman1, Today, 07:35 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Radano, 06-10-2021, 01:40 AM
            20 responses
            616 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by i019945nj, 12-14-2023, 06:41 AM
            6 responses
            69 views
            0 likes
            Last Post i019945nj  
            Working...
            X