Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1631
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
Good afternoon!!!
Help me out here. I am adding a trailing stop to a grid EA, so far only to the first order. Trail has not triggered yet. What is the problem?
Here is the code fragment where single orders are opened
Here is the modification function for single orders
Thank you!!!!
Good afternoon!!!
Help me out here. I am adding a trailing stop to a grid EA, so far only to the first order. Trail has not triggered yet. What is the problem?
Here is the code fragment where single orders are opened
Here is the modification function for single orders
Thank you!!!!
You're right, it works...there's an error in the docks.
You only have a call to the trawl when there are no orders...
Changed nothing has changed
Changed nothing has changed
You haven't changed anything.
your conversion
if (CountTrade() == 1) Trailing();
is inside.
Write it in the MQL5 code of the Expert Advisor and you will have this option.
Write it in the MQL5 code of the Expert Advisor and you will have this option.
I tried, it didn't work. I'm a complete novice at it :(
I tried, but it didn't work. I am a complete novice in this business :(
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 )