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