Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using of Price Data

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

    Using of Price Data

    Hi,

    I'm new in coding NinjaScript and have some elementary problems using the evaluation of price data. (High, Low, etc.)
    If I want to use for example the High or Low functions for any previous bar, the calculation logic doesn't work at all and it isn't possible to debug using the output window...

    Even a basic code snippet from the helpguide (see example1) doesn't work.

    Code:
    protected override void OnBarUpdate()
            {
                // Use this method for calculating your indicator values. Assign a value to each
                // plot below by replacing 'Close[0]' with your own formula.
                            
                if (Close[0] > Close[1])
                Print("We had an up day"); 
                
            }
    But: Every usage of the operations for the CurrantBar-Values work fine. (see example2)
    Code:
    Print(High[0].ToString());
    Who can help?

    #2
    If you want to access a prior bar you need to ensure there are enough bars in the series to check for a prior bar first. Please see this tip: http://www.ninjatrader-support2.com/...ead.php?t=3170
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      that's it! Now I can start and in the future address some more questions to you...

      thx for your quick respond!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X