
トレビューインジ【Rosoku_HighLow_Line】
なんとなく作ってみたんだけど、せっかく作ったんでシェアします。
2つの時間足の最高値、最安値から自動でラインを引くインジです。
発想としては1時間足でハラミ足になった時に、
下位足でわかりやすいかなー?って思ったんで。
重ねてるローソク足は【HTF Candles by Prosum Solutions】というインジ。
トレビューのインジんトコで【HTF Candles】とググれば出てきます。


//@version=5
indicator("Rosoku_HighLow_Line by YMP", overlay=true)
// Input Parameters for current and previous bar
colorHighLineCurrent = input.color(color.blue, "Current High Line Color")
colorLowLineCurrent = input.color(color.blue, "Current Low Line Color")
colorHighLinePrev = input.color(color.red, "Previous High Line Color")
colorLowLinePrev = input.color(color.red, "Previous Low Line Color")
lineWidthCurrent = input.int(1, "Current Line Width") // Line width for current timeframe
lineWidthPrev = input.int(2, "Previous Line Width") // Line width for previous timeframe
lineLengthCurrent = input.int(10, "Current Line Length") // Line length for current timeframe
lineLengthPrev = input.int(20, "Previous Line Length") // Line length for previous timeframe
timeframeCurrent = input.timeframe("60", "Current Timeframe") // Customizable timeframe for current bar
timeframePrev = input.timeframe("240", "Previous Timeframe") // Customizable timeframe for previous bar
// Get the high and low values for the selected timeframes
[timeframeHighCurrent, timeframeLowCurrent] = request.security(syminfo.tickerid, timeframeCurrent, [high[1], low[1]]) // Using high[1] and low[1] for previous bar
[timeframeHighPrev, timeframeLowPrev] = request.security(syminfo.tickerid, timeframePrev, [high[1], low[1]]) // Using high[1] and low[1] for previous bar
// Variables to store line references
var line highLineCurrent = na
var line lowLineCurrent = na
var line highLinePrev = na
var line lowLinePrev = na
// Delete previous lines if they exist
if not na(highLineCurrent)
line.delete(highLineCurrent)
if not na(lowLineCurrent)
line.delete(lowLineCurrent)
if not na(highLinePrev)
line.delete(highLinePrev)
if not na(lowLinePrev)
line.delete(lowLinePrev)
// Draw new lines for the previous bar (1 bar ago) from the selected timeframe's high and low
highLineCurrent := line.new(x1=bar_index - 1, y1=timeframeHighCurrent, x2=bar_index - 1 + lineLengthCurrent, y2=timeframeHighCurrent, width=lineWidthCurrent, color=colorHighLineCurrent)
lowLineCurrent := line.new(x1=bar_index - 1, y1=timeframeLowCurrent, x2=bar_index - 1 + lineLengthCurrent, y2=timeframeLowCurrent, width=lineWidthCurrent, color=colorLowLineCurrent)
highLinePrev := line.new(x1=bar_index - 1, y1=timeframeHighPrev, x2=bar_index - 1 + lineLengthPrev, y2=timeframeHighPrev, width=lineWidthPrev, color=colorHighLinePrev)
lowLinePrev := line.new(x1=bar_index - 1, y1=timeframeLowPrev, x2=bar_index - 1 + lineLengthPrev, y2=timeframeLowPrev, width=lineWidthPrev, color=colorLowLinePrev)
なんか使い道あったら、使って下さいねー。
今回の記事が良かったと思ったら、
お気持ち購入¥500。
ここから先は
¥ 500
この記事が気に入ったらチップで応援してみませんか?