How to Plot EOD MA on Intraday Data

#1
dear friends

Dont know how to plot EOD MA on intraday data...pls help....

For ex : I want to plot Simple MA 21 days on Intraday data...

HOW TO...? :eek:

have a nice day
JB
 
#2
dear

Thanks for the reply...but pls see...... :)
the post is under Metastock and NOT under Amibroker....

I need the same for Metastock....

have a nice day
JB
 

THETRADER

Active Member
#3
AB seems great, and, I am pleasantly surprised to see the simplicity of working with different timeframes. I guess such extravaganzas are not available in MS. I will be glad to be proved wrong.

I will give you the code here.
{21 day SMA}
a1:=Valuewhen(1, day() <> ref(day(), -1), Ref(C, -1);
a2:=Valuewhen(2, day() <> ref(day(), -1), Ref(C, -1);
...
...
a21:=Valuewhen(2, day() <> ref(day(), -1), Ref(C, -1);
SMA21:=(a1+a2+...+a21)/21;
{formula ends}
All the ...s will have to be entered. I'm not sure if MS accepts so many variables within an indicator. If you get an error, instead of assigning them to a1,a2,... etc., just add them directly in the last line & divide by 21.

BTW, if any better method is available, I appreciate the sharing of the same in this forum.
 
#4
dear

thanks for the reply......
Will this work.....
I am getting 5 min data for metastock and assuming 60 candles per day, plotting
mov(60,close,S) will give us 1 day ma and mov(21,mov(60, close, s),S) will generate
21 day simple ma.....

will it work.....BTW, I should first try it on Amibroker........and then post it here...but couldnt try as mailing from a cafe where amibroker is not with me

have a nice day
JB
 

THETRADER

Active Member
#5
johnbest, no unfortunately.
mov(60,close,S), (isnt it mov(close, 60, s) will give you the 60 period 5 min SMA.
mov(21,mov(60, close, s),S) will give you 21 period SMA of the above 60 period SMA.

The second one's 21 period is 21 5min periods from now, yes, NOW. Even a 82nd bar behind will have no bearing on the MA thus calculated.

The one I gave should work, except that it is little tedious entering, but if you are good at cut & paste, and, editing, then you can do that pretty fast.
 

Similar threads