Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 352
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
Thank you, but she's
iCustom to help
iCustom is a good solution for iCustom but iCustom always executes the whole code of the indicator, and if i need many indicator parameters in an EA (and it is) then instead of one indicator calculation we will get several, which can significantly slow down the process until the current tick is missed, i forgot about the predefined variables.....
int rates_total=Bars;
defined global variable
int prev_calculated=0;
crashes on number of array elements
I'm sorry, but I don't understand why oncalculate should pass values of predefined variables if they are global and also available
Take a look at an example
Parameters of a function can be input - which we pass to it, and output - which it returns to us
These variables are needed to calculate the whole indicator line, but you need a single value. Everything is much simpler. Analyse the indicator programme and determine which formula is used for calculation. And use this formula in the Expert Advisor
Guys, tell me how to implement this algorithm:
There is a time series with volume Volume
I want to compare Volume[1] to be larger than each of previous Volume[1] bars and specify a window (number) of previous bars with external variable (extern int)
Write a code sample, if it's not difficult
Guys, tell me how to implement this algorithm:
There is a time series with volume Volume
I want to compare Volume[1] to be larger than each of previous Volume[1] bars and specify a window (number) of previous bars with external variable (extern int)
Write a code sample, if it's not difficult
Did it work? How did it work before?
It worked without errors, I seem to have removed it myself, by auto-replacement via ctrl+h, and didn't notice >_<. Anyway, it's probably the Illuminati that did it. Thanks again !
Guys, tell me how to implement this algorithm:
There is a time series with volume Volume
I want to compare Volume[1] to be larger than each of previous Volume[1] bars and specify a window (number) of previous bars with external variable (extern int)
Write a code sample, if it's not difficult
It's not difficult. I wrote it on my knees from memory (I may have missed something)...
Hello. I can't share the file. The task - I need the file of older period (e.g. M20) to be generated on М1 during manual testing in МТ4 (MQL4) tester. For this purpose I wrote an indicator based on the PeriodConverter script. Since in testing mode it is impossible to save the file (EURUSD20.csv) directly to the folder History, the file is saved in the folder shared by all terminals - \\MetaQuotes\Terminal\Common. Then the looped script, working on a standard M1 chart, copies data from the file EURUSD20.csv to the file EURUSD20.hst, located in the folder History. The file EURUSD20.csv cannot be opened in the script, if at the same time it is opened in the indicator in the tester (5004 ERR_FILE_CANNOT_OPEN File open error). If you remove the indicator from the tester, the file in the script is opened and copied without problems. The file is opened in the indicator as follows: ExtHandle=FileOpen(c_symbol+(string)20+".csv",FILE_BIN|FILE_WRITE|FILE_SHARE_WRITE|FILE_READ|FILE_SHARE_READ|FILE_COMMON);
The file in the script is opened as follows: ExtHandleR=FileOpen("EURUSD20.csv",FILE_BIN|FILE_READ|FILE_SHARE_READ);
Please indicate my mistake.
Hello. I can't share the file. The task - I need the file of older period (e.g. M20) to be generated on М1 during manual testing in МТ4 (MQL4) tester. For this purpose I wrote an indicator based on the PeriodConverter script. Since in testing mode it is impossible to save the file (EURUSD20.csv) directly to the folder History, the file is saved in the folder shared by all terminals - \\MetaQuotes\Terminal\Common. Then the looped script, working on a standard M1 chart, copies data from the file EURUSD20.csv to the file EURUSD20.hst, located in the folder History. The file EURUSD20.csv cannot be opened in the script, if at the same time it is opened in the indicator in the tester (5004 ERR_FILE_CANNOT_OPEN File open error). If you remove the indicator from the tester, the file in the script is opened and copied without problems. File is opened in the indicator as follows: ExtHandle=FileOpen(c_symbol+(string)20+".csv",FILE_BIN|FILE_WRITE|FILE_SHARE_WRITE|FILE_READ|FILE_SHARE_READ|FILE_COMMON);
File is opened in the script as follows: ExtHandleR=FileOpen("EURUSD20.csv",FILE_BIN|FILE_READ|FILE_SHARE_READ|FILE_COMMON);
Please point out my mistake.
Have you pointed it out?
Did you specify it?
I don't get it. This option indicates the location of the file - \MetaQuotes\Terminal\Common. Without this option I won't be able to grab the file that was generated in the tester. Without this option the file will be searched in MQL4\Files - and I cannot put the file from the tester there.