jivasmax

% YoY

121
Percent Change from Year Ago
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
study("% YoY")

Period = input(title="Period Cycle", type=integer , defval=12)
//Seasonlength = input(title="Season length", type=integer, defval=66)
//Smoothing = input(title="SMA (smoothing)", type=integer, defval=5)

//LBP = Period / Seasonlength

lastyear = (close - close[1*Period]) / close[1*Period]
//twoyearsago = (close[1*Period] - close[1*Period + Period/LBP]) / close[1*Period + Period/LBP]
//threeyearsago = (close[2*Period] - close[2*Period + Period/LBP]) / close[2*Period + Period/LBP]
//fouryearsago = (close[3*Period] - close[3*Period + Period/LBP]) / close[3*Period + Period/LBP]

//cum = (lastyear+twoyearsago+threeyearsago+fouryearsago)/4

//smacum = sma(cum, Smoothing)

scolor = lastyear >= 0 ? green : red

hline(0)
plot(lastyear*10, color=scolor, offset = 0, style=columns)