Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1596
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
I have built my first Expert Advisor from the kindly provided codes (special thanks toMakarFX_ for motivation and code)
Everything works as it should, but with one problem. I don't know where to look for it.
The algorithm is as follows:
there is a signal - order opens
close it using stop or take order in points, or after the profit and loss limits have been reached in depo currency CountLoss and CountProfit. (whichever comes first)
if a stop - the next order with a margin, if a take, CountProfit, CountLoss - the lot is reset to the initial one
if the Stop Loss is set to CountLoss , the next order is opened with the minimum lot, for example, instead of the starting lot:
in external variables the starting lot 0.02 is set, the next order at CountLoss will be the lot 0.01.
Can someone tell me where the error is ?
I have built my first Expert Advisor from the kindly provided codes (special thanks toMakarFX_ for motivation and code)
Everything works as it should, but with one problem. I don't know where to look for it.
The algorithm is as follows:
there is a signal - order opens
close it using stop or take order in points, or after the profit and loss limits achievement in depo currency CountLoss and CountProfit. (whichever comes first)
if a stop - the next order with a margin, if a take, CountProfit, CountLoss - the lot is reset to the initial one
if the Stop Loss is set to CountLoss , the next order is opened with the minimum lot, for example, instead of the starting lot:
in external variables the starting lot 0.02 is set, the next order at CountLoss will be the lot 0.01.
Can someone tell me where the error is ?
Look what I have changed in the function double Lots()
Will print once when there is a loss trade
Thank you, I got the idea. I compared the closing time of the current order to the closing time of the previous order and everything went as it should. I have also made the function of opening an order in the opposite direction with a stop loss, although it did not help much.
More specifically...
Good afternoon, all. Trying to implement profit and stop calculation using atr indicator. The stop works fine. But the profit is always set to the same value. Here is the code for profit calculation
What is the error that profit always has the same value? Huh?
Good afternoon, all. Trying to implement profit and stop calculation using atr indicator. The stop works fine. But the profit is always set to the same value. Here is the code for profit calculation
What is the error that profit always has the same value? Huh?
See what I changed in the double Lots() function
super! thanks a lot!
Thank you for your help - I changed a piece of code - everything worked. But can you describe in words what was the error, as I can't get ahead of it by eye?
your code has been split
I changed the password, rebooted, but nothing works.
The program logs the following
2021.08.23 11:54:18.236 MQL5 Market failed downloading product 'MACD Intraday Trend'(www.mql5.com:443 send failed [426: ])
Regards, Olga