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 giulyko00, 04-24-2024, 12:03 PM
            7 responses
            31 views
            0 likes
            Last Post eDanny
            by eDanny
             
            Started by NM_eFe, Today, 10:13 AM
            0 responses
            4 views
            0 likes
            Last Post NM_eFe
            by NM_eFe
             
            Started by hdge4u, Yesterday, 12:23 PM
            1 response
            10 views
            0 likes
            Last Post hdge4u
            by hdge4u
             
            Started by 1001111, Today, 09:45 AM
            0 responses
            12 views
            0 likes
            Last Post 1001111
            by 1001111
             
            Started by DTSSTS, 01-28-2024, 12:07 PM
            11 responses
            561 views
            0 likes
            Last Post bmo111
            by bmo111
             
            Working...
            X