Pine Scriptの勉強をしているとStrategyの中にinputってよくでてくるよね。
でもマニュアルの説明みてもいまいちよく分からないんだ。
何時間か調べた結果(遅)たぶんこういうことだと思うので参考にしてくれるとうれしいよ。
以下はデフォルトで公開されているのChannelBreakOutStrategyだよ。
//@version=3
strategy(“ChannelBreakOutStrategy”, overlay=true)
length = input(title=”Length”, type=integer, minval=1, maxval=1000, defval=5)
upBound = highest(high, length)
downBound = lowest(low, length):
if (not na(close[length]))
strategy.entry(“ChBrkLE”, strategy.long, stop=upBound + syminfo.mintick, comment=”ChBrkLE”)
strategy.entry(“ChBrkSE”, strategy.short, stop=downBound – syminfo.mintick, comment=”ChBrkSE”)
//plot(strategy.equity, title=”equity”, color=red, linewidth=2, style=areabr)
「チャートに追加」すると、当然追加されるんだけど、設定マーク(歯車)を押すと、inputで指定している変数が変更できるよ。

表示されるダイアログに好きな数字をいれて実行できるよ。

分からないことがあったら教えてね。