Relative Vigor Index

Kant-en-klare, geteste indicatoren en handelssystemen
Plaats reactie
Administrator
Site Admin
Berichten: 34
Lid geworden op: vr sep 09, 2005 8:31 pm
Contacteer:

Relative Vigor Index

Bericht door Administrator »

De Relative Vigor Index is besproken door Frank Vlug in TKA Magazine van oktober 2003. Voor meer informatie zie http://www.belbelta.nl.

Code: Selecteer alles

{- Filename: Relative Vigor Index -}

function TriMA(Price: TSeries; Length: integer): TSeries;
var
  Length1, Length2: integer;
begin
  Length1 := Trunc((Length + 1) * 0.5);
  Length2 := Ceil((Length + 1) * 0.5);
  Result := MA(MA(Price, maSimple, Length1), maSimple, Length2);
end;

var
  Periode: integer;
  Change, MyRange, Num, Den, Value1, Value2, RVI, RVISig: TSeries;
begin
{ Indicator parameter definities }
  Periode := CreateParameterInteger('MA periode', 1, 999, 10, true);

{ Indicator eigenschappen }
  with Indicator do 
  begin
    ShortName := 'RVI';
    RequiredBars := Periode;
  end;

{ Indicatorberekening }
  Change := SubtractSeries(Close, Open);
  MyRange := SubtractSeries(High, Low);
  Value1 := TriMA(Change, 4);
  Value2 := TriMA(MyRange, 4);
  Num := MA(Value1, maSimple, Periode);
  Den := MA(Value2, maSimple, Periode);
  RVI := DivideSeries(Num, Den);
  RVISig := TriMA(RVI, 4);

  CreateLine(RVI).Color := clLime;
  CreateLine(RVISig).Color := clRed;
end.
Eric
Berichten: 3573
Lid geworden op: za sep 10, 2005 2:41 am
Locatie: Den Haag

Re: Relative Vigor Index

Bericht door Eric »

En met signalen.

Code: Selecteer alles

{- Filename: Relative Vigor Index -}

function TriMA(Price: TSeries; Length: integer): TSeries;
var
  Length1, Length2: integer;
begin
  Length1 := Trunc((Length + 1) * 0.5);
  Length2 := Ceil((Length + 1) * 0.5);
  Result := MA(MA(Price, maSimple, Length1), maSimple, Length2);
end;

var
  Periode: integer;
  Change, MyRange, Num, Den, Value1, Value2, RVI, RVISig: TSeries;
begin
{ Indicator parameter definities }
  Periode := CreateParameterInteger('MA periode', 1, 999, 10, true);

{ Indicator eigenschappen }
  with Indicator do 
  begin
    ShortName := 'RVI';
    RequiredBars := Periode;
  end;

{ Indicatorberekening }
  Change := SubtractSeries(Close, Open);
  MyRange := SubtractSeries(High, Low);
  Value1 := TriMA(Change, 4);
  Value2 := TriMA(MyRange, 4);
  Num := MA(Value1, maSimple, Periode);
  Den := MA(Value2, maSimple, Periode);
  RVI := DivideSeries(Num, Den);
  RVISig := TriMA(RVI, 4);
  
  Signals := CrossingsToEntrySignals(Crossings(RVI, RVISig));

  CreateLine(RVI).Color := clLime;
  CreateLine(RVISig).Color := clRed;
end.
---
Eric
Plaats reactie