Haha oui c’est dommage, je testais sur un peu tout les indicateurs (les plus populaires, forex et matière première). D’accord merci je ne connaissais pas, je m’inscris dessus pour découvrir ça.
Détails (sans spread, ni commission) :
gain moyen : ? / trade
% de positions gagnantes : +80%
Ratio Gains/Pertes : +10
plus gros gain : 10
plus grosse perte : 10
// Définition des paramètres du code
DEFPARAM CumulateOrders = false // Cumul des positions désactivé
DEFPARAM Preloadbars = 5000 // backtest sur 5000 barre, c’est le max
//DEFPARAM NoCashUpdate = true // à false il réinvesti les bénéfice (uniquement en backtest)
Tenkansen = (highest[9](high)+lowest[9](low))/2
Kijunsen = (highest[26](high)+lowest[26](low))/2
SSpanA = (tenkansen[26]+kijunsen[26])/2
SSpanB = (highest[52](high[26])+lowest[52](low[26]))/2
//Chikou = close[26]
// TENDANCE HAUSSIÈRE
// Conditions pour ouvrir une position acheteuse
kumoHigh = (SSpanA > SSpanB) and high > SSpanA
indicator1 = Stochastic[14,3](close)
indicator2 = Average[5](indicator1)
c1 = (indicator1[1] CROSSES OVER indicator2[1]) and indicator1[1] < 40
IF c1 and kumoHigh THEN
BUY 10 SHARE AT MARKET // jusqu’à 50
ENDIF
// Conditions pour fermer une position acheteuse
indicator3 = Stochastic[14,3](close)
indicator4 = Average[5](indicator3)
c2 = (indicator3[1] CROSSES UNDER indicator4[1])and indicator3[1] > 95
IF c2 and (SSpanA > SSpanB) and high < SSpanA THEN
SELL AT MARKET
ENDIF
// Stops et objectifs
SET STOP %LOSS 0.001
SET TARGET $PROFIT 1
// TENDANCE BAISSIÈRE
// Conditions pour ouvrir une position acheteuse
kumoLow = (SSpanA < SSpanB) and low < SSpanA
indicator5 = Stochastic[14,3](close)
indicator6 = Average[5](indicator5)
c3 = (indicator5[1] CROSSES UNDER indicator6[1]) and indicator5[1] < 95
IF c3 and kumoLow THEN
SELL AT MARKET
//BUY 1 SHARE AT MARKET
ENDIF
// Conditions pour fermer une position acheteuse
indicator7 = Stochastic[14,3](close)
indicator8 = Average[5](indicator7)
c4 = (indicator7[1] CROSSES OVER indicator8[1])and indicator7[1] > 40
IF c4 and (SSpanA < SSpanB) and low > SSpanA THEN
//SELL AT MARKET
BUY 10 SHARE AT MARKET // jusqu’à 50
ENDIF
// Stops et objectifs
SET STOP $LOSS 0.001
SET TARGET $PROFIT 1