Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 225
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
Hi, I have a situation like this and I want to fix it without using crutches. The Expert Advisor opens a position and has a Stop and Take. There is a situation when during testing on one candle (that is when the condition of opening the position is fulfilled), right after the first order is closed, the second, third, etc. orders are opened. This is due to the fact that it is on this candle that the condition to open the position is met and after some time, a stop or take order is triggered (the opening condition is still satisfied, the candle is not closed).
Hi, I have a situation like this and I want to fix it without using crutches. The Expert Advisor opens a position and has a Stop and Take. There is a situation when during testing on one candle (that is when the condition of opening the position is fulfilled), right after the first order is closed, the second, third, etc. orders are opened. This is due to the fact that conditions for opening a position are fulfilled on that very candle and a stop or take order triggers some time later (the conditions for opening are still fulfilled, the candle is not closed).
Here's an example of how you can use it...
Check by date if there is an open position and if the position was opened and closed on that candle...
Here's an example of how it can be used...
The standard code from the reference does not work
https://docs.mql4.com/ru/basis/types/casting
Bringing data of the simple structure type
how to treat?
Used to convert values of different basic types. For example, there is an array uchar arr[].We need to write the value of double to a certain position.
void GetBytes(double x,uchar &arr[],int pos)
Or vice versa.
double GetDouble(uchar &arr[],int pos)
Perhaps someone may suggest a simpler solution.
doubleiMA(
stringsymbol,// symbol name
inttimeframe,// timeframe
intma_period,// period
intma_shift,// shift average
intma_method,// averaging method
intapplied_price,//price type
intshift// shift
);
doubleiMA(
stringsymbol,// symbol name
inttimeframe,// timeframe
intma_period,//period
intma_shift,// shift of average
intma_method,// averaging method
intapplied_price,//price type
int shift//shift
);
"EURUSD"
"EURUSD"
It's in inverted commas. Thank you!
doubleiMA(
stringsymbol,// symbol name
inttimeframe,// timeframe
intma_period,//period
intma_shift,// shift of average
intma_method,// averaging method
intapplied_price,//price type
int shift//shift
);