Questions from Beginners MQL5 MT5 MetaTrader 5 - page 581
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
Hello gentlemen of the forum!!! I have a problem. I tested the Expert Advisor on weekdays for one result, but on weekends it gives me a totally different result! Can you please tell me why?
because at the weekend they widen the spread
Here is the dialog panel with the CEdit control (for clarity, the example is made as a single file) - the panel checks the characters entered. Only numbers are allowed:
Thanks for the code. But another question is this. I compiled the code in mt5. It turns out that you can still enter letters in edit, but if you enter letters, when you finish entering it, it says "Only numbers are allowed" in edit. But how to make it impossible to enter letters into udite?
Colleagues, trying to take a signal from this line:
if((MathAbs(d_f)>(K_F*Point)) && (d_f>0.0)) // Signal to buy
But the compiler complains that "Point - undeclared identifier".
This is MT5.
Isn't it a predefined variable?
Colleagues, trying to take a signal from this line:
if((MathAbs(d_f)>(K_F*Point)) && (d_f>0.0)) // Signal to buy
But the compiler complains that "Point - undeclared identifier".
This is MT5.
Isn't it a predefined variable?
Colleagues, trying to take a signal from this line:
if((MathAbs(d_f)>(K_F*Point)) && (d_f>0.0)) // Signal to buy
But the compiler complains that "Point - undeclared identifier".
This is MT5.
Isn't it a predefined variable?
You need to usePoint().
Thank you.
Another question. I want to take the value of the curve on the current and last closed candle, as well as on the last closed and penultimate closed candle.
Do I need to use an array here?
I have a mashka that has 3 input parameters. I'm trying to build an address to it:
//----------------------
double P0, P1, P2; // indicator value at the current candle, last closed candle
P0 = iCustom(NULL, 0, "VIDYA", InpPeriodCMO, InpPeriodEMA, InpShift); //The indicator price on the current candle
P1 = iCustom(NULL, 0, "VIDYA", InpPeriodCMO, InpPeriodEMA, InpShift); //The indicator price on the latest closed candle
P2 = iCustom(NULL, 0, "VIDYA", InpPeriodCMO, InpPeriodEMA, InpShift); //The indicator price on the penultimate closed candle
//----------------------
The bottom three lines are the same, I wrote it this way, because I don't understand how to read the value at the previous candlestick. It takes the current one correctly, and outputs it correctly using Alert.
Maybe we should somehow define a loop, where the current value will be written and with each new candlestick is shifted back, becoming first the last closed, and then the penultimate closed candlestick.
How to do this in an intelligent way? ))
Colleagues, trying to take a signal from this line:
if((MathAbs(d_f)>(K_F*Point)) && (d_f>0.0)) // Signal to buy
But the compiler complains that "Point - undeclared identifier".
This is MT5.
Isn't it a predefined variable?
And then you write this:
Thank you.
Another question. I want to take the value of the curve on the current and last closed candle, as well as on the last closed and penultimate closed candle.
Do I need to use an array here?
I have a mashka that has 3 input parameters. I'm trying to build an address to it:
//----------------------
double P0, P1, P2; // indicator value at the current candle, last closed candle
P0 = iCustom(NULL, 0, "VIDYA", InpPeriodCMO, InpPeriodEMA, InpShift); //The indicator price on the current candle
P1 = iCustom(NULL, 0, "VIDYA", InpPeriodCMO, InpPeriodEMA, InpShift); //The indicator price on the latest closed candle
P2 = iCustom(NULL, 0, "VIDYA", InpPeriodCMO, InpPeriodEMA, InpShift); //The indicator price on the penultimate closed candle
//----------------------
The bottom three lines are the same, I wrote it this way, because I don't understand how to read the value at the previous candlestick. It takes the current one correctly, and outputs it correctly using Alert.
Maybe we should somehow define a loop, where the current value is written and with each new candlestick is shifted back, becoming first the last closed, and then the penultimate closed candlestick.
How to do this in an intelligent way? ))
So, still: do you write in MT5 or in MT4?
Added:Insert code correctly in the forum
and then you write this:
So, still: are you writing in MT5 or MT4?
Added:Inserting the code correctly in the forum
MT5. Don't judge harshly, I'm just starting out.
The compiler doesn't seem to swear.