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 Stanfillirenfro, Today, 07:23 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      2 responses
      22 views
      0 likes
      Last Post cmtjoancolmenero  
      Started by olisav57, Yesterday, 07:39 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by cocoescala, 10-12-2018, 11:02 PM
      7 responses
      944 views
      0 likes
      Last Post Jquiroz1975  
      Started by oviejo, Today, 12:28 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X