Доброго времени суток, требуется написать индикатор для квика, код индикатора ниже. Индикатор имеется на трейдиниг вью. Формат сотрудничества представляю такой: договариваемся о сотрудничестве, далее написание индикатора, далее сверка индикатора (индикатор остается у программиста), нужны только видео/скрины его работы (что бы показатели совпадали квика и трейдинг вью), после оплата и передача индикатора.
//@version=4//Indicator - Oscillator of Moving Averages.
study(title="OsMA", shorttitle="OsMA", resolution="")
coment0 = input(false, title = "comment MACD parameteres ")
coment1 = input(false, title = "---- short 6, 19, 9")
coment2 = input(false, title = "---- middle 12, 26, 9")
coment3 = input(false, title = "---- long 19, 39, 9")
coment4 = input(false, title = "---- 4x 48, 104, 9")
coment5 = input(false, title = "---- Chris Manning 9, 17, 7")
coment6 = input(false, title = "---- Dinapoli 8, 17, 9")
// Getting inputs
fast_length = input(title="Fast Length", type=input.integer, defval=12)
slow_length = input(title="Slow Length", type=input.integer, defval=26)
src = input(title="Source", type=input.source, defval=close)
signal_length = input(title="Signal Smoothing", type=input.integer, minval = 1, maxval = 50, defval = 9)
signal_length2 = input(title="Signal Smoothing for OsMa", type=input.integer, minval = 1, maxval = 50, defval = 9)
dispmacd = input(title="display MACD", type=input.bool, defval=false)
dispsign = input(title="display OsMA sign", type=input.bool, defval=true)
sma_source = input(title="Simple MA(Oscillator)", type=input.bool, defval=false)
sma_signal = input(title="Simple MA(Signal Line)", type=input.bool, defval=true)
// Plot colors
col_grow_above = #26A69A
col_grow_below = #FFCDD2
col_fall_above = #B2DFDB
col_fall_below = #EF5350
col_macd = #0094ff
col_signal = #ff6a00
// Calculating
fast_ma = sma_source ? sma(src, fast_length) : ema(src, fast_length)
slow_ma = sma_source ? sma(src, slow_length) : ema(src, slow_length)
macd = fast_ma - slow_ma
signal = sma_signal ? sma(macd, signal_length) : ema(macd, signal_length)
osma = macd - signal
signal2 = sma_signal ? sma(osma, signal_length2) : ema(osma, signal_length2)
hist = osma - signal2
plot(hist, title="Histogram", st yle=plot.style_histogram, color=(hist>=0 ? (hist[1] < hist ? col_grow_above : col_fall_above) : (hist[1] < hist ? col_grow_below : col_fall_below) ), transp=0 , linewidth = 2)
plot(dispmacd ? macd : na, title="MACD", color=col_macd, transp=0)
plot(dispmacd ? signal : na, title="Signal", color=col_signal, transp=0)
plot(osma, title="OsMA", color= hist >= 0 ? color.green : color.red, transp=0)
plot(signal2, title="Signal2", color=color.gray, transp=0)
plot((dispsign and cross(hist,0))? signal2 : na, color= hist >= 0 ? color.green : color.red, title="OsMa sign", st yle = plot.style_circles, linewidth=4)
//@version=4//Indicator - Oscillator of Moving Averages.
study(title="OsMA", shorttitle="OsMA", resolution="")
coment0 = input(false, title = "comment MACD parameteres ")
coment1 = input(false, title = "---- short 6, 19, 9")
coment2 = input(false, title = "---- middle 12, 26, 9")
coment3 = input(false, title = "---- long 19, 39, 9")
coment4 = input(false, title = "---- 4x 48, 104, 9")
coment5 = input(false, title = "---- Chris Manning 9, 17, 7")
coment6 = input(false, title = "---- Dinapoli 8, 17, 9")
// Getting inputs
fast_length = input(title="Fast Length", type=input.integer, defval=12)
slow_length = input(title="Slow Length", type=input.integer, defval=26)
src = input(title="Source", type=input.source, defval=close)
signal_length = input(title="Signal Smoothing", type=input.integer, minval = 1, maxval = 50, defval = 9)
signal_length2 = input(title="Signal Smoothing for OsMa", type=input.integer, minval = 1, maxval = 50, defval = 9)
dispmacd = input(title="display MACD", type=input.bool, defval=false)
dispsign = input(title="display OsMA sign", type=input.bool, defval=true)
sma_source = input(title="Simple MA(Oscillator)", type=input.bool, defval=false)
sma_signal = input(title="Simple MA(Signal Line)", type=input.bool, defval=true)
// Plot colors
col_grow_above = #26A69A
col_grow_below = #FFCDD2
col_fall_above = #B2DFDB
col_fall_below = #EF5350
col_macd = #0094ff
col_signal = #ff6a00
// Calculating
fast_ma = sma_source ? sma(src, fast_length) : ema(src, fast_length)
slow_ma = sma_source ? sma(src, slow_length) : ema(src, slow_length)
macd = fast_ma - slow_ma
signal = sma_signal ? sma(macd, signal_length) : ema(macd, signal_length)
osma = macd - signal
signal2 = sma_signal ? sma(osma, signal_length2) : ema(osma, signal_length2)
hist = osma - signal2
plot(hist, title="Histogram", st yle=plot.style_histogram, color=(hist>=0 ? (hist[1] < hist ? col_grow_above : col_fall_above) : (hist[1] < hist ? col_grow_below : col_fall_below) ), transp=0 , linewidth = 2)
plot(dispmacd ? macd : na, title="MACD", color=col_macd, transp=0)
plot(dispmacd ? signal : na, title="Signal", color=col_signal, transp=0)
plot(osma, title="OsMA", color= hist >= 0 ? color.green : color.red, transp=0)
plot(signal2, title="Signal2", color=color.gray, transp=0)
plot((dispsign and cross(hist,0))? signal2 : na, color= hist >= 0 ? color.green : color.red, title="OsMa sign", st yle = plot.style_circles, linewidth=4)