door Jo » di 17 mei 2005, 8:17
Hoi Jan & Frans,
Ziehierna de aangepaste vesticode waar je enkel het Systeem xVAT dient in te voegen.
Attentie ik ga enkel LONG !!
-----------------------------
value function xVAT (value xSeries=Close, value xNumberOfBars=5) begin
value xPosition, xSlot1, xSlot2, xWMA2, xWMA1;
xSlot1 := Close;
xSlot2 := xSlot1[1];
xWMA1 := vWMA(xSeries,xNumberOfBars);
xWMA2 := xWMA1[1];
if xSlot1>xWMA1 and xSlot2>xWMA2 and xSlot1>xSlot2 then vEnterLong;
if xSlot1<xWMA1 and xSlot2<xWMA2 or xSlot1<xSlot2 then vExitLong;
{ if xSlot1<xWMA1 and xSlot2<xWMA2 and xSlot1<xSlot2 then vEnterShort;
if xSlot1>xWMA1 and xSlot2>xWMA2 or xSlot1>xSlot2 then vExitShort;}
plot1(xWMA1,'1');
plot2(xSlot1,'Slot1');
plot3(xWMA2,'2');
plot4(xSlot2,'Slot2');
end;
-----------------------------------------------
Wat de resultaten van deze code betrefd kom ik totaal andere resultaten uit als opgegeven op dit forum.
datareeks = 10 jaar --- weekgrafiek ---- ABN_AMRO
Total trades 33 | Winning trades 19 | Losing trades 14
Total net result 1 | Total profit 26 | Total loss -26
Prof/loss ratio 0.76 | P/L ratio long 0.76 | P/L ratio short -0.00
Annual gain 0.0% | Avg. profit 1 | Avg. loss -2
Win/Loss ratio 1.36 | % winners 57.6% | % losers 42.4%
% long trades 100% | good longs 19 | bad longs 14
% short trades -0% | good shorts -0 | bad shorts -0
Total duration 501 | Avg. duration 63 | Avg. duration 21
% in the market 61.5% | % in good trade 49.3% | % in bad trade 12.2%
Longest duration 26 | Longest winner 26 | longest loser 13
Max. drawdown 20 | largest winner 4 | largest loser -5
--------------------------------
Dag basis
Total trades 164 | Winning trades 72 | Losing trades 92
Total net result 4 | Total profit 61 | Total loss -58
Prof/loss ratio 1.36 | P/L ratio long 1.36 | P/L ratio short -0.00
Annual gain 0.0% | Avg. profit 1 | Avg. loss -1
Win/Loss ratio 0.78 | % winners 43.9% | % losers 56.1%
% long trades 100% | good longs 72 | bad longs 92
% short trades -0% | good shorts -0 | bad shorts -0
Total duration 2572 | Avg. duration 13 | Avg. duration 5
% in the market 54.1% | % in good trade 36.6% | % in bad trade 17.5%
Longest duration 47 | Longest winner 47 | longest loser 17
Max. drawdown 15 | largest winner 5 | largest loser -3
-----------------------
Jo