The problem is i struggle with implementing that the middleman's h1 value is a criteria for drawing a shape in the indicator window
it does not accept the part with Trendbig (H1 value of middleman), but idk why it doesn't work, it should be the right function
Anyone knows an answer or correction so that it works?
indicator(My script
, overlay = false, timeframe="", timeframe_gaps=true)
rsiPeriod = input.int(13, minval = 1, title = RSI Period
)
bandLength = input.int(34, minval = 1, title = Band Length
)
lengthrsipl = input.int(7, minval = 0, title = Fast MA on RSI
)
lengthtradesl = input.int(2, minval = 1, title = Slow MA on RSI
)
Rules = input.int(1,minval=1,maxval = 3, title =Einstiege
)
src1 = close // Source of Calculations (Close of Bar)
rsiValue = ta.rsi(src1, rsiPeriod) // RSI of Close
ma = ta.sma(rsiValue, bandLength) // Moving Average of RSI [current]
offs = (1.618 * ta.stdev(rsiValue, bandLength)) // Offset
up = ma + offs // Upper Bands
dn = ma - offs // Lower Bands
middleman = (up + dn) / 2
middlemanValue = middleman
middlemanValue2 = (up + dn) / 2 // Average of Upper and Lower Bands
green = ta.sma(rsiValue, lengthrsipl) // Moving Average of RSI 2 bars back
red = ta.sma(rsiValue, lengthtradesl) // Moving Average of RSI 7 bars back
hline1 = hline(32, 'lower', color=color.white, linewidth=1, linestyle=hline.style_dashed)
hline2 = hline(50, 'middle', color=color.white, linewidth=1, linestyle=hline.style_dashed)
hline3 = hline(68, 'upper', color=color.white, linewidth=1, linestyle=hline.style_dashed)
//Trendtimeframe H1 or M15
Trendtimeframe = input.int(1, minval = 1, maxval = 2 , title = Trendtimeframe
)
sym = input.symbol('')
Trendtf =str.tostring(Trendtimeframe)
Trendbig = request.security(syminfo.ticker,60
, middleman)
Trendlittle = request.security(syminfo.tickerid,15
,middleman)
// Plot
plot(up, color=color.blue, title=VB Channel High
,linewidth=2)
plot(dn, color=color.blue,title=VB Channel Low
,linewidth=2)
plot(middleman, color =color.orange, linewidth=2, title=Middleman
)
plot(green, color =color.lime, linewidth=2,title = Green line
)
plot(red, color =color.red, linewidth=2, title = Red line
)
//buy or sell
Long1 = ta.crossover(green,red) and (middleman<50) and (Trendbig>50)
Long2 = ta.crossover(green,red) and (middleman>50) and (Trendbig>50)
Short1 =ta.crossunder(green,red) and (middleman<50) and (Trendbig<50)
Short2 =ta.crossunder(green,red) and (middleman>50) and (Trendbig<50)
plotshape(series = Long1, style=shape.circle, location=location.bottom, color=color.new(color.green,0), size=size.tiny )
plotshape(series = Long2, style=shape.circle, location=location.bottom, color=color.new(color.green,0), size=size.tiny )
plotshape(series = Short1, style=shape.circle, location=location.top, color=color.new(color.red,0), size=size.tiny)
plotshape(series = Short2, style=shape.circle, location=location.top, color=color.new(color.red,0), size=size.tiny)