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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      53 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      33 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      5 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      19 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      6 views
      0 likes
      Last Post cre8able  
      Working...
      X