• 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 vivekniwas, 04-18-2018, 06:49 AM
      5 responses
      591 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by smcllr, Yesterday, 08:25 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by pol133, Today, 12:39 AM
      0 responses
      8 views
      0 likes
      Last Post pol133
      by pol133
       
      Started by giulia_brotzu, Yesterday, 10:09 PM
      0 responses
      4 views
      0 likes
      Last Post giulia_brotzu  
      Started by Woomera, Yesterday, 09:55 PM
      0 responses
      3 views
      0 likes
      Last Post Woomera
      by Woomera
       
      Working...
      X