Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot apply indexing with [] to an expression of type "double"

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

    #16
    You cannot index a double, since this makes no sense.

    You can index a Series<double>, which is a big difference.

    A double and a Series<double> are not the same thing.

    -=o=-

    How is Hist defined?
    From the code, it looks like it better be a Series<double>.
    Is it?

    How is Histog defined?
    Ok, I see this one, it is a double.

    How is priorHistog defined?

    From the code, it looks like you're using it as a double
    but then you also use it a Series<double>.
    ​Which is it?

    -=o=-

    I agree you need help.

    But I don't think you've provided enough code for me to
    divine an answer -- can you attach your entire script?

    It looks like you're confused about the differences between
    double variables and Series<double> variables.

    What are you trying to do, exactly?

    Comment


      #17
      Hello 0x7e2,

      Thanks for your notes.

      bltdavid has provided some great information on the topic..

      You would have to use a Series<double> variable instead of a double variable if you want to be able to access values using an index.

      See this help guide page about creating Series<T> variables: https://ninjatrader.com/support/help...t8/seriest.htm
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      478 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      321 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      258 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      342 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      310 views
      0 likes
      Last Post CarlTrading  
      Working...
      X