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 GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,281 views
      0 likes
      Last Post Leafcutter  
      Started by WHICKED, Today, 12:45 PM
      2 responses
      19 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Tim-c, Today, 02:10 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      5 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      53 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X