I hope this is the right are for my problem.
I want to tell my EA to use Stochastic.
iStochastic should suffice. But then I am very unsure about the parameters. Also, there are different calculations for Stochastic and especially the definition of its parameters (this is like wtf is it so difficult to declare each calculation a different name?).
So here is my calculation:
K=(C-min_5(lowest low))/(max_5(highest high)-min_5(lowest low))*100
C is the close of the last period
min_5 / max_5 considers the last 5 periods
lowest low uses the lowest low based on low prices of the last periods
...
%K = moving average_3 of K
moving averafe_3 is a simple average of K of the last 3 Ks
%D = moving average_3 of %K
the same like above
for my calculations, I only need the %K.
My questions are:
1. What calculation does MQL4 do with 'iStochastic'?
2. What does the parameter 'price_field' mean? The options are 0 - Low/High or 1 - Close/Close. The same questions occurs in MT4. I do not know, how the calculation is directly affected by changing from 0 to 1.
3. What does parameter 'mode' mean? The options are MODE_MAIN or MODE_SIGNAL. Here, I do not know which of the three (K,%K,%D) lines is MAIN or SIGNAL.
4. What value will be returned by iStochastic? I assume it is the MODE value...
Please, can someone help me?
I want to tell my EA to use Stochastic.
iStochastic should suffice. But then I am very unsure about the parameters. Also, there are different calculations for Stochastic and especially the definition of its parameters (this is like wtf is it so difficult to declare each calculation a different name?).
So here is my calculation:
K=(C-min_5(lowest low))/(max_5(highest high)-min_5(lowest low))*100
C is the close of the last period
min_5 / max_5 considers the last 5 periods
lowest low uses the lowest low based on low prices of the last periods
...
%K = moving average_3 of K
moving averafe_3 is a simple average of K of the last 3 Ks
%D = moving average_3 of %K
the same like above
for my calculations, I only need the %K.
My questions are:
1. What calculation does MQL4 do with 'iStochastic'?
2. What does the parameter 'price_field' mean? The options are 0 - Low/High or 1 - Close/Close. The same questions occurs in MT4. I do not know, how the calculation is directly affected by changing from 0 to 1.
3. What does parameter 'mode' mean? The options are MODE_MAIN or MODE_SIGNAL. Here, I do not know which of the three (K,%K,%D) lines is MAIN or SIGNAL.
4. What value will be returned by iStochastic? I assume it is the MODE value...
Please, can someone help me?
May the Pip be with you.