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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      72 views
      0 likes
      Last Post PaulMohn  
      Working...
      X