door mvs » za 10 jan 2004, 20:18
Hallo Jan,
Ik weet echt niet meer hoe ik er aankom. Er staat me vaag iets bij, dat ik hem van de arkel site vandaan gehaald heb.
't Is voor optie schrijven
'k Hoop dat je deze bedoeld
Suc6
Martin
----------------------------
value function xvanArkel (value xADXBars=14,value xNeutral=20,value xStochBars=5,value xSlowK=3,value xSlowD=3,
) begin
value xADX,xHH[],xLL[],xSum1[],xSum2[],xAvgD[],xK[],xExitprice;
{---Calculate ADX---}
xADX := ADXCustom(High,Low,Close,xADXBars);
{---Calculate Stochastic---}
xHH :=Highest(High,xStochBars);
xLL :=Lowest(Low,xStochBars);
xSum1 :=summation((Close-xLL),xSlowK);
xSum2 :=summation((xHH-xLL),xSlowK);
xK :=(xSum1/xSum2)*100;
xAvgD:=Average(xK,xSlowD);
plot1(xK,'K%');
plot2(xAvgD,'D%');
plot3(80);
plot4(20);
{---Strategy---}
if ?xADX<20.00 and xAvgD>80.00 and xK>80.00 then begin
if xK crosses below xAvgD then sell;{---schrijven call---}
end;
if ?xADX<20.00 and xAvgD<20.00 and xK<20.00 then begin
if xK crosses above xAvgD then buy; {---schrijven put---}
end;
if marketposition=-1 then begin
xExitprice:=Entryprice+(Entryprice/100)*7.5;{AEX =5}
if xADX crosses above 20 or xK crosses above xAvgD or close>xExitprice then exitshort;
end;
if marketposition=1 then begin
xExitprice:=Entryprice+(Entryprice/100)*7.5;{AEX =5}
if xADX crosses above 20 or xK crosses below xAvgD or close>xExitprice then exitlong;
end;
end;
;