| Envoyé par marcd le 04 Octobre 2006 à 01:03
|
|
|
Y'a encore un petit souci avec les instructions de sortie mais le corde prorealtime suivant te permet d'entrer en fonction des bollinger. Les sorties sont a retravailler car ca sort pas beaucoup 
ONCE maBollingerHaute = 0 ONCE maBollingerBasse = 0
indicator1=AVERAGE[200](close)
c1 = CLOSE >indicator1 c2 = CLOSE <indicator1
REM 3 jours de suite au-dessous de Bollinger 5 ecart type 1 REM achat = LOWEST[4](CLOSE<AVERAGE[5]-STD[5]) REM cloture au-dessus de la moyenne de Bollinger 5 REM vente = (CLOSE > AVERAGE[5]+STD[5])
maBollingerHaute = AVERAGE[5](close) + STD[5](close) maBollingerBasse = AVERAGE[5](close) - STD[5](close)
REM conditions Achat ACHAT = close < maBollingerBasse FOR index=1 to 2 DO ACHAT = ACHAT AND (close[index] < maBollingerBasse[index]) NEXT REM conditions VAD VENTEAD = close > maBollingerHaute AND close[1] > maBollingerHaute[1]
REM instructions d'entree IF ACHAT and c1 THEN BUY 100 %CAPITAL AT MARKET TodayOnClose ELSIF VENTEAD AND c2 then SELLSHORT 100 %CAPITAL AT MARKET TodayOnClose ENDIF
REM SORTIES SUR PRIX EN SEANCE SELL 100 %CAPITAL AT indicator1 LIMIT EXITSHORT 100 %CAPITAL AT indicator1 LIMIT
====================================
Je suis pas sur d'avoir trop le temps demain mais au moins ca te donne une base de depart.
__________________ Marc Defosse
|