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

Error on setting indicator plot for indicator ***. Value outside of valid range

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

    Error on setting indicator plot for indicator ***. Value outside of valid range

    Good afternoon, please help to solve a problem.
    I made a simple indicator of the formation time of bars in seconds, as I was prompted by the guys from the forum.

    if(CurrentBar < 5) return;
    T = (Time[0] - Time[1]).TotalSeconds;
    Plot0.Set(T);

    Everything works fine, but then there was a need to divide 1 by the values of this indicator.

    if(CurrentBar < 5) return;
    A = 1/ATimer().Plot0[0];

    After the start of the indicator an error occurred Error on setting indicator plot for indicator '***'. Value outside of valid range.

    #2
    Hello Kovalev,

    Thanks for your post.

    I would suggest debugging by using print statements where you can compare the Plot0[0] values in both indicators. For further information on debugging, please see: https://ninjatrader.com/support/foru...ead.php?t=3418
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello, NinjaTrader_Paul
      Thank you very much for showing this method, it turned out that sometimes the bar skips less than a second = 0, and therefore an error occurs when dividing by 1 by 0

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by r68cervera, Today, 05:29 AM
      0 responses
      2 views
      0 likes
      Last Post r68cervera  
      Started by geddyisodin, Today, 05:20 AM
      0 responses
      3 views
      0 likes
      Last Post geddyisodin  
      Started by JonesJoker, 04-22-2024, 12:23 PM
      6 responses
      34 views
      0 likes
      Last Post JonesJoker  
      Started by GussJ, 03-04-2020, 03:11 PM
      12 responses
      3,239 views
      0 likes
      Last Post Leafcutter  
      Started by AveryFlynn, Today, 04:57 AM
      0 responses
      6 views
      0 likes
      Last Post AveryFlynn  
      Working...
      X