hi all
i found this indicator
//premier stochastic2
len=8
per=5
stoc=Stochastic[len,1](close)
nsto=0.1*(stoc-50)
ssto=exponentialaverage[per](nsto)
sssto=exponentialaverage[per](ssto)
prem=(EXP(sssto)-1)/(exp(sssto)+1)
cond1=prem<.9 and prem[1]>.9
cond2=prem<.2 and prem[1]>.2
cond3=prem>-.9 and prem[1]<-.9
cond4=prem>-.2 and prem[1]<-.2
condha=(cond1 or cond2)*.2
condvte=(cond3 or cond4)*-.2
return prem, .9, .2, -.9, -.2,condha, condvte
and i have this backtest which it call it but it does not work ….
aa= 4
bb=aa*2
REM Achat
ignored, ignored, ignored, ignored, ignored, indic1, indic2= CALL "premier stochastic2"
c1 = (indic1 > -0.1)
IF c1 and not onmarket THEN
BUY 1 contract AT MARKET
pr=tradeprice(1)
tg=pr*(1+bb)
st=pr*(1-aa)
ENDIF
sell at st stop
sell at tg limit
REM Vente à découvert
c2 = (indic2 < 0.1)
IF c2 and not onmarket THEN
SELLSHORT 1 contract AT MARKET
prv=tradeprice(1)
tgv=prv*(1-bb)
stv=prv*(1+aa)
ENDIF
exitshort at stv stop
exitshort at tgv limit
can anyone debug it please , i ve change some things in it , butit nor working yet .
original code is from hk lisse site ….