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

Indicator is dissapearing

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

    Indicator is dissapearing

    Hello. I'm developping a indicator. The problem is that when I use it, it appear correctly but when I scroll it dissapear. I attach the indicator file. Can you help me, please?

    Thank you very much
    Attached Files

    #2
    Hello alibanez,

    Thank you for your post.

    I will test the indicator and follow up with you when I have additional information.

    Comment


      #3
      Originally posted by alibanez View Post
      Hello. I'm developping a indicator. The problem is that when I use it, it appear correctly but when I scroll it dissapear. I attach the indicator file. Can you help me, please?

      Thank you very much
      What is the error in your log?

      Comment


        #4
        Hello alibanez,

        Thank you for your patience.

        I am unable to reproduce the behavior on my end. Please send me your log and trace files for today so that I may look into what occurred. You can do this by going to the Control Center-> Help-> Mail to Platform Support. Please place this thread in the subject line: "http://www.ninjatrader.com/support/forum/showthread.php?t=69080"

        Comment


          #5
          Thank you. At the end I found the problem. It was that the denominator sometimes was zero. I solved the problem with the next code.

          protected override void OnBarUpdate()
          {
          // Use this method for calculating your indicator values. Assign a value to each
          // plot below by replacing 'Close[0]' with your own formula.

          if (CurrentBars[0] <= BarsRequired) return;

          double ValPrec = 0;
          double ValVol = 0;
          double VolPrec = 0;

          ValPrec = ((Close[0]-SMA(Period)[0])/StdDev(Period)[0]);
          ValVol = ((Volume[0]-SMA(Volume,Period)[0])/StdDev(Volume,Period)[0]);
          VolPrec = ValPrec; //+ValVol;

          if (VolPrec > 0 || VolPrec == 0 || VolPrec <0)
          GVolPrec.Set(VolPrec);
          else
          GVolPrec.Set(0);

          }

          Thanks a lot.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Max238, Today, 01:28 AM
          2 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Started by Shansen, 08-30-2019, 10:18 PM
          25 responses
          949 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by JonesJoker, 04-22-2024, 12:23 PM
          8 responses
          41 views
          0 likes
          Last Post JonesJoker  
          Started by timko, Today, 06:45 AM
          0 responses
          4 views
          0 likes
          Last Post timko
          by timko
           
          Started by Waxavi, 04-19-2024, 02:10 AM
          2 responses
          39 views
          0 likes
          Last Post poeds
          by poeds
           
          Working...
          X