Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            155 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            90 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            137 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            130 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X