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 )
Can I ask you the same question again, but about my own simple editor-generated EA? I thought that now I will manage to do it myself, but I don't know where to put this Buy/Sell code. I don't know where to paste this Buy/Sell code.
amsgif80 #: 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.
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