FX:EURUSD   Euro / Dolar USA
//@version=5
strategy("My Strategy", overlay=true, initial_capital=100, currency=currency.USD)

// Define strategy variables
var float last_buy_price = na

// Define strategy parameters
var float take_profit = input.float(1.5, title="Take Profit")
var float stop_loss = input.float(0.9, title="Stop Loss")

// Define strategy entry conditions
entry_condition = // Define your entry conditions here

// Define strategy exit conditions
exit_condition = // Define your exit conditions here

// Execute strategy
if entry_condition
strategy.entry("Buy", strategy.long)
last_buy_price := close

if exit_condition
strategy.close("Buy")

// Define take profit and stop loss
strategy.exit("Take Profit/Stop Loss", "Buy", profit=last_buy_price*take_profit, loss=last_buy_price*stop_loss)
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.