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 Skifree, Today, 03:41 AM
      1 response
      2 views
      0 likes
      Last Post Skifree
      by Skifree
       
      Started by usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      603 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      23 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      23 views
      0 likes
      Last Post Pattontje  
      Working...
      X