Svapo Oscillator Code |
Post Reply |
Author | |
wacazac
Newbie Joined: 14 Mar 2010 Posts: 4 |
Post Options
Quote Reply
Topic: Svapo Oscillator Code Posted: 13 Mar 2011 at 10:20pm |
Metastock Formular
{calculate the heikin-ahhi closing average haCl and get the input variables} haOpen:=(Ref((O+H+L+C)/4,-1) + PREV)/2; haCl:=((O+H+L+C)/4+haOpen+Max(H,haOpen)+Min(L,haOpen))/4; period:= Input("SVAPO period :", 2, 20, 8); cutoff:= Input("Minimum %o price change :",0,10,1); {Inputs for standard deviation bands} devH:= Input("Standard Deviation High :", 0.1, 5, 1.5); devL:= Input("Standard Deviation Low :", 0.1, 5, 1.3); stdevper:= Input("Standard Deviation Period :", 1, 200, 100); {Smooth HaCl closing price} haC:=Tema(haCl,period/1.6); {Medium term MA of Volume to limit extremes and division factor} vave:=Ref(Mov(V,period*5,S),-1); vmax:=vave*2; vc:=If(V<vmax,V,vmax); {Basic volume trend} vtr:=Tema(LinRegSlope(V,period),period); {SVAPO result of price and volume} SVAPO:=Tema(Sum(If(haC>(Ref(haC,-1)*(1+cutoff/1000)) AND Alert(vtr>=Ref(vtr,-1),2), vc, If(haC<(Ref(haC,-1)*(1-cutoff/1000)) AND Alert(vtr>Ref(vtr,-1),2),-vc,0)),period)/(vave+1),period); devH*Stdev(SVAPO,stdevper); -devL*Stdev(SVAPO,stdevper); zeroref:=0; zeroref; SVAPO ######################{the code appears to be correct to here but the I get error messge "operater expected,not there" can some kind sole correct this code please? declare upper; input SVAPOLength = 8; input MinPctODelta = 1; input STDevHi = 1.5; input STDevLo = 1.3; input STDPeriod = 100; ############################ #Heiken Ashi Data set ############################# def Vclose = (Open + High + Low + Close) / 4; rec Vopen = compoundValue(1, ((open[1] + high[1] + low[1] + close[1]) / 4 + vopen[1]) / 2, hl2); def HaC = TEMA(Vclose, SVAPOLength /1.6); REC vave =(SIMPLeMovingAvg(Volume,SVAPOLength*5)[1]); def vMax=vave*2; def VC= if (Volume<vMax,Volume,vMax); def VTR=TEMA(LINearRegressionSlope(volume,SVAPOLength),SVAPOLength); plot SVAPO=TEMA(sum (if (HaC>(HaC[1]*(1+MinPctODelta/1000)) and VTR>=VTR[1],VC, If(haC<(haC[1]*(1-MinPctODelta/1000)) AND vtr>vtr[1],-VC,0)),SVAPOLength)/(vave+1),SVAPOLength); |
|
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options Quote Reply Posted: 14 Mar 2011 at 5:25pm |
BullCharts formulaaah {heikin ashi closing average haCl and input variables} [color=red]devH*Stdev(SVAPO,stdevper);
Edited by maximo - 14 Mar 2011 at 5:28pm |
|
Post Reply |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |