Уровни поддержки и сопротивления

Больше
3 нед. 1 день назад - 3 нед. 1 день назад #211 от roman
Уровни поддержки и сопротивления представляют собой особые ценовые зоны, возле которых цена приостанавливается, а далее тренд либо продолжается, либо происходит разворот движения цены. Данные зоны (уровни)обозначаются на ценовых графиках с помощью горизонтальных линий, которые соединяют последовательность точек, в которых останавливается движение цены.
Последнее редактирование: 3 нед. 1 день назад пользователем roman.

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Больше
3 нед. 1 день назад - 3 нед. 1 день назад #212 от roman
Рассмотрим алгоритм создания технического индикатора с помощью языка Pine в торговой платформе TradingView.
Доступен по ссылке:  https://ru.tradingview.com/script/PzcqLEwU-support-and-resistance/

Текст скрипта в торговой платформе TradingView

//Код представлен для TradingView. Версия PineCode v4
//@version=4
//Источник: © simenergy.ru

study(title="Support and Resistance", overlay=true)

//Общие переменные
quick_right = 5
quick_left = 120
period_search=720

//П.1. Определение диапазона колебания цены.
level1 = valuewhen(pivothigh(high,quick_left,quick_right), high[quick_right], 0)
level2 = valuewhen(pivotlow(low, quick_left,quick_right), low[quick_right], 0)
plot(level1, color=color.blue, show_last=10, linewidth=3, trackprice=true)
plot(level2, color=color.blue, show_last=10, linewidth=3, trackprice=true)

//П.2. Определение в диапазоне уровней поддержки и сопротивления

//Функция расчета AO
function_price(period, min_price,max_price) =>
number = 0
for i = 0 to period
if hl2 > min_price and hl2 < max_price
number := number+1
number


d_price=(level1-level2)/40

//i:=0
num0 = function_price(period_search, level1-(0+1)*d_price,level1-(0)*d_price)
l0 = line.new(bar_index, level1-(0+0.5)*d_price, bar_index[num0], level1-(0+0.5)*d_price, width = 4)
line.set_xloc(id=l0, x1=time[0]+ 86400000*2, x2=time + 86400000*(num0+2), xloc=xloc.bar_time)
line.delete(l0[1])

//i:=1
num1 = function_price(period_search, level1-(1+1)*d_price,level1-(1)*d_price)
l1 = line.new(bar_index, level1-(1+0.5)*d_price, bar_index[num1], level1-(1+0.5)*d_price, width = 4)
line.set_xloc(id=l1, x1=time[0]+ 86400000*2, x2=time + 86400000*(num1+2), xloc=xloc.bar_time)
line.delete(l1[1])

//i:=2
num2 = function_price(period_search, level1-(2+1)*d_price,level1-(2)*d_price)
l2 = line.new(bar_index, level1-(2+0.5)*d_price, bar_index[num2], level1-(2+0.5)*d_price, width = 4)
line.set_xloc(id=l2, x1=time[0]+ 86400000*2, x2=time + 86400000*(num2+2), xloc=xloc.bar_time)
line.delete(l2[1])

//i:=3
num3 = function_price(period_search, level1-(3+1)*d_price,level1-(3)*d_price)
l3 = line.new(bar_index, level1-(3+0.5)*d_price, bar_index[num3], level1-(3+0.5)*d_price, width = 4)
line.set_xloc(id=l3, x1=time[0]+ 86400000*2, x2=time + 86400000*(num3+2), xloc=xloc.bar_time)
line.delete(l3[1])

//i:=4
num4 = function_price(period_search, level1-(4+1)*d_price,level1-(4)*d_price)
l4 = line.new(bar_index, level1-(4+0.5)*d_price, bar_index[num4], level1-(4+0.5)*d_price, width = 4)
line.set_xloc(id=l4, x1=time[0]+ 86400000*2, x2=time + 86400000*(num4+2), xloc=xloc.bar_time)
line.delete(l4[1])

