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
Dear Sirs,
For example I use the iMA command to find Ema at Time 1:00,2.00:3:00 and 4:00 to be 1.234,1.334,1.445,1.446 respectively.
So at Time 3:00 I use iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,1) to find the Ema at Time 2:00. Does it mean the value I find using iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,1) shall be exactly =1.334?
I am not sure my logic is correct?
Does iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,1) means EMA for the recent 5 bars up to previous bar?
Does iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,0) means EMA for the recent 5 bars up to present bar?
An EMA (Exponential Moving Average), does not have a "real period" per se, but rather a conversion of the "period" into a weight which is exponentially applied along ALL bars up to and including the "bar shift" referenced in the iMA() function. However, for better understanding, please read the referenced documentation:
Dear Skrs,
Final Clarification.
Ema for H1 at Time 1:00,2.00:3:00 and 4:00 are 1.234,1.334,1.445,1.446 respectively which is value used in the drawing of ema H1 indicator line in the chart window.
My question:
iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,1) at time 4:00, 3:00 and 2:00 will it give the value of 1.445,1.334 and 1.234 respectively?
Hope you can enlightened me.
Thank you.
I don't think that it can be clarified any more than it has been explained to you already.
Why don't you simply print the ema values and compare them to the chart?
I don't think that it can be clarified any more than it has been explained to you already.
Why don't you simply print the ema values and compare them to the chart?
Yes, I have printed the value and it is same as the chart. So I mean the value of these ema values are unchanged. So my reasoning is if I use iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,1) to find the ema value of one hour earlier it shall be tally with all these ema value output.
Regards
Is that not what I wrote on my very first post? (and I quote):
Dear Brothers,
These previous bars is for my indicator coding. You see if I use iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,1) to get the value of the ema value of the previous bar, the value simply does not tally witht the output using iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,0).
Simple illustration
Time iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,0) iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,1)
1:00 X1 Y1
2:00 X2 Y2
3:00 X3 Y3
4:00 X4 Y4
Logically it should be Y4=X3, Y3=X2 , Y2=X1 but it is not, I cannot understand why it is as such?
I don't know if it is possible to explain it more simply than it already has been explained.
At 1:00 the bar has only just opened so an ma(PRICE_CLOSE) referencing shift 0 will return the value at 1:00 XX seconds.
At 2:00 an ma(PRICE_CLOSE) referencing shift 1 will return the value at 1:59 XX seconds. ie the final value for when the 1:00 bar closed.
Let me make this more clear for you:
Yes, that is correct - It will NEVER "tally" - It will ALWAYS be DIFFERENT.
Do the following experiment - compare the "iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,2)" with the "iMA(NULL,PERIOD_H1,5,0,MODE_EMA,PRICE_CLOSE,1)" in the same way you did for bar shifts "1" and "0", but now for "2" and "1".
Now, you will see that they will always "tally", because for bar shifts "0", things work differently as already explained.