Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom DataSeries EMA

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

    Custom DataSeries EMA

    I am trying to plot an EMA of a custom DataSeries in NT7, but it is not working. I can plot this in a strategy but not in an indicator. Is this possible in NT7?

    Thanks.

    #2
    Hi eleven,

    Are you getting any errors in the Log tab of the Control Center when applying the indicator?

    If no, let's start from the top...
    1. Can you clarify "not working"? Does it not plot at all? Different than expected? Something else?
    2. How are you setting this up? Can you provide a code snippet?
    TimNinjaTrader Customer Service

    Comment


      #3
      Tim,

      I am getting the following error in the log. It states "Error on setting indicator plot for indicator....Value outside of valid range".

      Can you point me in the right direction on this? A snippet of code is below. I cannot plot "var2".
      Code:
      double var1 = (StdDev(Close,Period)[0]-SMA(Close,Period)[0])/StdDev(Close,Period)[0];
      Value.Set(var1);
      double var2 = EMA(Value,Smooth)[0];

      Comment


        #4
        It looks like you are going to need an escape statement.

        Code:
        if (CurrentBar < Period + 1) return;
        That code snippet should likely be the first statement in your OnBarUpdate() method. That alternative is to make sure that you arrange a calculation routine for when the number of bars is less than the "Period" variable.

        Comment


          #5
          eleven, please print the associated values to check them for consistency, you likely see the issue because the divisor calculations are blowing up at some point on the chart.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sjsj2732, 03-23-2026, 04:31 AM
          0 responses
          42 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          295 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          290 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          135 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          98 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X