Страница 1 из 1

Percent change bar chart

Добавлено: 14 июн 2020, 16:54
ZiZ
Добрый день!
На TradingView имеется очень полезный в торговле индикатор Percent change bar chart.
Никто не хочет попробовать свой программерский скилл и сделать такой же для терминала АльфаДирект? :)
Вот исходный код.
Заранее благодарен всем откликнувшимся.

Код: Выделить всё

////////////////////////////////////////////////////////////
//  Copyright by HPotter v3.0 06/01/2017
//
//  This histogram displays price or % change from previous bar.
//  Can be applied to any time frame.
//     15/12/2016 Update:
//  Number of digits after the floating point for study values on the axis now two.
//     06/01/2017
//  Added look back bars.
////////////////////////////////////////////////////////////
study(title="Percent change bar chart", precision = 2)
input_barwidth = input(4, title="Bar Width")
input_percentorprice = input(false, title="Price Change")
input_barsback = input(1, title="Look Back")
hline(0, color=blue, linestyle=line)
xPrice = close
xPrice1 = iff(input_percentorprice, xPrice - xPrice[input_barsback], ((xPrice - xPrice[input_barsback]) * 100)/ xPrice[input_barsback])
colorg = iff(xPrice1 < 0, red, green)
plot(xPrice1, color=colorg, style = histogram, linewidth = input_barwidth, title="Change")

Re: Percent change bar chart

Добавлено: 15 июн 2020, 16:56
oxi
Чем данный индикатор отличается от Моментума или ROC?