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 SantoshXX, Today, 03:09 AM
      0 responses
      11 views
      0 likes
      Last Post SantoshXX  
      Started by DanielTynera, Today, 01:14 AM
      0 responses
      2 views
      0 likes
      Last Post DanielTynera  
      Started by yertle, 04-18-2024, 08:38 AM
      9 responses
      41 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by techgetgame, Yesterday, 11:42 PM
      0 responses
      12 views
      0 likes
      Last Post techgetgame  
      Started by sephichapdson, Yesterday, 11:36 PM
      0 responses
      2 views
      0 likes
      Last Post sephichapdson  
      Working...
      X