//i:=5
num5 = function_price(period_search, level1-(5+1)*d_price,level1-(5)*d_price)
l5 = line.new(bar_index, level1-(5+0.5)*d_price, bar_index[num5], level1-(5+0.5)*d_price, width = 4)
line.set_xloc(id=l5, x1=time[0]+ 86400000*2, x2=time + 86400000*(num5+2), xloc=xloc.bar_time)
line.delete(l5[1])

//i:=6
num6 = function_price(period_search, level1-(6+1)*d_price,level1-(6)*d_price)
l6 = line.new(bar_index, level1-(6+0.5)*d_price, bar_index[num6], level1-(6+0.5)*d_price, width = 4)
line.set_xloc(id=l6, x1=time[0]+ 86400000*2, x2=time + 86400000*(num6+2), xloc=xloc.bar_time)
line.delete(l6[1])

//i:=7
num7 = function_price(period_search, level1-(7+1)*d_price,level1-(7)*d_price)
l7 = line.new(bar_index, level1-(7+0.5)*d_price, bar_index[num7], level1-(7+0.5)*d_price, width = 4)
line.set_xloc(id=l7, x1=time[0]+ 86400000*2, x2=time + 86400000*(num7+2), xloc=xloc.bar_time)
line.delete(l7[1])

//i:=8
num8 = function_price(period_search, level1-(8+1)*d_price,level1-8*d_price)
l8 = line.new(bar_index, level1-(8+0.5)*d_price, bar_index[num8], level1-(8+0.5)*d_price, width = 4)
line.set_xloc(id=l8, x1=time[0]+ 86400000*2, x2=time + 86400000*(num8+2), xloc=xloc.bar_time)
line.delete(l8[1])

//i:=9
num9 = function_price(period_search, level1-(9+1)*d_price,level1-(9)*d_price)
l9 = line.new(bar_index, level1-(9+0.5)*d_price, bar_index[num9], level1-(9+0.5)*d_price, width = 4)
line.set_xloc(id=l9, x1=time[0]+ 86400000*2, x2=time + 86400000*(num9+2), xloc=xloc.bar_time)
line.delete(l9[1])

//i:=10
num10 = function_price(period_search, level1-(10+1)*d_price,level1-(10)*d_price)
l10 = line.new(bar_index, level1-(10+0.5)*d_price, bar_index[num10], level1-(10+0.5)*d_price, width = 4)
line.set_xloc(id=l10, x1=time[0]+ 86400000*2, x2=time + 86400000*(num10+2), xloc=xloc.bar_time)
line.delete(l10[1])

//i:=11
num11 = function_price(period_search, level1-(11+1)*d_price,level1-(11)*d_price)
l11 = line.new(bar_index, level1-(11+0.5)*d_price, bar_index[num11], level1-(11+0.5)*d_price, width = 4)
line.set_xloc(id=l11, x1=time[0]+ 86400000*2, x2=time + 86400000*(num11+2), xloc=xloc.bar_time)
line.delete(l11[1])

//i:=12
num12 = function_price(period_search, level1-(12+1)*d_price,level1-(12)*d_price)
l12 = line.new(bar_index, level1-(12+0.5)*d_price, bar_index[num12], level1-(12+0.5)*d_price, width = 4)
line.set_xloc(id=l12, x1=time[0]+ 86400000*2, x2=time + 86400000*(num12+2), xloc=xloc.bar_time)
line.delete(l12[1])

//i:=13
num13 = function_price(period_search, level1-(13+1)*d_price,level1-(13)*d_price)
l13 = line.new(bar_index, level1-(13+0.5)*d_price, bar_index[num13], level1-(13+0.5)*d_price, width = 4)
line.set_xloc(id=l13, x1=time[0]+ 86400000*2, x2=time + 86400000*(num13+2), xloc=xloc.bar_time)
line.delete(l13[1])


