Toppen en bodems indicator/systeem

Vragen en suggesties over Vesticode

Moderator: Perry

Toppen en bodems indicator/systeem

Berichtdoor Dirk » di 14 sep 2004, 15:56

In het TKA van september staat een aardige strategie met toppen en bodems met leuke resultaten op de AEX. Op de site http://www.belbeltka.nl/ staat de bijbehorende EL code:

Inputs:EL(close), ES(close), MBB(500);
Vars:occur(1), support(PivotLowVS(occur,low,3,2,3)),
resistance(PivotHighVS(occur,high,3,2,3)), daysback(0);

{SUPPORT & RESISTANCE}
If currentbar-5 > MBB then begin
For daysback = MBB downto 0 begin
If PivotLowVS(occur,low,3,2,3)[daysback] < close today then
begin
support = PivotLowVS(occur,low,3,2,3)[daysback];
? ?end;
end;
end;

If close < support then support=0;

If currentbar-5 > MBB then begin
For daysback = MBB downto 0 begin
If PivotHighVS(occur,high,3,2,3)[daysback] > close today then
begin
resistance = PivotHighVS(occur,high,3,2,3)[daysback];
? ?end;
end;
end;

If close > resistance then resistance=999999;

{ENTRY & EXIT SIGNALS}
If currentbar-5 > MBB then begin
If close > resistance[1] then buy at close; If EL < support[1] then sell at close;

If close < support[1] then sell at close; If marketposition = -1 and close > High[1] then buy at close;

end;

Echter Vesticode kent de PivotHighVS en PivotLowVS niet. Heeft iemand deze codes in EL ter beschikking.

Alvast dank.
Een vriendelijke groet,

Dick
Dirk
 
Berichten: 28
Geregistreerd op: wo 07 aug 2002, 16:30
Woonplaats: Rosmalen

Toppen en bodems indicator/systeem

Berichtdoor GMe » di 14 sep 2004, 17:43

Inputs:EL(close), ES(close), MBB(500);
Vars:occur(1), support(PivotLowVS(occur,low,3,2,3)),
resistance(PivotHighVS(occur,high,3,2,3)), daysback(0);

{SUPPORT & RESISTANCE}
If currentbar-5 > MBB then begin
For daysback = MBB downto 0 begin
If PivotLowVS(occur,low,3,2,3)[daysback] < close today then
begin
support = PivotLowVS(occur,low,3,2,3)[daysback];
? end;
end;
end;

If close < support then support=0;

If currentbar-5 > MBB then begin
For daysback = MBB downto 0 begin
If PivotHighVS(occur,high,3,2,3)[daysback] > close today then
begin
resistance = PivotHighVS(occur,high,3,2,3)[daysback];
? end;
end;
end;

If close > resistance then resistance=999999;

{ENTRY & EXIT SIGNALS}
If currentbar-5 > MBB then begin
If close > resistance[1] then buy at close; If EL < support[1] then sell at close;

If close < support[1] then sell at close; If marketposition = -1 and close > High[1] then buy at close;

end;
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Toppen en bodems indicator/systeem

Berichtdoor GMe » di 14 sep 2004, 17:44

{*******************************************************************
Description: This Function returns PivotLow with variable strengths
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Occur(Numeric), Price(NumericSeries), LStren(NumericSimple), RStren(NumericSimple), Length(Numeric);
Variables: SLBar(0), MainLoop(0), count(0), PivotFlag(False);
Array: Pivot[50](0);

PivotFlag = False;
If Pivot[0] <> 0 Then Begin
For Count = 1 To 50 Begin
Pivot[Count] = 0;
End;
End;

For MainLoop = Length-1 DownTo Rstren Begin
Condition1 = True;
Condition2 = True;
SLBar = Price[MainLoop];

For value1 = MainLoop - RStren To MainLoop -1 Begin
If SLBar >= Price[value1] Then
Condition1 = False;
End;

If Condition1 Then Begin
For value1 = MainLoop + 1 To MainLoop + LStren Begin
If SLBar > Price[value1] Then
Condition2 = False;
End;
End Else
Condition2 = False;

If Condition1 AND Condition2 Then Begin
For count = 50 DownTo 2 Begin
Pivot[count] = Pivot[count-1];
End;
Pivot[1] = Price[MainLoop];
PivotFlag = True;
End;
End;

If PivotFlag AND Pivot[Occur] <> 0 Then
PivotLowVS = Pivot[Occur]
Else
PivotLowVS = -1;
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Toppen en bodems indicator/systeem

Berichtdoor GMe » di 14 sep 2004, 17:45

{*******************************************************************
Description: This Function returns Pivot High with variable strengths
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Occur(Numeric), Price(NumericSeries), LStren(NumericSimple), RStren(NumericSimple), Length(Numeric);
Variables: SHBar(0), MainLoop(0), count(0), PivotFlag(False);
Array: Pivot[50](0);

PivotFlag = False;
If Pivot[0] <> 0 Then Begin
For Count = 1 To 50 Begin
Pivot[Count] = 0;
End;
End;

For MainLoop = Length - 1 DownTo Rstren Begin
Condition1 = True;
Condition2 = True;
SHBar = Price[MainLoop];

For value1 = MainLoop - RStren To MainLoop -1 Begin
IF SHBar <= Price[value1] Then
Condition1 = False;
End;

IF Condition1 Then Begin
For value1 = MainLoop + 1 To MainLoop + LStren Begin
IF SHBar < Price[value1] Then
Condition2 = False;
End;
End Else
Condition2 = False;

IF Condition1 AND Condition2 Then Begin
For count = 50 DownTo 2 Begin
Pivot[count] = Pivot[count-1];
End;
Pivot[1] = Price[MainLoop];
PivotFlag = True;
End;
End;

IF PivotFlag AND Pivot[Occur] <> 0 Then
PivotHighVS = Pivot[Occur]
Else
PivotHighVS = -1;
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Toppen en bodems indicator/systeem

Berichtdoor Jo » wo 15 sep 2004, 8:00

Hoi,

Ziehier de werkende code binnen Vestics na enige aanpassingen aan het system,
Met dank aan Dhr. GMe

Jo

Inputs : occur(1), xPriceLow(Low), xPriceHigh(High),LStren(3),RStren(2), Length(3), MBB(50),EL(close);
Vars : support(0),resistance(0), daysback(0);

support= PivotLowVS (occur,xPricelow,LStren,RStren, Length);
resistance =PivotHighVS(occur,xPricehigh,LStren,RStren, Length);

{SUPPORT & RESISTANCE}
If currentbar-5 > MBB then begin
For daysback = MBB downto 0 begin
If PivotLowVS(occur,xPricelow,LStren,RStren, Length)[daysback] < close then
begin
support = PivotLowVS(occur,xPricelow,LStren,RStren, Length)[daysback];
? end;
end;
end;
If close < support then support=0;

If currentbar-5 > MBB then begin
For daysback = MBB downto 0 begin
If PivotHighVS(occur,xPricehigh,LStren,RStren, Length)[daysback] > close then
begin
PivotHighVS(occur,xPricehigh,LStren,RStren, Length)[daysback];
? end;
end;
end;
If close > resistance then resistance=999999;

{ENTRY & EXIT SIGNALS}
If currentbar-5 > MBB then begin
If close > resistance[1] then buy at close;
If EL < support[1] then sell at close;
If close < support[1] then sell at close;
If marketposition = -1 and close > High[1] then buy at close;
end;

(Edited by Jo at 4:09 pm op 15,sept. 2004)


(Edited by Jo at 4:11 pm op 15,sept. 2004)


(Edited by Jo at 8:11 pm op 17,sept. 2004)


(Edited by Jo at 8:32 pm op 17,sept. 2004)
Jo
 
Berichten: 44
Geregistreerd op: wo 07 jan 2004, 14:00

Toppen en bodems indicator/systeem

Berichtdoor Dirk » wo 15 sep 2004, 15:37

Heren,

Dank voor jullie bijdrages. Ik was zelf ook al wat aan het proberen met de code van het systeem echter ik heb het idee dat de uitkomsten niet overeenkomen met de uitkomsten uit het artikel (alleen op een plaatje te zien).
Daarnaast is mij de werking van de code voor de PivotLowsVS en PivotHighVS niet geheel duidelijk. Heer GME, heb je daar soms ook wat tekst over?

Wederom mijn dank.
Een vriendelijke groet,

Dick
Dirk
 
Berichten: 28
Geregistreerd op: wo 07 aug 2002, 16:30
Woonplaats: Rosmalen

Toppen en bodems indicator/systeem

Berichtdoor GMe » wo 15 sep 2004, 15:45

Calculates the specified value of the High Pivot bar with variable strength sides.

Function

PivotHighVS (OCCUR,PRICE,LSTREN,RSTREN,LENGTH)

Parameters

OCCURa numeric expression representing which occurrence (i.e., 1 = most recent, 2 = 2nd most recent, and so on)
PRICEspecifies the price information to be considered
LSTRENthe required number of bars on the left side of the high pivot bar
RSTRENthe required number of bars on the right side of the high pivot bar
LENGTHthe length of time (in bars) to be considered
Returns

A numeric value containing the specified value of the High Pivot bar, with variable strength sides, if found. A value of ?1 is returned if there is no high pivot, within the length specified.

Usage

This function is similar to the SwingHigh function, except that the bar strength can be set independently for each side of the pivot or swing.

Example

Assigns to Value1 the most recently occurring high pivot, in the last 21 bars, that has a left side strength of 4 and a right side strength of 2:

Value1 = PivotHighVS(1,High,4,2,21);

Assigns to Value2 the value of the second most recently occurring high pivot, in the last 10 bars, that has a left side strength of 3 and a right side strength of 2:

Value2 = PivotHighVS(2,High,3,2,10);

Additional Example

If you wanted to place a mark on the high of the high pivot bar, with a left strength of 4 and a right strength of 2, you could use the following syntax:

If PivotHighVS(1, High, 4, 2, 3) <> -1 Then
Plot1[2](High[2], "PivotH");

{** ? 1987, 1999 Omega Research, Inc. **}
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Toppen en bodems indicator/systeem

Berichtdoor GMe » wo 15 sep 2004, 15:46

Calculates the specified value of the Low Pivot bar, with variable strength sides, if found.

Function

PivotLowVS (OCCUR,PRICE,LSTREN,RSTREN,LENGTH)

Parameters

OCCURa numeric expression representing which occurrence (i.e., 1 = most recent, 2 = 2nd most recent, and so on)
PRICEspecifies the price information to be considered
LSTRENthe required number of bars on the left side of the low pivot bar
RSTRENthe required number of bars on the right side of the low pivot bar
LENGTHthe length of time (in bars) to be considered
Returns

A numeric value containing the specified value of the Low Pivot bar, with variable strength sides, if found. A value of -1 is returned if there is no low pivot within the length specified.

Usage:

This function is similar to the SwingLow function, except that the bar strength can be set independently for each side of the pivot or swing.

Examples

Assigns to Value1 the most recently occurring low pivot, in the last 21 bars, that has a left side strength of 4 and a right side strength of 2:

Value1 = PivotLowVS(1,Low,4,2,21);

Assigns to Value2 the second most recently occurring low pivot, in the last 10 bars, that has a left side strength of 3 and a right side strength of 2:

Value2 = PivotLowVS(2,Low,3,2,10);

Additional Example

If you wanted to place a mark on the low of the low pivot bar, with a left strength of 4 and a right strength of 2, you could use the following syntax:

If PivotLowVS(1, Low, 4, 2, 3) <> -1 Then
Plot1[2](Low[2], "PivotL");

{** ? 1987, 1999 Omega Research, Inc. **}
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Toppen en bodems indicator/systeem

Berichtdoor GMe » wo 15 sep 2004, 15:47

Sinds ze het knippen en plakken uitgevonden hebben lijkt het net of ik overal verstand van heb :cool:
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Toppen en bodems indicator/systeem

Berichtdoor waljan » vr 17 sep 2004, 14:34

Beste Jo,

Indien ik het syteem via kopieren en plakken in Vestics plaats krijg ik de volgende foutmelding: regel5 pos10 bij PivotlowsVS verwacht hier een naam van een variabele.
Hoe heb jij dit opgelost.

Met vriendelijke groet,

Waljan
waljan
 
Berichten: 22
Geregistreerd op: za 14 jun 2003, 14:22

Toppen en bodems indicator/systeem

Berichtdoor Jo » vr 17 sep 2004, 19:34

Beste Waljan,

Ik vermoed dat er een - ? S --- teveel staat in het woord van de functie ? - ?PivotLowVS ----

Jo
Jo
 
Berichten: 44
Geregistreerd op: wo 07 jan 2004, 14:00

Toppen en bodems indicator/systeem

Berichtdoor waljan » di 21 sep 2004, 20:18

Beste Jo,

Ondanks dat ik PivotLowsVS heb gewijzigd in PivotLowVS werkt het systeem niet. Ik krijg bij PivotLowVS telekns de foutmelding verwacht hier een naam van een variabele.

Krijg jij ook deze melding, zoja hoe heb je dit opgelost.
Het lijkt me een aardig systeem en zou het dan ook graag willen uitproberen.

Met vriendelijke groet

Waljan
waljan
 
Berichten: 22
Geregistreerd op: za 14 jun 2003, 14:22

Toppen en bodems indicator/systeem

Berichtdoor Jo » wo 22 sep 2004, 10:11

Hoi Waljan,

Dit is het system die werkt binnen Vestics1. ? Maar wat de opbrengt is !

Inputs: occur(1), xPriceLow(Low), xPriceHigh(High),
? ? ? ? ? ? LStren(3),RStren(2), Length(3),MBB(50),
? ? ? ? ? ? EL(close), xPrice(Close);

Vars: support(0),resistance(0), daysback(0);

support= PivotLowVaria(occur,xPricelow,LStren,RStren, Length);

resistance =PivotHighVaria(occur,xPricehigh,LStren,RStren, Length);
{SUPPORT & RESISTANCE}
If currentbar-5 > MBB then begin
? For daysback = MBB downto 0 begin
? if PivotLowVaria(occur,xPricelow,LStren,RStren, Length)[daysback] < xPrice then begin

support = PivotLowVaria(occur,xPricelow,LStren,RStren, Length)[daysback];
?end;
end;
end;

If close < support then support=0;
If currentbar-5 > MBB then begin
For daysback = MBB downto 0 begin
If PivotHighVaria(occur,xPricehigh,LStren,RStren, Length)[daysback] > xPrice then
begin
PivotHighVaria(occur,xPricehigh,LStren,RStren, Length)[daysback];
end;
end;
end;

If close > resistance then resistance=999999;
{ENTRY & EXIT SIGNALS}
If currentbar-5 > MBB then begin
If close > resistance[1] then buy at Close;
If EL < support[1] then sell at close;
If close < support[1] then sell at Close;
If marketposition = -1 and close > High[1] then buy at close;
end; ? ? ? ?{-------- Systeem--------}

{----functie PivotLowVaria -----
Description: This Function returns PivotLow with variable strengths
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Occur(Numeric), Price(NumericSeries),
LStren(NumericSimple), RStren(NumericSimple), Length(Numeric);
Variables: SLBar(0), MainLoop(0), count(0), PivotFlag(False);
Array: Pivot[50](0);

PivotFlag = False;
If Pivot[0] <> 0 Then Begin
For Count = 1 To 50 Begin
Pivot[Count] = 0;
End;
End;

For MainLoop = Length-1 DownTo Rstren Begin
Condition1 = True;
Condition2 = True;
SLBar = Price[MainLoop];

For value1 = MainLoop - RStren To MainLoop -1 Begin
If SLBar >= Price[value1] Then
Condition1 = False;
End;

If Condition1 Then Begin
For value1 = MainLoop + 1 To MainLoop + LStren Begin
If SLBar > Price[value1] Then
Condition2 = False;
End;
End Else
Condition2 = False;

If Condition1 AND Condition2 Then Begin
For count = 50 DownTo 2 Begin
Pivot[count] = Pivot[count-1];
End;
Pivot[1] = Price[MainLoop];
PivotFlag = True;
End;
End;

If PivotFlag AND Pivot[Occur] <> 0 Then
PivotLowVaria = Pivot[Occur]
Else
PivotLowVaria = -1;{---- functie----}

{----- Functie ?PivotHighVaria ?-----
Description: This Function returns Pivot High with variable strengths
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Occur(Numeric), Price(NumericSeries), LStren(NumericSimple), RStren(NumericSimple), Length(Numeric);
Variables: SHBar(0), MainLoop(0), count(0), PivotFlag(False);
Array: Pivot[50](0);

PivotFlag = False;
If Pivot[0] <> 0 Then Begin
For Count = 1 To 50 Begin
Pivot[Count] = 0;
End;
End;

For MainLoop = Length - 1 DownTo Rstren Begin
Condition1 = True;
Condition2 = True;
SHBar = Price[MainLoop];

For value1 = MainLoop - RStren To MainLoop -1 Begin
IF SHBar <= Price[value1] Then
Condition1 = False;
End;

IF Condition1 Then Begin
For value1 = MainLoop + 1 To MainLoop + LStren Begin
IF SHBar < Price[value1] Then
Condition2 = False;
End;
End Else
Condition2 = False;

IF Condition1 AND Condition2 Then Begin
For count = 50 DownTo 2 Begin
Pivot[count] = Pivot[count-1];
End;
Pivot[1] = Price[MainLoop];
PivotFlag = True;
End;
End;

IF PivotFlag AND Pivot[Occur] <> 0 Then
PivotHighVaria = Pivot[Occur]
Else
PivotHighVaria = -1; {--- Functie ---}

Jo




(Edited by Jo at 11:13 am op 22,sept. 2004)
Jo
 
Berichten: 44
Geregistreerd op: wo 07 jan 2004, 14:00


Keer terug naar Vesticode

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers en 2 gasten

cron