• 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 bouncetherubble, Yesterday, 08:42 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by bortz, Yesterday, 08:18 AM
      5 responses
      35 views
      0 likes
      Last Post bortz
      by bortz
       
      Started by GARZONJ, Yesterday, 09:02 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by siroya, Today, 06:32 AM
      4 responses
      19 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by cstern71, 09-02-2019, 10:30 AM
      2 responses
      40 views
      0 likes
      Last Post tgn55
      by tgn55
       
      Working...
      X