Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AaronKoRn, Today, 09:49 PM
      0 responses
      7 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      9 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      10 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,980 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X