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 Mestor, 03-10-2023, 01:50 AM
      16 responses
      388 views
      0 likes
      Last Post z.franck  
      Started by rtwave, 04-12-2024, 09:30 AM
      4 responses
      31 views
      0 likes
      Last Post rtwave
      by rtwave
       
      Started by yertle, Yesterday, 08:38 AM
      7 responses
      29 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by bmartz, 03-12-2024, 06:12 AM
      2 responses
      22 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by funk10101, Today, 12:02 AM
      0 responses
      7 views
      0 likes
      Last Post funk10101  
      Working...
      X