| |
|
|
Indicator : Variable Volatility Stops
INPUT: LENGTH (21), CONST(3.05);
vaR: SWITCH(1), TR(0), ARC(0),
SAR(0),HISIC(0),LOSIC(0);
TR= VOLATILITY (LENGTH); ARC= TR* CONST;
IF CURRENTbar = length then begin hisic=c; losic=c; if h>=
xaverage (h,length-1) [1] then begin hisic= highest(c,length);
Sar=hisic-arc; switch= 1; end; if l <= xaverage
(l,length-1) [1] then begin losic= lowest (c,length); sar =
losic +arc; switch=0; end; end;
if switch =1 then begin if c>hisic then
hisic=c; sar=hisic - arc; if c< sar then begin switch=0;
losic=c; sar = losic + arc; end;
end; if switch=0 then begin if c< losic
then losic=c; sar= losic +arc; if c> sar then begin
switch=1; hisic=c; saR=HISIC- ARC; END; END;
IF C > SAR { AND C[1] < SAR } THEN
Plot1(SAR,"Sell");
IF C < SAR { AND C[1] > SAR} THEN
Plot2(sar,"Buy");
|
|
 |
 |
|
Function: VHF_ESD
Inputs: Length(NumericSimple);
Vars: Counter(0), CloseDiff(0),
SumDiff(0);
CloseDiff = 0; SumDiff = 0;
For Counter = 0 to Length - 1 Begin
CloseDiff = AbsValue(Close[Counter] - Close[Counter + 1]);
SumDiff = SumDiff + CloseDiff; End;
If SumDiff = 0 Then SumDiff = 1;
VHF_ESD = (Highest(Close, Length) -
Lowest(Close, Length)) / SumDiff;
|
Indicator: VHF
Indicator
Inputs: Length(28);
Plot1(VHF_ESD(Length), "VHF");
|
|
 |
 |
