LastBattle

Single Timeframe Moving Average

Provides Moving average of 200 and 50 at the specific timeframe regardless of what interval you're looking at.
Saving the need to change it manually each time you switch the interval.

In this chart, I am looking at 4H interval with EMA of 50/200 of daily timeframe.

オープンソーススクリプト

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

免責事項

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

チャートでこのスクリプトを利用したいですか?
study(title="Single Timeframe Moving Average", shorttitle="Single TF MA", overlay=true)

len_sma_long = input(200, minval=1, title="Long Simple Moving Average")
len_sma_short = input(50, minval=1, title="Short Simple Moving Average")
resCustom = input(title="Time interval (W, D, [min])", type=string, defval="D")

sma_long = security(tickerid, resCustom, sma(close, len_sma_long))
sma_short = security(tickerid, resCustom, sma(close, len_sma_short))
src = security(tickerid, resCustom, close)

s2 = cross(sma_long, sma_short) ? src : na
plot(sma_long, color=green)
plot(sma_short, color=red)

plotshape(cross(sma_long, sma_short) ? sma_long  : na, style=shape.xcross, text="ALERT")