Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1527
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
use the readings to build the logic for your indicator
No, it doesn't work like that.
here . 1 indicator always shows a number - 2147483647. as soon as a signal is received, it shows a different number on one of the buffers. This I have figured out.
But the second indicator always shows either 0 or 2147483647 on 2 buffers simultaneously
I think I've figured it out. It should be like this
no specifics are needed in this case, i.e. just if >0
in this case the specifics are not needed, i.e. just if >0
but what's in the buffers when there's no signal. i don't think >0 will work here. but i'll try it now
But here's what's in the buffers when there's no signal. I don't think >0 will work here. but I'll try it now
the first indicator has the value EMPTY_VALUE when there is no signal
do the following
Please help me to solve this problem with the tester. I am testing position opening for CME on EUR/USD futures
On the rise of the market in the tester I open a long position on the breakdown with my stop and the trade gets a ticket #2. The market goes up and the next position is opened with a stop and the trade gets ticket #3 in the tester.
When the market goes against the position #3 and reaches its stop, ideally #3 should close at the stop, and #2 should stay there, waiting for the price to reach the stop #2. But for some reason, when stop #3 triggered, the tester closes position #2 as well.
The code for mql5 is
Please help me to solve this problem with the tester. I am testing position opening for CME on EUR/USD futures
On the rise of the market in the tester I open a long position on the breakout with my stop and the trade gets number 2. The market went up and the next position is opened with a stop, the trade gets number 3 in the tester.
When the market goes against position #3 and reaches its stop, the idea is that #3 should close at the stop and #2 should stay there, waiting for the price to reach stop #2. But for some reason, when stop #3 triggered, the tester closes position #2 as well.
The code for mql5 is
the first indicator has a value of EMPTY_VALUE when there is no signal
should be done like this
Yes, that's right. That's it. Thank you very much.
I think the reason for the tester's behaviour has become clear. The type of demo account the robot is testing on is Netting. Therefore, if the stop specified when opening position #3 is triggered, it will close the entire volume of the position. Therefore, at the stop from #3, it closes #2 as well, even though it had its own separate stop set for it when it was opened.
With Hedging account type, everything would work like in good old mql4.
Please help me to solve this problem with the tester. I am testing position opening for CME on EUR/USD futures
On the rise of the market in the tester I open a long position on the breakdown with my stop and the trade gets a ticket #2. The market goes up and the next position is opened with a stop and the trade gets ticket #3 in the tester.
When the market goes against the position #3 and reaches its stop, ideally #3 should close at the stop, and #2 should stay there, waiting for the price to reach the stop #2. But for some reason, when stop #3 triggered, the tester closes position #2 as well.
The code for mql5 is as follows
You should not use stops. Instead of using stops, we should place pending orders of the opposite direction.