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

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 RubenCazorla, 08-30-2022, 06:36 AM
      3 responses
      77 views
      0 likes
      Last Post PaulMohn  
      Started by f.saeidi, Yesterday, 12:14 PM
      9 responses
      23 views
      0 likes
      Last Post f.saeidi  
      Started by Tim-c, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      5 views
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,772 views
      0 likes
      Last Post Leafcutter  
      Working...
      X