Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with a AND operator

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

    Problem with a AND operator

    Hello,

    I am trying to create a if condition with an AND operator for an indicator but it seems that the indicator find a signal every time there is a bar. I am new to programming, so I think that my condition is not built correctly. Here is the code below.

    Thanks in advance for your help,

    Manuel

    HTML Code:
    if (CurrentBar < 1)
    return;
    
    Minimum=MIN(Low,ChannelPeriod)[0];
    Maximum=MAX(High,ChannelPeriod)[0];
    
    if ((Low[0]>gapSize*High[1])&&(Maximum<ChannelSize*Minimum));

    #2
    Originally posted by Manuel17 View Post
    Hello,

    I am trying to create a if condition with an AND operator for an indicator but it seems that the indicator find a signal every time there is a bar. I am new to programming, so I think that my condition is not built correctly. Here is the code below.

    Thanks in advance for your help,

    Manuel

    HTML Code:
    if (CurrentBar < 1)
    return;
    
    Minimum=MIN(Low,ChannelPeriod)[0];
    Maximum=MAX(High,ChannelPeriod)[0];
    
    if ((Low[0]>gapSize*High[1])&&(Maximum<ChannelSize*Minimum));
    Open up NT's Output Window.... and use Print statements of your variables before your logic condition, to see what is being compared...

    Comment


      #3
      Hi Sledge, thanks for your answer. The issue was just with the ";"at the end of the if condition...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      579 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X