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

Open[1]

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

    Open[1]

    Hi,

    I am new in C#.
    I try to print Open[1], it is not generate a value.( could be "not a value or something else)
    However, if I do Open[Bars.BarsSinceSession-388], where Bars.BarsSinceSession=389, then it works.

    Why?

    #2
    make sure do a no. of bars check

    in OnBarUpdate

    Code:
    if (CurentBar < 1) return;
    
    Print(Open[1].ToString());

    Comment


      #3
      Yes,

      However, I think that Open[1]=Open[Bars.BarsSinceSession-388], if Bars.BarsSinceSession=389.

      If Open[Bars.BarsSinceSession-388] works, then Open[1] should also works. Because they represent the same thing.

      Right?

      Comment


        #4
        Of course, if I print "CurrentBar", then it is 0 at this monent.
        How come the Open[Bars.BarsSinceSession-388] give the value that it should be.

        Comment


          #5
          you are only considering the bar #389. think what would be the case in case of barssincesession #387 or #5. then you will realize.

          Comment


            #6
            Yes,

            Thank you very much.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ZenCortexCLICK, Today, 04:58 AM
            0 responses
            5 views
            0 likes
            Last Post ZenCortexCLICK  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            172 responses
            2,280 views
            0 likes
            Last Post sidlercom80  
            Started by Irukandji, Yesterday, 02:53 AM
            2 responses
            17 views
            0 likes
            Last Post Irukandji  
            Started by adeelshahzad, Today, 03:54 AM
            0 responses
            5 views
            0 likes
            Last Post adeelshahzad  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X