Ik kan onderstaande code uit de Technische en Kwantitatieve Analyse van september niet werkend krijgen in Vestics. Wie kan er een vesticode versie van maken?
{*******************************************************************
Description ?: This Indictor plots the TrendOscillator
Provided By : BTAC (c) Copyright 2003
********************************************************************}
Input: lengthMA1(5),lengthMA2(35),
? ? ? ? ?LengthSTS(7), OverSold(20), OverBought(80);
Variables: ?Trendoscillator(0), HighValue(0), LowValue(0), CloseValue(0);
TrendOscillator = Average(Close, lengthMA1)-Average(Close, lengthMA2)[1];
Highvalue= Highest(TrendOscillator,lengthMA2);
Lowvalue = Lowest(TrendOscillator, lengthMA2);
Closevalue = TrendOscillator;
Plot1(SlowKCustom(HighValue, LowValue, CloseValue, LengthSTS), "SlowK-TO");
Plot2(SlowDCustom(HighValue, LowValue, CloseValue, LengthSTS), "SlowD-TO");
Plot3(OverBought, "OB");
Plot4(OverSold, "OS");
{*******************************************************************
Description ?: This System describes the TrendOscillator System
Provided By : BTAC (c) Copyright 2003
********************************************************************}
Input: lengthMA1(5),lengthMA2(35), LengthSTS(7),
? ? ? ? ?OverSold(20), OverBought(80);
Variables: Trendoscillator(0), HighValue(0), LowValue(0),
? ? ? ? ? ? ? ? CloseValue(0), TO(0),TL(0), OB(0), OS(0);
TrendOscillator = Average(Close, lengthMA1)-Average(Close, lengthMA2)[1];
Highvalue= Highest(TrendOscillator,lengthMA2);
Lowvalue = Lowest(TrendOscillator, lengthMA2);
Closevalue = TrendOscillator;
TO = SlowKCustom(HighValue, LowValue, CloseValue, LengthSTS);
TL = SlowDCustom(HighValue, LowValue, CloseValue, LengthSTS);
OB = Overbought;
OS = Oversold;
if TO crosses over 50 then buy("Long1")this bar at close;
if TO<OB and TO>50 and TO crosses over TL then buy ("Long2") this bar at close;
if marketposition = 1 and TL>OB and TO crosses under TL then exitlong ("ExitLong1") this bar at close;
if marketposition = 1 and ?TO crosses under 50 then exitlong ("ExitLong2") this bar at close;
if TO crosses under 50 then sell("Short1")this bar at close;
if TO>OS and TO<50 and TO crosses under TL then sell ("Short2") this bar at close;
if marketposition = -1 and TL<OS and TO crosses over TL then exitshort ("ExitShort1") this bar at close;
if marketposition = -1 and ?TO crosses over 50 then exitshort ("ExitShort2") this bar at close;