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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          75 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          63 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          63 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X