• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compile error with MIN and MAX variable assignment

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

    Compile error with MIN and MAX variable assignment

    Code:
    double channelLow = MIN(Low, Bob);
    
    double channelHigh = MAX(High, Bob);
    Bob is an integer input for bars back. When I compile I get the message: Cannot implicitly convert type 'NinjaTrader.indicator.MAX' to 'double' and Cannot implicitly convert type 'NinjaTrader.indicator.MIN' to 'double'

    Am I doing something wrong?

    KD

    #2
    imported post

    Yes. MIN/MAX are indicators. To access value at most current bar try

    double channelLow = MIN(Low, Bob)[0];
    DierkNinjaTrader Customer Service

    Comment


      #3
      imported post

      Thanks Man! I thought that [0] was implicit, but adding it fixed the problem.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Yaron, Today, 04:01 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by corman, Today, 04:28 AM
      0 responses
      11 views
      0 likes
      Last Post corman
      by corman
       
      Started by schwamm, Today, 04:26 AM
      0 responses
      7 views
      0 likes
      Last Post schwamm
      by schwamm
       
      Started by elliot5, Today, 04:20 AM
      1 response
      10 views
      0 likes
      Last Post elliot5
      by elliot5
       
      Started by aviat72, Today, 12:41 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Working...
      X