Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 746

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
Guys, I have a function OnTimer() which should be executed at the beginning of each day and at certain result of execution EA should go to sleep. If I set time of next execution for function OnTimer() to the beginning of next day and after it the EA will go to sleep till the same moment (-1 second for example), the time counter will still be running and function will be executed after coming out of sleep after 1 second?
P. S. Another slightly worrying question, how could the documentation be written in such a cheesy style? I mean code spaces and staging of brackets, I've never seen anyone except "schoolchildren on programming labs" and guys who write in mql produce something like this
for(int x=0;x<10;x++)
{
}
The site corrects itself somehow, about parentheses I mean that parentheses are placed with tabulation, i.e. we cannot trace vertically intuitively where a parenthesis goes.
Guys, I have a function OnTimer() which should be executed at the beginning of each day and at certain result of execution EA should go to sleep. If I set time of next execution for function OnTimer() to the beginning of next day and after it the EA will go to sleep till the same moment (-1 second for example), the time counter will still be running and function will be executed after coming out of sleep after 1 second?
P. S. Another slightly worrying question, how could the documentation be written in such a cheesy style? I mean code spaces and staging of brackets, I've never seen anyone except "schoolchildren on programming labs" and guys who write in mql produce something like this
for(int x=0;x<10;x++)
{
}
As for parentheses, I mean that parentheses are placed with tabulation, i.e. it is impossible to follow intuitively where a parentheses goes vertically.
You can't trace vertically where the parenthesis goes, so you won't be able to see where it goes. You may put it to sleep for 5 minutes and put Print in OnTimer every 10 seconds. This will answer your question. Why go to sleep if you can simply change the key that determines the mode of the main algorithm in any other functions?
Hi all!
QUESTION on MT5. The text marks (numbers) are put as a thin grey bar. The dots are a control buffer to visualise the MT5 bloopers in my head....
Compared with Documentation for OBJ_TEXT, seems to be the same....
Hi all!
QUESTION on MT5. The text marks (numbers) are put as a thin grey bar. The dots are a control buffer to visualise the MT5 bloopers in my head....
Compared with Documentation for OBJ_TEXT, seems to be the same....
See what you pass in the fontsizes parameter
See what you pass in the fontsizes parameter
THANK YOU!!! Ihave put infontsizes from global variables. Set it in the void LabText function. It worked...
I want to add and delete indicators on the chart with the script, as applying the template deletes all the lines drawn.
I get reply
2019.01.24 19:14:53.633 add_ind (EURJPY,H1) cannot load indicator 'Moving Average' [4302]
Code compiles without errors though.
I want to add and delete indicators on the chart with the script, as applying the template deletes all the lines drawn.
I get reply
2019.01.24 19:14:53.633 add_ind (EURJPY,H1) cannot load indicator 'Moving Average' [4302]
Although code compiles without errors.
ERR_MARKET_NOT_SELECTED
4302
Symbol not selected in MarketWatch
Why do you put 0 instead of the symbol name? If you want the current one, you have to write NULL, or its name, for example "EURUSD".
iMA
Returns moving average indicator handle. Only one buffer.
intiMA(
string symbol, // symbol name
ENUM_TIMEFRAMESperiod, // period
int ma_period, // averaging period
int ma_shift, // indicator horizontal shift
ENUM_MA_METHODma_method, // type of smoothing
ENUM_APPLIED_PRICE applied_price // price type or handle
);
Parameters
symbol
[in] Symbol name of the instrument which data will be used to calculate the indicator. NULL means current symbol.
period
[in] Period value can be one of the values of ENUM_TIMEFRAMES enumeration, 0 means current timeframe.
ma_period
[in] Averaging period for moving average calculation.
ma_shift
[in] Shift of indicator relative to the price chart.
ma_method
[in] Averaging method. Can be any of values of ENUM_MA_METHOD.
applied_price
[in] Price used. Can be any of the price constants of ENUM_APPLIED_PRICE or a handle of another indicator.
Returned value
Returns handle of specified technical indicator, in case of failure returns INVALID_HANDLE. The IndicatorRelease() function is used to free the computer's memory from an indicator that is no longer in use.
Hello, could you please tell me how to make an array of MA handles return normal prices, I mean the way they should, 5 digits after the decimal point and not 8
cool)
Hello, could you please tell me how to make an array of MA handles return normal prices, I mean the way they should, 5 digits after the decimal point and not 8
mt5 language
DoubleToStr in mt5, there is noDoubleToString(); but it does not help