Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1632
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This is the code I tried to insert:
At the top of the code throw this:
enum ENUM_DIRECTION{
DIRECTION_BUY = 0, // buy only
DIRECTION_SELL = 1, // sell only
DIRECTION_ANY = 2, // buy & sell
};
input ENUM_DIRECTION inp_direction = DIRECTION_ANY; // allowed trade direction
further find where in code opens buy and where sell. Look inside the start() or OnTick() function
where buy is in the conditions add:
if(inp_direction!=DIRECTION_SELL)
where sell is in the conditions add:
if(inp_direction!=DIRECTION_BUY )
Where did you put it in?
This section should be like this
This section should be like this.
Makar, this one.
if(inp_direction==DIRECTION_SELL||inp_direction==DIRECTION_ANY)
is better replaced by this.
if(inp_direction!=DIRECTION_BUY)
Makar, this one
is better replaced by this.
This section should be like this
Thank you from the bottom of my heart! It all worked at once, it's working. And I've already racked my brains as to how to do it))
Can I ask you the same question again, but about my own simple editor-generated Expert Advisor? I thought that now I will manage to do it myself, but I don't know where to put this Buy/Sell code. I cannot figure out where to paste this Buy/Sell code.
I have shown you how to insert the code in the forum
You haven't changed anything.
your appeal
is inside.
Makar thanks for the tip