
Стратегия является высокотехнологичной торговой системой, основанной на индикаторе супертенденции, которая использует динамический механизм отслеживания тенденций в сочетании с проверкой ценовых прорывов, чтобы эффективно улавливать переломные моменты в тенденциях рынка.
В основе стратегии лежат следующие ключевые элементы:
Эта стратегия, в сочетании с индикаторами сверхтенденции и анализом ценового поведения, создает относительно надежную торговую систему. Несмотря на некоторые потенциальные риски, ее стабильность и прибыльность могут быть дополнительно повышены с помощью рекомендуемого направления оптимизации. Успешная реализация стратегии требует от трейдера глубокого понимания рыночной среды и гибкой настройки параметров в соответствии с реальными обстоятельствами.
/*backtest
start: 2024-08-01 00:00:00
end: 2025-02-19 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"DOGE_USDT"}]
*/
//@version=5
strategy("Supertrend Strategy with Money Ocean Trade", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Input parameters
supertrendLength = input.int(6, title="Supertrend Length")
supertrendFactor = input.float(0.25, title="Supertrend Factor")
// Supertrend calculation
[supertrend, direction] = ta.supertrend(supertrendFactor, supertrendLength)
// Plot Supertrend line
supertrendColor = direction == 1 ? color.green : color.red
plot(supertrend, title="Supertrend", color=supertrendColor, linewidth=2, style=plot.style_line)
// Variables to track trend change and candle break
var bool trendChanged = false
var float prevSupertrend = na
if (not na(prevSupertrend) and direction != nz(ta.valuewhen(prevSupertrend != supertrend, direction, 1)))
trendChanged := true
else
trendChanged := false
prevSupertrend := supertrend
longEntry = trendChanged and close[1] < supertrend[1] and close > supertrend
shortEntry = trendChanged and close[1] > supertrend[1] and close < supertrend
// Strategy execution
if (longEntry)
strategy.entry("Long", strategy.long)
if (shortEntry)
strategy.entry("Short", strategy.short)
// Plot entry signals on the chart
plotshape(series=longEntry, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")
plotshape(series=shortEntry, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")
// Alerts
alertcondition(longEntry, title="Buy Signal", message="Buy Signal Triggered!")
alertcondition(shortEntry, title="Short Signal", message="Short Signal Triggered!")