Problem with conditions in EA

 

I have a problem with the condition for example to buy orders.
I want that the EA is opening an order when following conditions are met:

(GoLongSandR=true and(Pattern1=true or Pattern2=true or Pattern3=true)

That means always SandR + Pattern(s).

But it is opening orders when any of theses Patterns are met. It opens when only GoLongSandR=true. It opens when Pattern1=true and Pattern3=true (but not GoLongSandR). It opens when only Pattern2=true…etc. For example sometimes it opens correct with GoLongSandR=true and Pattern1=true.
Where is the error? Can anyone help? Thanks!

This is the code from the EA:

//--------------------------------------
   // Open Long 
   if(sqIsBarOpen == true) {
      if (((sqGetMarketPosition() == 0) 
      && ((GoLongSandR == true) 
      && ((Pattern1Long == true) 
      || ((Pattern2Long == true) 
      || (Pattern3Long == true))))))
      {
      // Action #1
      sqOpenOrder("NULL", OP_BUY, getOrderSize(MagicLong, OP_BUY ), getOrderPrice(MagicLong), Comment1, MagicLong, "Open Long");

      // Action #2
      sqDrawUpArrow(1);
      }
   }
   //--------------------------------------
   // Open Short 
   if(sqIsBarOpen == true) {
      if (((sqGetMarketPosition() == 0) 
      && ((GoShortSandR == true) 
      && ((Pattern1Short == true) 
      || ((Pattern2Short == true) 
      || (Pattern3Short == true))))))
      {
      // Action #1
      sqOpenOrder("NULL", OP_SELL, getOrderSize(MagicShort, OP_SELL ), getOrderPrice(MagicShort), Comment2, MagicShort, "Open Short");

      // Action #2
      sqDrawDownArrow(1);
      }
   }
 

use the SRC to write your codes

 
Nkechi Sonia Kanu:

use the SRC to write your codes

Aaah, a teacher! :/
Do you have any substantial solution for this problem? Besides remarking bullshit?

 
Oliver Jaschok:

Even though @Nkechi Sonia Kanu is still a beginner, he offered you good advice and did not insult you in any way.

Your attitude and use of vulgar language, not only is an insult to him, but can also get you banned from this site.

So, I suggest that you do modify your post and use the SRC to properly insert your code and amend your second post and remove the insult.

 
Fernando Carreiro:

Even though @Nkechi Sonia Kanu is still a beginner, he offered you good advice and did not insult you in any way.

Your attitude and use of vulgar language, not only is an insult to him, but can also get you banned from this site.

So, I suggest that you do modify your post and use the SRC to properly insert your code and amend your second post and remove the insult.



Wow! Another bla bla teacher! Who is not solution-oriented but likes to teach others. No one needs such people when you have a problem.

And I'm sure you're able to see the code. 😉 Even without SRC. Do you have any substantial solution for this problem?

 
Oliver Jaschok:
And you still want help with that attitude?

Good luck!
 
Fernando Carreiro:
And you still want help with that attitude?

Good luck!


Oh no, of course not from you! I ask you when I need someone who likes to rebuke another but is not interested in solving a problem and wasting other peoples time! XD
 
Oliver Jaschok:

And don't answer inside the quote.

Banned 1 day to learn to be civil.

 
Oliver Jaschok:

You lack manners, traditionally one hardly finds people that are willing to help in this forum especially in coding for free and with this ur attitude, i pity you.

 
Nkechi Sonia Kanu:

You lack manners, traditionally one hardly finds people that are willing to help in this forum especially in coding for free and with this ur attitude, i pity you.

Thanks for the rebuke! :)

I'm trying to explain to you: For example you are an experienced excel-user and your working on a problem you can't solve at the moment. You're asking your colleague for help and the only thing he says is: "You're not wearing a tie!" Nothing else. And goes away.

What do you think about such people? Formally he was right, but did it help you? Is this the help you want for yourself? We all know the answer. Right? ;) Think about it! 

Anyway....I solved the problem and the EA is working. Everything is fine. Have a nice day! :)

 
Oliver Jaschok:

Thanks for the rebuke! :)

I'm trying to explain to you: For example you are an experienced excel-user and your working on a problem you can't solve at the moment. You're asking your colleague for help and the only thing he says is: "You're not wearing a tie!" Nothing else. And goes away.

What do you think about such people? Formally he was right, but did it help you? Is this the help you want for yourself? We all know the answer. Right? ;) Think about it! 

Anyway....I solved the problem and the EA is working. Everything is fine. Have a nice day! :)


Any way hope no hard feeling....have a nice day too.

Reason: