[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] help in building an indicator



PureBytes Links

Trading Reference Links

hi,
i am trying to build and indicator for comparing the price movement of the
security with the index. This should give the market out performers. as i am
not very good at this. Help from all the seniors in the line is of great
value.

the indicator would do as under
calculate the daily ROC of index and the security
calculate the moving average of this roc(both the index and security)
the diff of the two would be the chart

i have writen the following code but cannot understand how to
1) use the input that selects the kind of moving avg to be used.(line 6)
2) how to select the price of index that has been selected with the variable
sec(line5)

please also check the rest of the code and suggest improvements

====================================================================
Sec:= Security("C:\MetaStock Data\EOD-NSE\S&P CNX Nifty",C);
P1:=Input("Enter Moving Avg Period of Index",1,250,6);
MOVtypeCode1:=Input("EMA(1),TEMA(2),Vol(3),ZeroLag(4),Hull(5),AdapMV(6)",1,5,1);
MOVtype1:=0; {this varriable is to select the moving avg type in formulae
language}
ROC1:=ROC(c{close of sec},1,%);
ROCma1:=Mov(ROC1,P1,e{kind of mov to be used});

P2:=Input("Enter Moving Avg Period of security",1,250,6);
MOVtypeCode2:=Input("EMA(1),TEMA(2),Vol(3),ZeroLag(4),Hull(5),AdapMV(6)",1,5,1);
MOVtype2:=0; {this varriable is to select the moving avg type in formulae
language}
ROC2:=ROC(C,1,%);
ROCma2:=Mov(ROC2,P2,e{1/2/3/4/5/6});

diff:=(ROCma1-ROCma2)/

{Plot}
diff;
========================================================================


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/