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

Need help with indicator not working at all

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

    Need help with indicator not working at all

    Dear programmers, i need some help with ninjatrader 8 scripting.


    Please forgive my ignorance.

    So, i'm playing up with the code, basically a simple test indicator, with 2 outputs:
    "Outputx" and "Outputxx".

    Now, as we can see in the first image, i put the code:

    Outputx[0]=High[0];
    Outputxx[0]=Low[0];

    And we can see the two lines of the indicator below the chart, working well.


    The thing i don't understand, if i put something before these commands, such as:

    indi[0][0]=0;

    (indi is defined as "public double[][] indi;"), so everything works fine in the compiler, no errors or anything like that.

    However, when i put this line, the indicator on chart disappear.
    I can't understand why?
    Whenever i work with other doubles that are not the outputs, the indicator stop working all together.

    Any idea of what's going on?
    Attached Files

    #2
    Hello w4rn1ng,

    Thank you for your post.

    Please check the Log tab of the Control Center, is there an error reported when using the line indi[0][0]=0;? If so, what does this error report?

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello w4rn1ng,

      Thank you for your post.

      Please check the Log tab of the Control Center, is there an error reported when using the line indi[0][0]=0;? If so, what does this error report?
      Dear Patrick,

      thank you for your prompt reply, apparently i managed to find out how to make it work, here it is:

      on creating the array, the correct (i guess?) way to do it was for example:

      double[,] indi = new double[10,10]; //instead of just "double[][] indi;"

      and then of course, down, indi[0,0]=0; //instead of indi[0][0]=0;

      i was used to metaquote language where arrays are defined differently, but thankfully the problem has been solved.

      Tnx again from the prompt support!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kevinenergy, 02-17-2023, 12:42 PM
      118 responses
      2,778 views
      1 like
      Last Post kevinenergy  
      Started by briansaul, Today, 05:31 AM
      0 responses
      9 views
      0 likes
      Last Post briansaul  
      Started by traderqz, Yesterday, 12:06 AM
      11 responses
      28 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by PaulMohn, Today, 03:49 AM
      0 responses
      9 views
      0 likes
      Last Post PaulMohn  
      Started by inanazsocial, Today, 01:15 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Jason  
      Working...
      X