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).
Please advise how to make an entry (the condition for opening a position) and if the same candle will trigger a take or stop so as not to open a new position (the condition for opening is satisfied). Thank you!
Profitpamm: 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).
Please advise how to make an entry (the condition for opening a position) and if the same candle will trigger a take or stop so as not to open a new position (the condition for opening is satisfied). Thank you!
Check by date if there is an open position and if the position was opened and closed on this candlestick...
Profitpamm: 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).
Please advise how to make an entry (condition for opening a position) and if the same candle will trigger a take or stop so as not to open a new position (the condition for opening is met). Thank you!
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.
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 );
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 );
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
);