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 you are interested in calculation of data of another indicator, you can do it in the following way. First, we create another indicator with its own method of data calculation, and then we take the handle of this indicator(MQL5 Reference Guide / Technical Indicators / iCustom ) and this handle is used in the new indicator. Look carefully at the example. If you have any questions about the example
I have questions. I still do not understand it.
Ok, let's take Custom Moving Average.mq5 as a base.
add the new smoothing procedure MODE_MYMA to the list - no problem.
the question is how to feed the data. through the i-cast of another indicator? Ok, let's take any indicator made by the second form as an example (if the indicator is made by the first form... i don't know how to take the high-low... so it means only the second form?)
Ok, let's declare
int newHandl;
define it in the onInit (parabolic, i.e. whatever, the main thing is the 2nd type, right? I understand how to implement mine)
newHandl=iCustom(_Symbol,0, "ParabolicSAR.mq5",0.02,0.2);
and then? in onCalculate we feed it instead of the standard price?
CalculateEMA(rates_total,prev_calculated,begin,newHandl);???
does it swear. or what? please explain, I don't understand... (((((
yes, i'm still using mcl4 templates. there, it's simple - loop, data (any!) take, smooth out, output.
But here.... I don't know what to grab onto...
(if the indicator is made by the first form... I didn't understand where to take the high-low from... so it means only by the second form?)
Yes, about the high-low it was just an example, how to deal with articles by yourself. For the first form you can take the task of drawing the close[i]/2 line [or sqrt(close[i]/2 )]. In general, you can come up with a bunch of variations using a single array too.
OK, let's declare
int newHandl;
in onInit define it (as an example - parabolic. whatever, the main thing is the 2nd type, right? how to implement your own is roughly clear)
newHandl=iCustom(_Symbol,0, "ParabolicSAR.mq5",0.02,0.2);
That's fine. I will finish it now.
If the indicator handle is correct, it means that we can address to the buffers of this indicator. Look again at the example from MQL5 Reference / Technical Indicators / iCustom There is a line:
Now read MQL5 Reference / Access to Timeseries and Indicators / CopyBuffer (...Again: many things become clear when parsing examples line by line).
Try to receive data of any indicator buffer, which you have selected. I do not have a terminal, but in parabolic you can see which buffers are calculated and their numbering.
Question about description of ArrayIsSeries() and ArrayGetAsSeries() functions.
There is such a phrase in the Reference Manual:"Arrays passed into the function reflect price data, i.e., these arrays have the timeseries sign and the ArrayIsSeries()function will return true when checking these arrays . But still, in any case, the indexing direction should be checked only with function ArrayGetAsSeries()".
It follows from a literal reading that even if the ArrayIsSeries() function returns true (i.e. confirms that the array being checked is a timeseries array), still the indexing direction should be checked only by ArrayGetAsSeries() function anyway. Then I don't understand the reason for introducing the ArrayIsSeries() function if its results must be additionally checked anyway. What's the point? Is it possible that the array could be a timeseries, but its indexing direction won't be the same as that of a timeseries (the AS_SERIES flag will not be set)?
When porting from Mql4 to Mql5 a Lot error has popped up:
'Lot' - constant cannot be modified
How to correct?
When porting from Mql4 to Mql5, a Lot error has occurred:
'Lot' - constant cannot be modified
How do you fix it?
You can't. It's not a bug, it's a feature. :)
In mql5 input variables are not modifiable (const).
Make a simple decoupling:
In theMQL5 Manual / Array Operations / ArraySetAsSeries section, there is an example when the ArraySetAsSeries() function applies to the const datetime array &time[] on each tick:
Is this what everyone does (flips the array on every tick) to work with the array as a timeseries?
Another question: can arrays used by OnCalculate() arbitrarily change their indexing direction? Or is it enough to check this direction once?
When porting from Mql4 to Mql5 an error SymbolInfoDouble:
'SymbolInfoDouble' - no one of the overloads can be applied to the function call
How do I correct it?
When porting from Mql4 to Mql5, the SymbolInfoDouble error has appeared:
'SymbolInfoDouble' - no one of the overloads can be applied to the function call
How do I correct it?
Why is there a 0 at the bottom?
https://www.mql5.com/ru/docs/constants/environment_state/marketinfoconstants#enum_symbol_info_double
And in addition to this, check for division by 0.
The results of the strategy tester are displayed in charts:
Can you tell me where to find out what the different colours on the charts mean?
The results of the strategy tester are displayed in charts:
Can you tell me where to find out what the different colours on the charts mean?