//i:=14
num14 = function_price(period_search, level1-(14+1)*d_price,level1-(14)*d_price)
l14 = line.new(bar_index, level1-(14+0.5)*d_price, bar_index[num14], level1-(14+0.5)*d_price, width = 4)
line.set_xloc(id=l14, x1=time[0]+ 86400000*2, x2=time + 86400000*(num14+2), xloc=xloc.bar_time)
line.delete(l14[1])

//i:=15
num15 = function_price(period_search, level1-(15+1)*d_price,level1-(15)*d_price)
l15 = line.new(bar_index, level1-(15+0.5)*d_price, bar_index[num15], level1-(15+0.5)*d_price, width = 4)
line.set_xloc(id=l15, x1=time[0]+ 86400000*2, x2=time + 86400000*(num15+2), xloc=xloc.bar_time)
line.delete(l15[1])


//i:=16
num16 = function_price(period_search, level1-(16+1)*d_price,level1-(16)*d_price)
l16 = line.new(bar_index, level1-(16+0.5)*d_price, bar_index[num16], level1-(16+0.5)*d_price, width = 4)
line.set_xloc(id=l16, x1=time[0]+ 86400000*2, x2=time + 86400000*(num16+2), xloc=xloc.bar_time)
line.delete(l16[1])


//i:=17
num17 = function_price(period_search, level1-(17+1)*d_price,level1-(17)*d_price)
l17 = line.new(bar_index, level1-(17+0.5)*d_price, bar_index[num17], level1-(17+0.5)*d_price, width = 4)
line.set_xloc(id=l17, x1=time[0]+ 86400000*2, x2=time + 86400000*(num17+2), xloc=xloc.bar_time)
line.delete(l17[1])

//i:=18
num18 = function_price(period_search, level1-(18+1)*d_price,level1-(18)*d_price)
l18 = line.new(bar_index, level1-(18+0.5)*d_price, bar_index[num18], level1-(18+0.5)*d_price, width = 4)
line.set_xloc(id=l18, x1=time[0]+ 86400000*2, x2=time + 86400000*(num18+2), xloc=xloc.bar_time)
line.delete(l18[1])

//i:=19
num19 = function_price(period_search, level1-(19+1)*d_price,level1-(19)*d_price)
l19 = line.new(bar_index, level1-(19+0.5)*d_price, bar_index[num19], level1-(19+0.5)*d_price, width = 4)
line.set_xloc(id=l19, x1=time[0]+ 86400000*2, x2=time + 86400000*(num19+2), xloc=xloc.bar_time)
line.delete(l19[1])

//i:=20
num20 = function_price(period_search, level1-(20+1)*d_price,level1-(20)*d_price)
l20 = line.new(bar_index, level1-(20+0.5)*d_price, bar_index[num20], level1-(20+0.5)*d_price, width = 4)
line.set_xloc(id=l20, x1=time[0]+ 86400000*2, x2=time + 86400000*(num20+2), xloc=xloc.bar_time)
line.delete(l20[1])

//i:=21
num21 = function_price(period_search, level1-(21+1)*d_price,level1-(21)*d_price)
l21 = line.new(bar_index, level1-(21+0.5)*d_price, bar_index[num21], level1-(21+0.5)*d_price, width = 4)
line.set_xloc(id=l21, x1=time[0]+ 86400000*2, x2=time + 86400000*(num21+2), xloc=xloc.bar_time)
line.delete(l21[1])

//i:=22
num22 = function_price(period_search, level1-(22+1)*d_price,level1-(22)*d_price)
l22 = line.new(bar_index, level1-(22+0.5)*d_price, bar_index[num22], level1-(22+0.5)*d_price, width = 4)
line.set_xloc(id=l22, x1=time[0]+ 86400000*2, x2=time + 86400000*(num22+2), xloc=xloc.bar_time)
line.delete(l22[1])

