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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      169 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      326 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      252 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      353 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      180 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X