Dest123

VolumeVsVSMAComparison

Volume vs the volume sma .

Blue is low volume , green is normal, yellow is high, and red is very high.

Top bar is 100sma, middle is 25sma, and bottom is 5 sma .
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?
//@version=2
study("VolumeVsVSMAComparison")
//strategy("Testing")

//changePosition(up) =>
  //  strategy.close_all()
//    up ? strategy.entry("buy", strategy.long, 10) : strategy.entry("sell", strategy.short, 10)
  //  up

smaVal = 100
lowVolume = volume < sma(volume,smaVal)*0.8
highVolume = volume > sma(volume,smaVal)*1.5
mediumHighVolume = volume > sma(volume,smaVal)*1

smaVal2 = 25
lowVolume2 = volume < sma(volume,smaVal2)*0.8
highVolume2 = volume > sma(volume,smaVal2)*1.5
mediumHighVolume2 = volume > sma(volume,smaVal2)*1

smaVal3 = 5
lowVolume3 = volume < sma(volume,smaVal3)*0.8
highVolume3 = volume > sma(volume,smaVal3)*1.5
mediumHighVolume3 = volume > sma(volume,smaVal3)*1

change = sma((close-open),1)
goingUp = ((change > change[1]))// and (change[1] > change[2]))

plot(close,"", lowVolume ? blue : highVolume ? red : mediumHighVolume ? orange : green, linewidth=3)
plot(close-5,"", lowVolume2 ? blue : highVolume2 ? red : mediumHighVolume2 ? orange : green, linewidth=3)
plot(close-10,"", lowVolume3 ? blue : highVolume3 ? red : mediumHighVolume3 ? orange : green, linewidth=3)

//changePosition(goingUp)
//if (not na(goingUp[1]))
    //if (goingUp != goingUp[1])
        //if ((lowVolume[1] or lowVolume[2]) and highVolume) or (highVolume[1] and not highVolume)
        //if goingUp
            //strategy.entry("buy", strategy.long, strategy.position_size == 0 ? 10 : 20)
        //else
//            strategy.entry("sell", strategy.short, strategy.position_size == 0 ? 10 : 20)

//plot(strategy.equity, "", blue)
//plot(strategy.netprofit+100)
//plot(close, "", (goingUp ? green : red))
//plot(open, "", (((sma(open,3) > sma(open,3)[1]) and (sma(open,3)[1] > sma(open,3)[2])) ? green : red))

//plot(macd, color=blue)
//plot(signal, color=orange)