//i:=23
num23 = function_price(period_search, level1-(23+1)*d_price,level1-(23)*d_price)
l23 = line.new(bar_index, level1-(23+0.5)*d_price, bar_index[num23], level1-(23+0.5)*d_price, width = 4)
line.set_xloc(id=l23, x1=time[0]+ 86400000*2, x2=time + 86400000*(num23+2), xloc=xloc.bar_time)
line.delete(l23[1])

//i:=24
num24 = function_price(period_search, level1-(24+1)*d_price,level1-(24)*d_price)
l24 = line.new(bar_index, level1-(24+0.5)*d_price, bar_index[num24], level1-(24+0.5)*d_price, width = 4)
line.set_xloc(id=l24, x1=time[0]+ 86400000*2, x2=time + 86400000*(num24+2), xloc=xloc.bar_time)
line.delete(l24[1])

//i:=25
num25 = function_price(period_search, level1-(25+1)*d_price,level1-(25)*d_price)
l25 = line.new(bar_index, level1-(25+0.5)*d_price, bar_index[num25], level1-(25+0.5)*d_price, width = 4)
line.set_xloc(id=l25, x1=time[0]+ 86400000*2, x2=time + 86400000*(num25+2), xloc=xloc.bar_time)
line.delete(l25[1])

//i:=26
num26 = function_price(period_search, level1-(26+1)*d_price,level1-(26)*d_price)
l26 = line.new(bar_index, level1-(26+0.5)*d_price, bar_index[num26], level1-(26+0.5)*d_price, width = 4)
line.set_xloc(id=l26, x1=time[0]+ 86400000*2, x2=time + 86400000*(num26+2), xloc=xloc.bar_time)
line.delete(l26[1])

//i:=27
num27 = function_price(period_search, level1-(27+1)*d_price,level1-(27)*d_price)
l27 = line.new(bar_index, level1-(27+0.5)*d_price, bar_index[num27], level1-(27+0.5)*d_price, width = 4)
line.set_xloc(id=l27, x1=time[0]+ 86400000*2, x2=time + 86400000*(num27+2), xloc=xloc.bar_time)
line.delete(l27[1])

//i:=28
num28 = function_price(period_search, level1-(28+1)*d_price,level1-(28)*d_price)
l28 = line.new(bar_index, level1-(28+0.5)*d_price, bar_index[num28], level1-(28+0.5)*d_price, width = 4)
line.set_xloc(id=l28, x1=time[0]+ 86400000*2, x2=time + 86400000*(num28+2), xloc=xloc.bar_time)
line.delete(l28[1])

//i:=29
num29 = function_price(period_search, level1-(29+1)*d_price,level1-(29)*d_price)
l29 = line.new(bar_index, level1-(29+0.5)*d_price, bar_index[num29], level1-(29+0.5)*d_price, width = 4)
line.set_xloc(id=l29, x1=time[0]+ 86400000*2, x2=time + 86400000*(num29+2), xloc=xloc.bar_time)
line.delete(l29[1])

//i:=30
num30 = function_price(period_search, level1-(30+1)*d_price,level1-(30)*d_price)
l30 = line.new(bar_index, level1-(30+0.5)*d_price, bar_index[num30], level1-(30+0.5)*d_price, width = 4)
line.set_xloc(id=l30, x1=time[0]+ 86400000*2, x2=time + 86400000*(num30+2), xloc=xloc.bar_time)
line.delete(l30[1])

//i:=31
num31 = function_price(period_search, level1-(31+1)*d_price,level1-(31)*d_price)
l31 = line.new(bar_index, level1-(31+0.5)*d_price, bar_index[num31], level1-(31+0.5)*d_price, width = 4)
line.set_xloc(id=l31, x1=time[0]+ 86400000*2, x2=time + 86400000*(num31+2), xloc=xloc.bar_time)
line.delete(l31[1])


