Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 545
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
If in the indicator itself in the Expert Advisor
how does the indicator code recognise the transmitted parameters and the names are different?
But everything is as you said. Checked again with the script)
The variable(s) in the calling program can be named as you want and its name is not related to the variable name in the indicator, they are different variables, and they are called from different terminal threads.
The indicator is called based on its name, the parameters are passed for it during each call from the 4th position and then the iCustom() parameters.
If the variable per1=9; is declared and iCustom() is on position 4, the indicator will be calculated with a period of 9, if you set another variable, its value will be used during the calculation. The variable that will be passed (its reference) as the first parameter of the indicator - in the fourth place iCustom() of the second one and so on.
The variable(s) in the calling program can be named as you like, its name is not related to the variable name in the indicator, they are different variables, and they are called from different terminal threads.
The indicator is called by its name, the parameters are passed to it during each call from the 4th position, and then the iCustom() parameters.
If the variable per1=9 is declared and iCustom() is positioned at 4, the indicator will be calculated with a period of 9; if you set another variable, its value will be used during the calculation and this applies to all parameters of the indicator, the main thing is to set them in the right order, as in the indicator itself. The variable that will be passed (its reference) as the first parameter of the indicator - the fourth iCustom() of the second one and so on.
I thought I should not litter the forum and have a separate topic, but I really hope for a constructive feedback on my problem, I am not moving forward without it :(.
I have tried to write various indicators, everything seems to be OK, now I have imported everything to my EA using iCustom() function. The code in the Expert Advisor:
The indicator itself (I wrote it for testing)
Next, the EMPTY_VALUE thing when testing.
I.e., when we start testing, we have the start date of the EA and everything before that date iCustom gives the correct indicator values, everything after that is directly tested - EMPTY_VALUE. :(
I'm already tired to google and forum, they write about "do not look into the future", but I do not see that in the code. Where am I a fool?)
I thought I should not litter the forum and have a separate topic, but I really hope for a constructive feedback on my problem, I am not moving forward without it :(.
I have tried to write various indicators, everything seems to be OK, now I have imported everything to my EA using iCustom() function. The code in the Expert Advisor:
The indicator itself (I wrote it for testing)
Next, the EMPTY_VALUE thing when testing.
I.e., when we start testing, we have the start date of the EA and everything before that date iCustom gives the correct indicator values, everything after that is directly tested - EMPTY_VALUE. :(
I'm already tired to google and forum, they write about "do not look into the future", but I do not see that in the code. Where am I a fool?)
The error seems to be in the Expert Advisor's code, why don't you use a debugger? Set checkpoints, see variable values, and see if the indicator is called, what is before and after your date
The debugger can only be used in demo account mode, not in testing, besides I wrote - the indicator is called, works and returns values, even correct, but only before the specified date (start date of testing). I output the values of the variables in the EA, that's why I say that everything is good at first, and then EMPTY_VALUE
The debugger can only be used in demo account mode, not in testing, besides I wrote - the indicator is called, works and returns values, even correct, but only until the specified date (testing start date). I output the values of the variables in the EA, that's why I say that everything is good at first, and then EMPTY_VALUE
Have you read carefully how to track new bars in custom indicators?
[QUOTE]The first rates_total parameter contains the number of bars available to the indicator for calculation and corresponds to the number of bars available in the chart.
Note the connection between the value returned by OnCalculate() and the second input parameter prev_calculated. The prev_calculated parameter in the function call contains a value returned by OnCalculate() on previous call. This allows for economical algorithms for calculating the custom indicator in order to avoid repeated calculations for those bars that haven't changed since the previous call of this function.
For this, it is usually enough to return the value of the rates_total parameter, which contains the number of bars in the current function call. If since the last call of OnCalculate() price data have changed (a deeper history has been pumped or history blanks have been filled), then the value of the input parameter prev_calculated will be set to zero by the terminal. [/QUOTE]
You need to find the average of the one-day moments over 20 days and then find the average of the 20-day moments over five days.
Finding the 20-day average was not a problem. But Idon't knowhow to getthe five-day averagefrom this average .
You need to find the average of the one-day moments over 20 days and then find the average of the 20-day moments over five days.
Finding the 20-day average was not a problem. But Idon't knowhow to getthe five-day averagefrom this average .
Help
Timer doesn't work, returns fouls and error 4051
Or should it not work in the tester?
Dear GURU ! Help with the Expert, there are 2 compilation errors - 'MarketInfo' - syntax error and not all control paths return a value
I'm begging you - I don't have the brains for it.
int init() {gd_348 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
switch MarketInfo(Symbol(), MODE_MINLOT) {
case 0.001:
gd_256 = 3;
break;
case 0.01:
gd_256 = 2;
break;
case 0.1:
gd_256 = 1;
break;
case 1.0:
gd_256 = 0;
}
return (0);
}
int deinit() {
return (0);
}
Decompiled deleted