Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1943

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
Why does MT5 code work but MT4 does not? build 1Z5Z
Saves the pattern but does not apply the pattern
it's called opening prices.
it's elementary.
it's called opening prices.
is elementary.
I don't figure it out. A tick comes in, the check goes through. The next tick comes in and it checks again. The same timer does not fit in the opening.
The only thing I can think of is to memorize the time of the opening, add the time of the candle to it and check the current time against the new value
I don't get it. A tick comes in, it's checked. The next tick comes, it's checked again. The same timer doesn't fit in the opening.
I can only remember the opening time, add the candle time to it and check the current time against the new value
Forum on trading, automated trading systems and strategy testing.
Any questions from newbies in MQL4 and MQL5, any help and discussion of algorithms and codes
Valeriy Yastremskiy, 2022.03.30 09:37
If you do not know the algorithm, you will get an alert when the price reaches the end of the day. When a new bar appears,iTime(NULL,0,0) will be changed and the equality will not be once, then the equality and the if will be false.
You can also do it this way.
Or we could get a new bar on any timeframe.
The call would be as follows
You didn't write whether this is on the same instrument or on different positions?
Let it be all within the same currency pair, EurUsd for example. Both are open in Buy.
Let it be all within the same currency pair, EurUsd for example. Both are open in Buy.
Generally these are different tasks, on different pairs and on the same one. On one currency pair with the same lot 2 orders/positions have different options: non-crossing and crossing. Above the one below that is either loss or profit depending on the distance to the orders. For one direction between, one in profit the other in loss, above below both in profit or in loss.
It should be set according to your preferences. If the volume is the same, you should close the same volume. If it is not the same, you should calculate the amount of money in profit, the amount of loss in the money, calculate the ratio of profit to loss, multiply this ratio by the number of lots of a losing position and close this part.
function
These are different tasks, on different pairs and on the same pair. On one, with the same lot 2 orders/positions have options divergent not crossed, and crossed. price between non-crossed ones is loss for both, crossed ones have profit only between orders. Above the one below that is either loss or profit depending on the distance to the orders. For one direction between, one in profit the other in loss, above below both in profit or in loss.
It should be set according to your preferences. If the volume is the same, you should close the same volume. If it is not the same, you should calculate the amount of money in profit, the amount of loss in the money, calculate the ratio of profit to loss, multiply this ratio by the number of lots of a losing position and close this part.
That's right) That's exactly what I want. To calculate and close the losing part.
Any examples?
I tried while, got confused and failed.
function