//i:=32
num32 = function_price(period_search, level1-(32+1)*d_price,level1-(32)*d_price)
l32 = line.new(bar_index, level1-(32+0.5)*d_price, bar_index[num32], level1-(32+0.5)*d_price, width = 4)
line.set_xloc(id=l32, x1=time[0]+ 86400000*2, x2=time + 86400000*(num32+2), xloc=xloc.bar_time)
line.delete(l32[1])


//i:=33
num33 = function_price(period_search, level1-(33+1)*d_price,level1-(33)*d_price)
l33 = line.new(bar_index, level1-(33+0.5)*d_price, bar_index[num33], level1-(33+0.5)*d_price, width = 4)
line.set_xloc(id=l33, x1=time[0]+ 86400000*2, x2=time + 86400000*(num33+2), xloc=xloc.bar_time)
line.delete(l33[1])

//i:=34
num34 = function_price(period_search, level1-(34+1)*d_price,level1-(34)*d_price)
l34 = line.new(bar_index, level1-(34+0.5)*d_price, bar_index[num34], level1-(34+0.5)*d_price, width = 4)
line.set_xloc(id=l34, x1=time[0]+ 86400000*2, x2=time + 86400000*(num34+2), xloc=xloc.bar_time)
line.delete(l34[1])


//i:=35
num35 = function_price(period_search, level1-(35+1)*d_price,level1-(35)*d_price)
l35 = line.new(bar_index, level1-(35+0.5)*d_price, bar_index[num35], level1-(35+0.5)*d_price, width = 4)
line.set_xloc(id=l35, x1=time[0]+ 86400000*2, x2=time + 86400000*(num35+2), xloc=xloc.bar_time)
line.delete(l35[1])

//i:=36
num36 = function_price(period_search, level1-(36+1)*d_price,level1-(36)*d_price)
l36 = line.new(bar_index, level1-(36+0.5)*d_price, bar_index[num36], level1-(36+0.5)*d_price, width = 4)
line.set_xloc(id=l36, x1=time[0]+ 86400000*2, x2=time + 86400000*(num36+2), xloc=xloc.bar_time)
line.delete(l36[1])


//i:=37
num37 = function_price(period_search, level1-(37+1)*d_price,level1-(37)*d_price)
l37 = line.new(bar_index, level1-(37+0.5)*d_price, bar_index[num37], level1-(37+0.5)*d_price, width = 4)
line.set_xloc(id=l37, x1=time[0]+ 86400000*2, x2=time + 86400000*(num37+2), xloc=xloc.bar_time)
line.delete(l37[1])


//i:=38
num38 = function_price(period_search, level1-(38+1)*d_price,level1-(38)*d_price)
l38 = line.new(bar_index, level1-(38+0.5)*d_price, bar_index[num38], level1-(38+0.5)*d_price, width = 4)
line.set_xloc(id=l38, x1=time[0]+ 86400000*2, x2=time + 86400000*(num38+2), xloc=xloc.bar_time)
line.delete(l38[1])


//i:=39
num39 = function_price(period_search, level1-(39+1)*d_price,level1-(39)*d_price)
l39 = line.new(bar_index, level1-(39+0.5)*d_price, bar_index[num39], level1-(39+0.5)*d_price, width = 4)
line.set_xloc(id=l39, x1=time[0]+ 86400000*2, x2=time + 86400000*(num39+2), xloc=xloc.bar_time)
line.delete(l39[1])

Индикатор  показывает ценовые зоны, возле которых цена приостанавливается, а далее тренд либо продолжается, либо происходит разворот движения цены. Данные зоны (уровни) обозначаются на ценовых графиках с помощью горизонтальных линий, которые соединяют последовательность точек, в которых останавливается движение цены.
Вложения:
Последнее редактирование: 3 нед. 1 день назад пользователем roman.

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Время создания страницы: 0.149 секунд