|
Function : VIDYA
Input: Price(numericseries), CMOLen(numeric), VIDYALen(numeric),
Speed(numeric);
Var: Cnt(0),SumUp(0), SumDn(0),
Diff(0),VIDYAPri(0),AbsCMO(0),Const(0);
SumUp = 0; SumDn = 0;
For Cnt = 0 to CMOLen-1 Begin Diff =
Price[Cnt] - Price[Cnt+1]; If Diff > 0 then SumUp = SumUp + Diff
else SumDn=SumDn-Diff; End;
AbsCMO =
Speed*AbsValue((SumUp-SumDn)/(SumUp+SumDn)); Const =
2/(VIDYALen+1);
VIDYA =
iff(Barnumber>VIDYALen,(Price*Const*AbsCMO) +
((1-AbsCMO*Const)*VIDYA[1]),Price);
|
Indicator :
VIDYA
Input: Price(TypicalPrice), CMOLen(9),
VIDYALen(12), UBandPct(1), LBandPct(1),Speed(1);
Var: PlotVal(0);
PlotVal = VIDYA(Price,CMOLen,VIDYALen, Speed);
If PlotVal > 0 then begin
Plot1(PlotVal,"VIDYA"); Plot2((1 + UBandPct*.01)*PlotVal,"Upper
Band"); Plot3((1 - LBandPct*.01)*PlotVal,"Lower Band"); End;
|
|
 |
 |
|
Indicator : VIDYA/CDMA
{Tushar Chande 2001: VIDYA/CDMA}
Input: Len(10);
Vars: Diff(0), MyConst(0), MyAdx(0), Varma(0),
EmaIndex(0);
{. Index of EMA .}
If Len > 0 then EmaIndex = (2 / (1 +
Len)) else EmaIndex = 0.20;
{. Stochastic oscillator using ADX .}
MyAdx = ADX(20);
Diff = Highest(MyAdx, 20) - Lowest(MyAdx, 20); If Diff > 0
then MyConst = (MyAdx - Lowest(MyAdx, 20))/Diff else MyConst =
EmaIndex;
{. Clamp length to that implied by input value
of Len .}
If MyConst > EmaIndex then MyConst = EmaIndex;
{.
Create the variable MA .}
If CurrentBar < 50 then Varma = Close else Varma = (1 -
MyConst) * Varma[1] + MyConst * Close; Plot1(Varma, "VarMA")
; Plot2(XAverage(Close, Len), "XAvg")
|
|
 |
 |
|
Function : VIDYA2
Input: Price(numericseries), CMOLen(numeric),
VIDYALen(numeric), Speed(Numeric);
Var: NumUp(0), NumDn(0), Cnt(0),
SumUp(0), SumDn(0), Diff(0), VIDYAPri(0), AbsCMO(0),
Const(0);
SumUp = 0; SumDn = 0; NumUp=0;
NumDn=0;
For Cnt = 0 to CMOLen-1 Begin Diff =
Price[Cnt] - Price[Cnt+1]; If Diff > 0 then SumUp = SumUp + Diff
else SumDn=SumDn-Diff; If Diff > 0 then NumUp=NumUp+1 else
NumDn=NumDn+1; End;
AbsCMO =
Speed*AbsValue(((NumUp-NumDn)*(SumUp-SumDn))/((SumUp+SumDn)*(NumUp+NumDn)));
Const = 2/(VIDYALen+1);
VIDYA2 = iff(Barnumber > VIDYALen,(Price *
Const * AbsCMO) + ((1 - AbsCMO * Const) * VIDYA2[1]),Price);
|
Indicator
: VIDYA2
Input: Price(TypicalPrice), CMOLen(9),
VIDYALen(12), UBandPct(1), LBandPct(1), Speed(2);
Var: PlotVal(0);
PlotVal = VIDYA2(Price,CMOLen,VIDYALen,Speed);
If PlotVal > 0 then begin
Plot1(PlotVal,"VIDYA"); Plot2((1 + UBandPct*.01)*PlotVal,"Upper
Band"); Plot3((1 - LBandPct*.01)*PlotVal,"Lower Band"); End;
|
|
 |
 |
|
Function :
VIMALength
inputs: MaxLength1(numericsimple), {"interval" will vary from
2 days to (MaxLength1 + 1) days; equivalently, Length1 below will
vary from 1 day to MaxLength1 days}
Length2(numericsimple), {number of
historical RESULTS to consider for each max/min calculation;
actual number of historical data points used may be more than this}
ShortestVIMALength(numericsimple),
LongestVIMALength(numericsimple);
variables: VIMAOsc( 0 ), Length1( 0 ),
MaxDiff( 0 ), MinDiff( 0 ), NormDiff( 0 ), VIMAOscMax( 0 ),
VIMAOscMin( 0 ), VIMAOscNorm( 0 ),
VIMALengthRange(LongestVIMALength - ShortestVIMALength);
VIMAOsc = 0; for Length1 = 1 to MaxLength1
begin MaxDiff = Highest(Close - Close[Length1], Length2);
MinDiff = Lowest(Close - Close[Length1], Length2); NormDiff =
(Close - Close[Length1] - MinDiff) / (MaxDiff - MinDiff); VIMAOsc
= VIMAOsc + NormDiff; end;
VIMAOscMax = Highest(VIMAOsc, Length2);
VIMAOscMin = Lowest(VIMAOsc, Length2); VIMAOscNorm = (VIMAOsc -
VIMAOscMin) / (VIMAOscMax - VIMAOscMin); VIMALength =
ShortestVIMALength + Round(VIMAOscNorm * VIMALengthRange, 0);
|
Indicator : VIMA
inputs: MaxLength1( 3 ), Length2( 20 ),
ShortestVIMALength( 3 ), LongestVIMALength( 6 );
variables: CurrentVIMALength( 0 );
CurrentVIMALength = VIMALength( MaxLength1,
Length2, ShortestVIMALength, LongestVIMALength);
Plot1(Average(Close, CurrentVIMALength));
|
|
 |
 |
|
Indicator : Volatility Quality Index
Variables: VQI(0), SumVQI(0);
If TrueRange <> 0 and (High - Low) <> 0 Then
VQI = ((Close - Close[1]) / TrueRange + (Close - Open) / (High -
Low)) * 0.5 Else VQI=VQI[1]; VQI = AbsValue(VQI) * ((Close
- Close[1] + (Close - Open)) * 0.5); SumVQI = SumVQI + VQI;
Plot1(SumVQI,""); Plot2(Average(SumVQI,9),"");
Plot3(Average(SumVQI,200),"");
|
| |
|