Lion Trend S
Похожие материалы по тегам
Сообщите нам, если считаете, что материал размещён без разрешения.
Сообщить о материале
Обращение по товару «indicator lion trend s for tradingview_5962808620088302235.pine» отправится на рассмотрение. Укажите контакт для ответа и опишите причину.
О программе
«Lion Trend S» — индикатор для TradingView, написанный на Pine Script v6, предназначенный для отображения на графике поверх свечей. Он объединяет расчёт свечей Heikin Ashi, определение тренда через облако экспоненциальных скользящих средних (EMA 9, 21, 55, 100, 200, 300), линию Half Trend на основе скользящей средней и амплитуды, а также индикатор SuperTrend с расчётом ATR.
Индикатор рисует линии EMA с цветовой привязкой к направлению тренда (бычий или медвежий), опционально отображает свечи Heikin Ashi и линию Half Trend. При смене направления SuperTrend и совпадении с цветом EMA-тренда на графике появляются метки Buy и Sell.
Дополнительно индикатор визуализирует уровни стоп-лосса и три цели тейк-профита с помощью линий и подписей, используя фрактальные точки для определения стоп-лосса. Все элементы настраиваются через пользовательские параметры: цвета, периоды, множители, отображение и стиль линий.
Настройки программы
| Настройка | Описание |
|---|---|
| showHA | Включить Heikin Ashi — Переключатель отображения свечей Heikin Ashi |
| up_trend_color | Цвет бычьего тренда — Цвет линий и заливок при бычьем тренде |
| dn_trend_color | Цвет медвежьего тренда — Цвет линий и заливок при медвежьем тренде |
| ht_enable | Включить Half Trend — Переключатель отображения линии Half Trend |
| amp | Амплитуда Half Trend — Длина периода для расчёта индикатора Half Trend |
| Periods | Период SuperTrend — Период ATR для расчёта SuperTrend |
| src | Источник SuperTrend — Источник данных для расчёта SuperTrend |
| Multiplier | Множитель SuperTrend — Множитель ATR для расчёта уровней SuperTrend |
| changeATR | Метод расчёта ATR — Переключатель метода расчёта ATR для SuperTrend |
| showsignals | Показывать сигналы Buy/Sell — Отображение меток сигналов покупки и продажи |
| offset | Смещение от последней свечи — Смещение подписей и линий от последней свечи |
| len | Длина линий — Длина линий уровней стоп-лосса и тейк-профита |
| labelSizeOption | Размер подписей — Размер подписей и меток на графике |
| lineWidth | Толщина линий — Толщина линий уровней на графике |
| lineStyleOption | Стиль линий — Стиль линий уровней стоп-лосса и тейк-профита |
Поиск по коду файла
indicator("Lion Trend S",overlay = true)
showHA = input.bool(true, "Enable Heikin Ashi")
haClose = (open + high + low + close) / 4
var float haOpen = na
haOpen := na(haOpen) ? (open + close) / 2 : (haOpen + haClose[1]) / 2
haHigh = math.max(high, math.max(haOpen, haClose))
haLow = math.min(low, math.min(haOpen, haClose))
emaSrc= haClose
up_trend_color= input.color(#00bcd4,"BULL TREND THEME")
dn_trend_color=input.color(#e91e63,"BEAR TREND THEME")
price=plot(haClose,display = display.none)
emma300=ta.ema(emaSrc, 300)
emma200=ta.ema(haClose,200)
lowest_h=math.min(emma200,emma300)
highest_h=math.max(emma200,emma300)
emma100=ta.ema(haClose,100)
emma55=ta.ema(haClose,55)
lowest_l=math.min(emma100,emma55)
highest_l=math.max(emma100,emma55)
final_lowest=math.min(lowest_h,lowest_l)
final_highest=math.max(highest_h,highest_l)
var bool isUpTrend=false
var bool isDnTrend=false
var color emaColor=na
upTrend=haClose>final_lowest
dnTrend=haClose<final_highest
if(upTrend)
isUpTrend:=true
emaColor:=up_trend_color
if (dnTrend)
isDnTrend:=true
emaColor:=dn_trend_color
if upTrend and dnTrend
emaColor:=emaColor[1]
ema200 = plot(ta.ema(emaSrc,200), title='EMA 200', linewidth=3, color=color.new(emaColor, 50), offset=0, display=display.none)
fill(price, ema200, title='EMA 200 Fill', color=color.new(emaColor, 90), editable=true)
ema9 = plot(ta.ema(emaSrc,9), title='EMA 9', linewidth=3, color=color.new(emaColor,90), offset=0, display=display.none)
fill(price, ema9, title='EMA 9 Fill', color=color.new(emaColor, 90), editable=true)
ema21 = plot(ta.ema(emaSrc,21), title='EMA 21', linewidth=3, color=color.new(emaColor, 50), offset=0, display=display.none)
fill(price, ema21, title='EMA 21 Fill', color=color.new(emaColor, 90), editable=true)
ema55 = plot(ta.ema(emaSrc,55), title='EMA 55', linewidth=3, color=color.new(emaColor, 50), offset=0, display=display.none)
fill(price, ema55, title='EMA 55 Fill', color=color.new(emaColor, 90), editable=true)
ema100 = plot(ta.ema(emaSrc,100), title='EMA 100', linewidth=3, color=color.new(emaColor, 50), offset=0, display=display.none)
fill(price, ema100, title='EMA 100 Fill', color=color.new(emaColor, 90), editable=true)
plotcandle(showHA ? haOpen : na,showHA ? haHigh : na,showHA ? haLow : na,showHA ? haClose : na,title="Heikin Ashi Candles",color=emaColor,wickcolor=emaColor,bordercolor=emaColor)
bool ht_enable=input.bool(true,"Enable Half Trend Indicator",group = "Half Trend Indicator")
int amp = input.int(5, 'Amplitude', minval = 1,group = "Half Trend Indicator") // Length for indicator calculations
series float closeMA = ta.sma(close, amp) // Moving average of close prices
series float highestHigh = ta.highest(amp) // Highest high over the period
series float lowestLow = ta.lowest(amp) // Lowest low over the period
var float hl_t=0.0
if barstate.isfirst
hl_t := close
hl_t
switch
closeMA < hl_t and highestHigh < hl_t =>
hl_t := highestHigh
hl_t
closeMA > hl_t and lowestLow > hl_t =>
hl_t := lowestLow
hl_t
=>
hl_t := hl_t
hl_t
plot( ht_enable ? hl_t:na,title = "Half Trend", color = emaColor, linewidth = 2, editable = true)
Periods = input(title = 'SuperTrend ATR Period', defval = 10,group="SuperTrend")
src = input(hl2, title = 'SuperTrend Source')
Multiplier = input.float(title = 'SuperTrend ATR Multiplier', step = 1, defval = 3,group="SuperTrend")
changeATR = input(title = 'SuperTrend Change ATR Calculation Method ?', defval = true,group="SuperTrend")
showsignals = input(title = 'Show Buy/Sell Signals ?', defval = true,group="SuperTrend")
atr2 = ta.sma(ta.tr, Periods)
atr = changeATR ? ta.atr(Periods) : atr2
up = src - Multiplier * atr
up1 = nz(up[1], up)
up := close[1] > up1 ? math.max(up, up1) : up
dn = src + Multiplier * atr
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? math.min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
buySignal = trend == 1 and trend[1] == -1 and emaColor==up_trend_color
sellSignal = trend == -1 and trend[1] == 1 and emaColor==dn_trend_color
useFractal = true//input.bool(true, title = 'Use Fractal for Stop Loss', group = 'Trade Levels')
tradeSide = emaColor==up_trend_color?"Buy":"Sell"
showLabels = true// input.bool(true, title = 'Show TP&SL Labels?', group = 'TP&SL STYLE')
offset = input.int(10, title = 'Offset from Last Bar', minval = 1, maxval = 100, group = 'TP&SL STYLE')
len = input.iПоказано первые 50% кода (символов: 7637)
Открыть по тарифу
Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.
Разовая покупка файла
На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.
Зачем нужен email? После подтверждения оплаты файл сохранится в кабинете на этот email. Если аккаунта ещё нет, мы создадим его и пришлём ссылку для задания пароля. Если аккаунт уже есть, покупка добавится в него. Укажите адрес, к которому у вас есть доступ.
Чтобы оформить заказ, введите email и перейдите к оплате.