door mvs » zo 11 apr 2004, 16:31
Bedankt, Paul
'k Heb er wat mee zitten stoeien, ?en kwam met dit systeempje, waarmee ik, in tradingrange, de stochastic wil laten werken en in een trend markt de MA
Als iemand nog aanpassing heeft
Het is geopt. voor aex 1 uur ?in periode 2-1-2003 t/m heden (8-4-2004)
vr gr
Martin
---------------------------
value function MAma (value xMAbars=38, value xMAmaBars=4,value xNumberOfBars=21,
value xEMA1=5,Value xNivo=0.26, value AdxBars=62, value Adxnivo=21, ?value xOverSold=25, value xOverBought=70) begin
Value xMA, xMAma, xHisto, xMidKoers, xMaHisto,xBuySetUp,xSellSetUp;
xMidkoers := (h+l+o+c)/4;
xMa ?:= veMa(LinearRegValue(xMidkoers ?,xMABars,0),3);
xMama:= vma(xma,xMAmaBars);
xHisto:= xMa-xMama;
xMaHisto:=vema(xhisto,3);
Value xFastk, xSlowK;
xFastK := FastK(xNumberOfBars);
xSlowK := vEMA(xFastK,xEMA1);
value xadx;
xadx=adx(adxBars);
Plot1(xMa,'Ma');
Plot2(xMama,'Ma ma');
Plot3(xhisto,'MaHisto');
Plot4(xMahisto,'MaHisto');
Plot5(xslowk,'K%');
Plot6(xoverbought,'OB');
PLot7(xoversold,'OS');
Plot8(xAdx,'ADX');
boolean xAbove, xBelow;
if xSlowk crosses above xOversold then begin
xAbove=true;
xBelow=false;
end;
if xSlowk crosses below xOverbought then begin
xBelow=true;
xAbove=false;
end;
if xAbove then begin
xBuySetUp=xBuySetUp[1]+1;
xSellSetUp=0;
end;
if xBelow then begin
xSellSetUp=xSellSetUp[1]+1;
xBuySetUp=0;
end;
if xAbove = true and xBuySetUp<=4 ?and xHisto >-xNivo
? ? ? ? ? ?and xAdx < xAdx[1] or xAdx < adxNivo then buy next bar at high stop;
if xBelow = true and xSellSetUp<=4 and xHisto < xnivo
? ? ? ? ? ?and xAdx < xAdx[1] or xAdx < adxNivo then sell next bar at Low Stop;
If xHisto > ?xNivo then buy ?next bar at high stop;
If xHisto < -xNivo then sell next bar at low stop;
If xHisto < xNivo ?and xSlowk > xoverbought and c < lowest(low,3)[1] ? then exitlong ?next bar at Market ;
If xHisto > -xNivo and xSlowk < xoversold ? and c > Highest(high,3)[1] then exitshort next bar at market ;
If xMa > xMa[1] and xadx>xadx[1] and xAdx > ADXNivo then Buy next bar at High stop;
If xMa < xMa[1] and xadx>xadx[1] and xAdx > ADXNivo then Sell next bar at Low stop;
end;