FX:EURUSD   Евро / Доллар США
//@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)
Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.