Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

operator '/' cannot be applied to operands of type.....PriceSeries

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

    operator '/' cannot be applied to operands of type.....PriceSeries

    Hi,
    How can i revise to avoid the error?

    else if (State == State.Configure)
    {
    AddDataSeries("ES DEC23", BarsPeriodType.Day, 1);
    }
    }

    protected override void OnBarUpdate()
    {
    ESvol = ATR(Closes[1], Period)[0] / Closes[0];
    Symbolvol = ATR(Period)[0] / Close[0];

    Value[0] = Symbolvol / ESvol;
    }​

    #2
    Hello trader3000a,

    Please provide the full error message (or a screenshot).

    May I confirm ESvol and Symbolvol have both been declared as doubles?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,
      Yes, I declared them up top
      Attached Files

      Comment


        #4
        Hello trader3000a,

        Closes[0] is a price series.
        Close[0] or Closes[0][0] would be a double.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          whoops, thx

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          239 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          155 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          164 views
          1 like
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          247 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          199 views
          0 likes
          Last Post CarlTrading  
          Working...
          X