Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 234
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
It is painful to watch the giants of the forum fighting over trifles. This is a forum of programmers of the most powerful resource. Be polite. Suggestion:
1. If an attempt is made to switch to personalities, even in a surreptitious manner, ban for 24 hours;
2. insulting a person - one week ban;
3. repeated insults with swearing - one month ban;
4.Ignoring all previous warnings and repeating violations in a harsh form - perpetual ban.
I absolutely agree, except that, unfortunately, the moderators here are not competent enough to detect "something in disguise". It's the same with all the subtle diplomats here.
Sorry for the offtops, but maybe someone can tell me what it is about:
From the handbook:
"It is possible to pass parameters by reference. In this case, modification of such parameters will affect the corresponding variables in the called function passed by reference. The elements of arrays cannot be passed by reference. Parameters can be passed by reference only within the limits of a single module, such an opportunity is not provided for library functions. In order to specify that the parameter is passed by reference, the & modifier must be placed after the data type.
Arrays can also be passed by reference, all changes will be reflected in the initial array. Unlike simple parameters, arrays can be passed by reference in library functions as well".
To pass a value by reference from a library function, I have to use a proxy in the form of an array of unit dimension,
are there any other workarounds?
And why is it done that way?
Sorry for the offtops, but maybe someone can tell me what it is about:
From the handbook:
"It is possible to pass parameters by reference. In this case, modification of such parameters will affect the corresponding variables in the called function passed by reference. One cannot pass elements of arrays by reference. Parameters can be passed by reference only within the limits of a single module, such an opportunity is not provided for library functions. To specify that the parameter is passed by reference, modifier & must be placed after the data type.
Arrays can also be passed by reference, all changes will be reflected in the initial array. Unlike simple parameters, arrays can be passed by reference in library functions as well".
1. To pass a value by reference from a library function, I have to use a proxy in the form of an array of unit dimension,
are there any other workarounds?
2. why is it done that way?
1. Right. There is no other way in MQL4.
2. What exactly? If we're speaking about passing by reference, then it's for passing large volumes of data (greater than the base type's length). Not to load the stack with them. Usually, structures, classes and arrays are passed by the pointer or reference. Although the class and structure can be returned from the function through return. You can also return a reference or pointer to a class, structure or array.
I have this problem:
When I change the stoploss, from time to time it fails to place a stop on the last order opened. It happens quite rarely, but it shoots through from time to time.
I do not have any errors in prices. Just a scumbag sometimes does not put an order on the last position, after which the order is recalculated.
Can you tell me where I did it wrong?
It is painful to watch the giants of the forum fighting over trifles. This is a forum of programmers of the most powerful resource. Be polite. Suggestion:
1. If an attempt is made to switch to personalities, even in a surreptitious manner, ban for 24 hours;
2. insulting a person - one week ban;
3. repeated insults with swearing - one month ban;
4.Ignoring all previous warnings and repeating violations in a harsh form - perpetual ban.
I have this problem:
When I change the stoploss, from time to time it fails to place a stop on the last order opened. It happens quite rarely, but it shoots through from time to time.
I do not have any errors in prices. Just a scumbag sometimes does not put an order on the last position, after which the order is recalculated.
Please, advise me where I did it wrong?
Explain this sequence in words:
In simple terms, how would you tell a mate who is far from programming
We want to earn, for example, 50 pips per position. StopLoss equals our average price + 50 pips .
If we have an open long position, we earn a certain amount of money on it. We set StopLoss at a certain level. Let the market grow further. If we are not earning enough money yet, we wait until we start earning enough.
We open another position in the Buy direction. The average price changes, we change the StopLoss.
And of course we set stops, follow the rules of a broker (trade flow, stop level), otherwise the broker will not understand us :)))
I hope I managed to explain :))
We want to earn, for example, 50 pips per position. StopLoss equals our average price + 50 pips .
If we have an open long position, we earn a certain amount of money on it. We set StopLoss at a certain level. Let the market grow further. If we are not earning enough money yet, we wait until we start earning enough.
We open another position in the Buy direction. The average price changes, we change the StopLoss.
And of course we set stops, follow the rules of a broker (trade flow, stop level), otherwise the broker will not understand us :)))
I hope I managed to explain :))
Yeah ... I meant - the logic of those lines ...
You have ambiguous logic there, as there are no curly brackets. Which means that not every line will be satisfied if the preceding condition is satisfied
I have this problem:
When I change the stoploss, from time to time it fails to place a stop on the last order opened. It happens quite rarely, but it shoots through from time to time.
I do not have any errors in prices. Just a scumbag sometimes does not put an order on the last position, after which the order is recalculated.
Please tell me where I did it wrong?
It's better to do it this way (someone wrote that he had problems when modifying or deleting orders with your way of doing it) :
And why oil and butter ??? (leave one thing alone)
And of course when we open the next buy, we immediately roll over (StopLoss equals our average price + 50 pips) on all positions .
This is the scoundrel who sometimes does not take the last position. We had 3 positions, but 4 of them opened. I forgot to put StopLoss on the fourth position.
DedZone should be held:
The DedZone calculation is in the initialization of the Expert Advisor.