FX:CADJPY   Dolar Kanadyjski/Jen Japoński
//@version=4
strategy("Stratégie des Bandes de Bollinger", overlay=true)

// Paramètres des Bandes de Bollinger
length = input(20, minval=1, title="Longueur")
mult = input(2.0, minval=0.1, title="Multiplicateur")

// Calcul des Bandes de Bollinger
basis = sma(close, length)
dev = mult * stdev(close, length)
upper = basis + dev
lower = basis - dev

// Points d'entrée
longCondition = crossover(close, upper) // Signal d'achat lorsque le prix dépasse la bande de Bollinger supérieure
if (longCondition)
strategy.entry("Achat", strategy.long)

// Points de sortie
stopLoss = input(1.0, title="Stop Loss (%)") // Pourcentage de perte maximal autorisé
takeProfit = input(2.0, title="Take Profit (%)") // Pourcentage de profit minimal attendu

strategy.exit("Vente", "Achat", stop=close*(1-stopLoss/100), limit=close*(1+takeProfit/100))
Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.