Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1068
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, how do I make 2 pending buy and sell orders to be placed when a new M1 candle is formed?
int timeM1=0;
int PlaceOrdersOnM1() {
datetime candleOpenTime=iTime(Symbol(),_Period,0);
if (timeM1==0) {
timeM1=candleOpenTime;
return 0;
}
if (timeM1!=candleOpenTime) {
timeM1=candleOpenTime;
int ticket1=OrderSend(...); // выставляет отложку 1
int ticket2=OrderSend(...);// отложку 2
return !(ticket1<0 || ticket2<0);
}
return 0;
}
// вызывать каждый тик или по таймеру (по вкусу)
written "by hand", never checked in any way
Hi, could you tell me how to make 2 pending buy and sell orders be placed when a new M1 candlestick is formed?
is the new candle open check function for any TF (very useful)
What does this warning mean in the tester?
2020.02.06 09:55:17.596 TestGenerator: unmatched data error (volume limit 95 at 2020.01.20 08:10 exceeded)
Is it possible to create functions where the parameter can be a variable of any type at once?
void Function (any_type A);
What does this warning mean in the tester?
2020.02.06 09:55:17.596 TestGenerator: unmatched data error (volume limit 95 at 2020.01.20 08:10 exceeded)
Is it possible to create functions where the parameter can be a variable of any type at once ?
Yes, the pattern is called
Yeah, the pattern is called
I don't get it.
Read the FAQ.
Still don't get it. Give a simple example between int, double and string please?
didn't get it.
Read the FAQ.
still do not understand. Give me a simple example between int, double and string please?
https://www.mql5.com/ru/docs/basis/oop/templates
Why put it in the OOP section?
https://www.mql5.com/ru/docs/basis/oop/templates
Why did you put it into the OOP section?
that's exactly what I read.
But it must have been written for those who knew but had forgotten.
That information didn't help me one bit.
Can you give me a simple example?