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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      53 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X