- Katılım
- 23 Eki 2020
- Mesajlar
- 1,823
Centred MA Envelopes (Triangular)
{Periods}
P1:=Input("Highlight/Show Wavelength =",3,10000,31);
X:=Input("NB, contains all cycles with WLth less than this",0,0,0);
P1:=P1/2;
P1:=round(P1*1.5);
P1:=LastValue(If(Frac(P1/2)=0,P1+1,P1));
{Other Inputs}
Y:=Input("Envelope Width Basis [1]#ATRs [2]% [3]price",1,3,2);
Z:=Input("Envelope Width",0,1000,0.005);
{moving average}
MA:=Mov(C,P1,TRI);
{envelope width}
X:=If(Y=1,Z*Mov(ATR(1),P1,S),If(Y=2,MA*Z/100,Z));
{envelopes}
EU:=MA+X;
EL:=MA-X;
{Centre Everything}
PC:=LastValue((P1-1)/2);
CMA:=Ref(MA,PC);
CEU:=Ref(EU,PC);
CEL:=Ref(EL,PC);
CMA;CEU;CEL;
kaynak
purebytes
{Periods}
P1:=Input("Highlight/Show Wavelength =",3,10000,31);
X:=Input("NB, contains all cycles with WLth less than this",0,0,0);
P1:=P1/2;
P1:=round(P1*1.5);
P1:=LastValue(If(Frac(P1/2)=0,P1+1,P1));
{Other Inputs}
Y:=Input("Envelope Width Basis [1]#ATRs [2]% [3]price",1,3,2);
Z:=Input("Envelope Width",0,1000,0.005);
{moving average}
MA:=Mov(C,P1,TRI);
{envelope width}
X:=If(Y=1,Z*Mov(ATR(1),P1,S),If(Y=2,MA*Z/100,Z));
{envelopes}
EU:=MA+X;
EL:=MA-X;
{Centre Everything}
PC:=LastValue((P1-1)/2);
CMA:=Ref(MA,PC);
CEU:=Ref(EU,PC);
CEL:=Ref(EL,PC);
CMA;CEU;CEL;
kaynak
purebytes