
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
oh how! question to question - that's wise!
the position is opened by your expert my_first_ea_sartrailing.mq5
I just don't remember everything, that's why I'm asking.
You should clear the structure of the trade request before filling it: ZeroMemory( mrequest);
This is how it should be (add it in two places):
ZeroMemory( mrequest); // добавить
mrequest.action = TRADE_ACTION_DEAL; // есть
I just don't remember everything, that's why I'm asking.
You need to clean up the structure of the trade request before filling it: ZeroMemory( mrequest);
This is how it should be (add it in two places):
ZeroMemory( mrequest); // добавить
mrequest.action = TRADE_ACTION_DEAL; // есть
clearing the ZeroMemory( mrequest) structure does not change the situation:
The tester still outputs
2017.08.25 12:47:50.311 2016.01.13 16:00:00 failed instant sell 0.10 EURUSD at 1.08275 sl: 1.08575 tp: 1.07275 [Invalid request]
2017.08.25 12:47:50.311 2016.01.13 16:00:00 Alert: Request to set Sell order failed - error code:4756
In the Expert Advisor you took for an example (my_first_ea.mq5) the standard CTrade class is not used, but the structure of the trade zap is filled in.
It is clear, both articles (yours and https://www.mql5.com/en/articles/100 ) were written for beginners.
At the same time my_first_ea.mq5 is still tested without errors, but your my_first_ea_sartrailing.mq5 is not.
Why?
For some reason after ZeroMemory() positions started to open.
Hello everyone. And who can write such a robot that will trawl, even probably not trawl, but close all positions (both open and pending-this can be optional) when the profit on all open positions decreases to a given value! Example: the profit on all open positions is 200 USD and I do not want to lose more than 20 per cent of this amount, i.e. when the profit drops to 160 USD, the Expert Advisor will close all positions.
I believe that this is a simple matter for programmers.
***
I believe it's a simple matter for programmers.
These are the phrases programmers hate the most. That's for future reference.
These are the phrases programmers hate the most. That's for future reference.
Okay. Got it.)
Okay. Got it.)
Search the words "Trailing" "Balance" "Equity."