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 SalmaTrader, 07-07-2026, 10:26 PM
          0 responses
          35 views
          0 likes
          Last Post SalmaTrader  
          Started by CarlTrading, 07-05-2026, 01:16 PM
          0 responses
          20 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 06-17-2026, 10:32 AM
          0 responses
          12 views
          0 likes
          Last Post CaptainJack  
          Started by kinfxhk, 06-17-2026, 04:15 AM
          0 responses
          18 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 06-17-2026, 04:06 AM
          0 responses
          20 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X