Ara
Ürünler
Topluluk
Piyasalar
Haberler
Aracı kurum
Daha Fazla
TR
Black Friday fırsatı
70% İNDİRİM
Topluluk
/
Fikirler
/
MACD
İngiliz Sterlini / ABD Doları
MACD
RockyRintharoSitanggang tarafından
Takip Et
Takip Et
23 Tem 2023
1
23 Tem 2023
//
version
=5
strategy("custom_strategy", overlay=true)
// Define input parameters
atr_length = 14
risk_to_reward_ratio = 0.1
stop_loss_multiplier = 2
trail_stop_multiplier = 1
// Calculate ATR value
atr_value = ta.atr(atr_length)
// Calculate stop loss levels
fix_stop_loss = close * (1 - risk_to_reward_ratio)
atr_stop_loss = strategy.position_avg_price - atr_value * stop_loss_multiplier
// Calculate trail stop level
trail_stop = strategy.position_avg_price - atr_value * trail_stop_multiplier
// Entry Logic - Replace {tulis nama indicator disini} with your desired indicator logic
entry_condition = ta.sma(close, 50) > ta.sma(close, 200)
// Exit Logic
exit_long = strategy.position_avg_price <= fix_stop_loss or low <= atr_stop_loss
exit_short = strategy.position_avg_price >= fix_stop_loss or high >= atr_stop_loss
// Trail Stop Logic
trail_stop_long = close >= trail_stop
trail_stop_short = close <= trail_stop
// Submit entry orders
if entry_condition
strategy.entry("Buy", strategy.long)
if entry_condition
strategy.entry("Sell", strategy.short)
// Submit exit orders
strategy.exit("Exit Buy", "Buy", stop = fix_stop_loss, trail_offset = atr_value * trail_stop_multiplier, trail_price = trail_stop_long)
strategy.exit("Exit Sell", "Sell", stop = fix_stop_loss, trail_offset = atr_value * trail_stop_multiplier, trail_price = trail_stop_short)
// Plot ATR value for reference
plot(atr_value, color=color.red)
Pivot Points
Supply and Demand
Support and Resistance
RockyRintharoSitanggang
Takip Et
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez.
Kullanım Şartları
'nda daha fazlasını okuyun.