Download MetaTrader 5

How to teach an EA not to trade in certail circumstances?

To add comments, please log in or register
Bharamappa Gojanur
351
Bharamappa Gojanur  
please give me ideas or any links for such programming in MQL5
Alain Verleyen
Moderator
32809
Alain Verleyen  
drbmgojanur:
please give me ideas or any links for such programming in MQL5
Which circumstances ?
Simon Gniadkowski
Moderator
18021
Simon Gniadkowski  
drbmgojanur:
please give me ideas or any links for such programming in MQL5
Look here: Broad answer to a non-specific question
Dua Yong Rew
5485
Dua Yong Rew  

if conditions then

do this

else do that

Bharamappa Gojanur
351
Bharamappa Gojanur  
angevoyageur:
Which circumstances ?
like when market is trending or not trending
Bharamappa Gojanur
351
Bharamappa Gojanur  
doshur:

if conditions then

do this

else do that

thanks ,like a zen answer i take n try it :)
Alain Verleyen
Moderator
32809
Alain Verleyen  
drbmgojanur:
like when market is trending or not trending
Simply detect when the market is in a trend
Simon Gniadkowski
Moderator
18021
Simon Gniadkowski  
drbmgojanur:
like when market is trending or not trending

First define what you consider to be a trend,  write it down in such detail that you can code it.  Create a function, bool IsTrend() and code it with the information in your trend definition so that if there is a trend it returns true,  otherwise it returns false.

Then in your code when you are about to place a trade first call IsTrend(),  if it returns true place the trade,  if not return . . . 

Alain Verleyen
Moderator
32809
Alain Verleyen  
RaptorUK:

First define what you consider to be a trend,  write it down in such detail that you can code it.  Create a function, bool IsTrend() and code it with the information in your trend definition so that if there is a trend it returns true,  otherwise it returns false.

Then in your code when you are about to place a trade first call IsTrend(),  if it returns true place the trade,  if not return . . . 

Do you see that ! Programming is so easy
Bacha Rehman
4594
Bacha Rehman  
angevoyageur:
Do you see that ! Programming is so easy
If programming was easy then no one would pay programmers for their work. In-fact every one would be a programmer him/herself . Coming to the point: My answer would be exactly like RaptorUK
Simon Gniadkowski
Moderator
18021
Simon Gniadkowski  
bachapk:
If programming was easy then no one would pay programmers for their work. In-fact every one would be a programmer him/herself . Coming to the point: My answer would be exactly like RaptorUK
Most things are relative . . .  coding is simple compared to formulating a winning trading strategy . . .  IMO.  Most people think the other way around . . .  I wonder who is right ?
12
To add comments, please log in or register