don't specify PERIOD_H1
if(iMA(_Symbol,_Period,7,0,MODE_EMA,PRICE_CLOSE,i+1)>iMA(_Symbol,_Period,21,0,MODE_EMA,PRICE_CLOSE,i+1) && iMA(_Symbol,_Period,7,0,MODE_EMA,PRICE_CLOSE,i+2)<iMA(_Symbol,_Period,21,0,MODE_EMA,PRICE_CLOSE,i+2)) BinSig =iMA(_Symbol,_Period,21,0,MODE_EMA,PRICE_CLOSE,i+1);
don't specify PERIOD_H1
Hi Paul,
Thank you for your response. :)
What I find is that If I don't specify a period it will give me the level of a 5 min MA cross on a 5 min chart, but I was wondering if there is a way to show the 1 hour cross level as a line for the 12 (12 individual 5 min bars per 1 hour bar) 5 min in that particular hour.
Thank you for all your help with this... I am a super beginner, but picking it up slowly. :)
Have a great day. :)
Cheers.
Hi Whroeder1,
Should I just use a "1" instead of "I+1"?
Thanks again, and sorry it's taking me a while to grasp... :)
As I mentioned to Paul..."I was wondering if there is a way to show the 1 hour cross level as a line for the 12 (12 individual 5 min bars per 1 hour bar) 5 min in that particular hour."
Unfortunately I can't even think of a way that my simple coding skills could get that to work. :)
Thanks again and I'll try a couple of things.
In my head it works. :):)
You'll see in the pictures below what happens.
The 1st Chart looks fine with the 1 Hour level perfectly drawn.
The 2nd Chart however, keeps exactly the same lines for the cross level on the 1 Hour, but just overlays it on the 5 minute.
I know it's probably something really simple... That's why I ask you guys with the brains. :):):)
Thanks again.
Cheers.
if you are asking EMA timeframe independant of the current timeframe,
e.g. 5mn EMA plotted on current chart ..
then parametrize EMA as :
ENUM_TIMEFRAMES ema_TF=PERIOD_M5; for (int i=limit; i >= 0; i--) { // Binary Signal: static double BinSig; if(iMA(NULL,ema_TF,7,0,MODE_EMA,PRICE_CLOSE,i+1)>iMA(NULL,ema_TF,21,0,MODE_EMA,PRICE_CLOSE,i+1) && iMA(NULL,ema_TF,7,0,MODE_EMA,PRICE_CLOSE,i+2)<iMA(NULL,ema_TF,21,0,MODE_EMA,PRICE_CLOSE,i+2)) BinSig =iMA(NULL,ema_TF,21,0,MODE_EMA,PRICE_CLOSE,i+1); ExtMapBuffer1[i] = BinSig; }
if you are asking EMA timeframe independant of the current timeframe,
e.g. 5mn EMA plotted on current chart ..
then parametrize EMA as :
Hi Paul,
Thank you very much. :):)
That makes total sense now.
I am a mere Jedi apprentice compared to all you Yoda's. :):)
Thanks again.
Cheers.
if you are asking EMA timeframe independant of the current timeframe,
e.g. 5mn EMA plotted on current chart ..
then parametrize EMA as :
Hi Paul,
Sorry about this... It still gives me the same problem.
It still shows the same sort of look as the 2 pictures in the reply to Whroeder.
It just doesn't seems to scale itself for a lower time frame.
I'll try a couple of things tonight, but I really appreciate the help though. :)
Chat soon.
Cheers,
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
I'm wondering if someone could help me with this?
I'm am a VERY BASIC CODER. :):)
I have written some code that will give the 21 H1 EMA Level when the 7 H1 EMA crosses it.
It looks fine on the Hourly chart, but when I go down to a 5 min chart it shows the same indicator scale from the H1.
It would be greatly appreciated if someone could help me out as I am very lost on how to get it working.
Thank you. :)
Below is the code... Very simple...but so am I. :):)