How to add a condition to High Low EA?? - page 2

 
EADeveloper:

High[] take the value from the current chart (Timeframe/Symbol) https://docs.mql4.com/predefined/variables/High

iHigh() you can choose the timeframe, symbol... https://docs.mql4.com/series/iHigh

Hi EADeveloper,

Good day,


Thanks a lot for your help explaining the difference between the two functions.


I just want to ask about something else if possible. I want to know where and how to insert this condition for buying and selling in the example code above in my 3rd post:

if(High[i+1]<High[i+2] && Low[i+1]>Low[i+2]


Please let me know if possible.

Best wishes, and thanks again.

 

Hi guys,


Good day,


O.k, at least I want to know how conditional signals can be set, and that's it.


If it is a hard thing to do, please let me know.


I was searching all around the forum, but didn't find anything similar to that at all.


I hope to hear from you soon.


Best wishes,

 
scarface wrote >>

Hi guys,

Good day,

O.k, at least I want to know how conditional signals can be set, and that's it.

If it is a hard thing to do, please let me know.

I was searching all around the forum, but didn't find anything similar to that at all.

I hope to hear from you soon.

Best wishes,

here in this lines ... if ( Monday ) if(DayOfWeek()==1){BuyOrdOpen(); SellOrdOpen();}
not testet but something like this

if (monday)

if (DayOfWeek()....)

if (High[1]<High[2]&&Low[1]>Low[2])

{Buy....Sell}

 
Hi Scarface, the reason you aren't finding any explicit mention in the forum, I believe, is because this is such a fundamental part of every EA. EAs will generally include signal generation / execution logic and risk / money management logic. Both sets of logic will usually be based upon the checking of numerous conditions. There are numerous operators in the MQL language which cause conditions to be evaluated. Examples are "if", "switch" and "while". It's up to you what the condition is and what action to take. CB
 
EADeveloper:

here in this lines ... if ( Monday ) if(DayOfWeek()==1){BuyOrdOpen(); SellOrdOpen();}
not testet but something like this

if (monday)

if (DayOfWeek()....)

if (High[1]<High[2]&&Low[1]>Low[2])

{Buy....Sell}

Hi EADeveloper,


Good day.


Thanks a lot for your great assistance. That was very helpful.


Now I can see where the problem is, and where I can insert such a condition.


Thanks again.


Best wishes,

 
cloudbreaker:
Hi Scarface, the reason you aren't finding any explicit mention in the forum, I believe, is because this is such a fundamental part of every EA. EAs will generally include signal generation / execution logic and risk / money management logic. Both sets of logic will usually be based upon the checking of numerous conditions. There are numerous operators in the MQL language which cause conditions to be evaluated. Examples are "if", "switch" and "while". It's up to you what the condition is and what action to take. CB

Hi CB,


Good day,


Thanks for the comments. I understand now what you mean. I know that each EA must have conditional signals so the EA works under some certain conditions.


That was great reminder. we always need to remember :)


Thanks again.


Best wishes,

Reason: