Pagina 2 van 2

WMA Handelsystem

BerichtGeplaatst: ma 28 jul 2003, 15:20
door Marco
Een pijnlijke tabel, en daar moet je eigenlijk de DDRT (DrawDown-Return-Time) bijzetten, want dan ga je pas echt schrikken..

"This figure expresses how many months a system statistically needs to regain the average highest drawdown of the last twelve months. The lower the number the more stable was the performance of the system. ?"

Ik kom systemen tegen die daar dus statistisch gezien 30 maanden voor nodig hebben (maxDD = 30.000 euro!), tegenover systemen die dat in 2 maanden doen (maxDD=3.000 euro). En ik hoef niet te zeggen bij welk systeem ik toch een heel stuk rustiger aan het werk ben ;---)

Marco.


(Edited by Marco at 9:48 pm op 28,juli 2003)

WMA Handelsystem

BerichtGeplaatst: ma 28 jul 2003, 18:08
door Paul M
Inderdaad.

Paul.

Re: WMA Handelsystem

BerichtGeplaatst: vr 28 jul 2006, 18:46
door Hans123
Henk L schreef:Marco, Nogmaals het programma. Er ging iets fout. Henk value function WMACrossover (value xShortBars=9, value xLongBars=18,value xTrendBars=100,
value xProfit=3, value xStoploss=1) begin

?{--- calculate todays position of the WMA's ---}
?value xShortWMA[], xLongWMA[],xTrend;
?xShortWMA := vWMA(Close,xShortBars);
?xLongWMA := vWMA(Close,xLongBars);
?xTrend := XAverage(Close,xTrendBars);

?{--- check for any crossing ---}
?value xAbove, xBelow;
?xAbove := vCrossesAbove(xShortWMA,xLongWMA);
?xBelow := vCrossesBelow(xShortWMA,xLongWMA);

?{--- buy or sell depending on the crossings ---}
?if xAbove and Close>xTrend then vEnterLong;
?if xBelow and Close<xTrend then vEnterShort;
?end;
?
?{---- handle long side ----}

? ?Value xProfitLevel, xStopLevel;

?if MarketPosition=1 then begin
? ?xProfitLevel = EntryPrice(0)+xProfit;
? ?xStopLevel = EntryPrice(0)-xStopLoss;
? ?if Close>xProfitLevel or Close<xStopLevel then vExitlong;
? ?end;

?{---- handle short side ----}
?if MarketPosition=-1 then begin
? ?xProfitLevel = EntryPrice(0)-xProfit;
? ?xStopLevel = EntryPrice(0)+xStopLoss;
? ?if Close<xProfitLevel or Close>xStopLevel then vExitshort;
? ?end;
?

?{--- plot the WMA values and the current position ---}
?plot1(xShortWMA,'WMA'+NumToStr(xShortBars));
?plot2(xLongWMA,'WMA'+NumToStr(xLongBars));
?plot3(CurrentContracts,'Position');
?plot4(xTrend);
?
?
end;

Ik krijg een foutmelding bij Value xProfitLevel (regel 22). Heeft iemand de volledige correcte code?

Trouwens, hoe zijn de afgelopen jaren de resultaten van dit systeem geweest?

Hans

BerichtGeplaatst: vr 04 aug 2006, 8:07
door Pierre
Hallo Hans123,

De foutboodschap wordt veroorzaakt door de regel die er boven staat met
Code: Selecteer alles
end;


Elke end is namelijk een afsluiting van een eerdere begin. Net zoals een haakje sluiten bij een haakje openen hoort. In dit geval is er ten onrechte een end-instructie opgenomen, waardoor de eerdere begin op regel 3 wordt afgesloten. Alles wat daarna komt (te beginnen met value ...) valt nu buiten het programma en veroorzaakt de foutboodschap.

De juiste opbouw is dus

Code: Selecteer alles
{--- buy or sell depending on the crossings ---}
if xAbove and Close>xTrend then vEnterLong;
if xBelow and Close<xTrend then vEnterShort;
 
{---- handle long side ----}

   Value xProfitLevel, xStopLevel;

if MarketPosition=1 then begin
   xProfitLevel = EntryPrice(0)+xProfit;
   ...enz...


vr. groeten,
Pierre Dolmans
Vestics helpdesk

en nog het systeem met profit en loss gebaseerd o.b.v. %

BerichtGeplaatst: di 08 aug 2006, 10:18
door Joop Henzen
{-------------------------------------------------------
[INFO]
Author=
Created=2006-08-01
Modified=2006-08-07
Reference=
Usage=

[INPUTS]

[DESCRIPTION]

[END]
-------------------------------------------------------}

value function zWMACrossover (value xShortBars=9, value xLongBars=18,value xTrendBars=100,
value xProfit=3, value xStoploss=1) begin

{--- calculate todays position of the WMA's ---}
value xShortWMA[], xLongWMA[],xTrend;
xShortWMA := vWMA(Close,xShortBars);
xLongWMA := vWMA(Close,xLongBars);
xTrend := XAverage(Close,xTrendBars);

{--- check for any crossing ---}
value xAbove, xBelow;
xAbove := vCrossesAbove(xShortWMA,xLongWMA);
xBelow := vCrossesBelow(xShortWMA,xLongWMA);

{--- buy or sell depending on the crossings ---}
if xAbove and Close>xTrend then vEnterLong;
if xBelow and Close<xTrend then vEnterShort;

{---- handle long side ----}

Value xProfitLevel, xStopLevel;

if MarketPosition=1 then begin
xProfitLevel = EntryPrice(0)*((100+xProfit)/100);
xStopLevel = EntryPrice(0)*((100-xStopLoss)/100);
if Close>xProfitLevel or Close<xStopLevel then vExitlong;
end;

{---- handle short side ----}
if MarketPosition=-1 then begin
xProfitLevel = EntryPrice(0)*((100-xProfit)/100);
xStopLevel = EntryPrice(0)*((100+xStopLoss)/100);
if Close<xProfitLevel or Close>xStopLevel then vExitshort;
end;


{--- plot the WMA values and the current position ---}
plot1(xShortWMA,'WMA'+NumToStr(xShortBars));
plot2(xLongWMA,'WMA'+NumToStr(xLongBars));
plot3(CurrentContracts,'Position');
plot4(xTrend);


end;

WMA crossover aanpassing

BerichtGeplaatst: zo 20 aug 2006, 11:54
door Joop Henzen
Bijgaand nog even een aanpassing in de WMA Crossover
In deze zijn zoals eerder vermeld de Profit en Stoploss in percentages gedefinieerd
Verder zijn met behulp van Pierre statements aangepast zodat je ook gebruik kunt maken van het tabje Trading en Marktrichting Long of Short
In de vorige versie ging het systeem altijd Long EN Short

groet Joop Henzen


{-------------------------------------------------------
[INFO]
Author=
Created=2006-08-01
Modified=2006-08-17
Reference=
Usage=

[INPUTS]

[PLOTS]
PLOT1=1,-3,8421504,8421504,0,0,1,1,1,1
PLOT2=1,-2,8421504,8421504,0,0,1,1,1,1
PLOT3=1,-2,8421504,8421504,0,0,1,1,1,1
PLOT4=1,-2,8421504,8421504,0,0,1,1,1,1

[DESCRIPTION]

[END]
-------------------------------------------------------}

value function zWMACrossover (value xShortBars=11, value xLongBars=23,value xTrendBars=155,
value xProfit=36, value xStoploss=16) begin

{--- calculate todays position of the WMA's ---}
value xShortWMA[], xLongWMA[],xTrend;
xShortWMA := vWMA(Close,xShortBars);
xLongWMA := vWMA(Close,xLongBars);
xTrend := XAverage(Close,xTrendBars);

{--- check for any crossing ---}
value xAbove, xBelow;
xAbove := vCrossesAbove(xShortWMA,xLongWMA);
xBelow := vCrossesBelow(xShortWMA,xLongWMA);

{--- buy or sell depending on the crossings ---}
if xAbove and Close>xTrend then Buy;
if xBelow and Close<xTrend then Sell;

{---- handle long side ----}

Value xProfitLevel, xStopLevel;

if MarketPosition=1 then begin
xProfitLevel = EntryPrice(0)*((100+xProfit)/100);
xStopLevel = EntryPrice(0)*((100-xStopLoss)/100);
if Close>xProfitLevel or Close<xStopLevel then Exitlong;
end;

{---- handle short side ----}
if MarketPosition=-1 then begin
xProfitLevel = EntryPrice(0)*((100-xProfit)/100);
xStopLevel = EntryPrice(0)*((100+xStopLoss)/100);
if Close<xProfitLevel or Close>xStopLevel then Exitshort;
end;


{--- plot the WMA values and the current position ---}
plot1(xShortWMA,'WMA'+NumToStr(xShortBars));
plot2(xLongWMA,'WMA'+NumToStr(xLongBars));
plot3(CurrentContracts,'Position');
plot4(xTrend);


end;