Python Code
Python Code
//Tralling Step
atr2 = ta.atr(100) / 2
dev = channelDeviation * atr2
highPrice1 = high[math.abs(ta.highestbars(amplitude))]
lowPrice1 = low[math.abs(ta.lowestbars(amplitude))]
highma = ta.sma(high, amplitude)
lowma = ta.sma(low, amplitude)
if nextTrend == 1
maxLowPrice := math.max(lowPrice1, maxLowPrice)
if trend == 0
lineTpSl(cond, y, color, style) =>
line lineTpSl = enableTpSlAreas and cond ? line.new(bar_index - (trigger ?
countBull : countBear), y, bar_index + 1, y, xloc.bar_index, extend.none, color,
style) : na
line.delete(lineTpSl[1])
lineTpSl(none, entry_y, color.orange, line.style_dashed)
lineTpSl(none, stop_y , color.red , line.style_solid )
lineTpSl(useTP1 and multTP1 != 0, tp1_y, color.green, line.style_dotted)
lineTpSl(useTP2 and multTP2 != 0, tp2_y, color.green, line.style_dotted)
lineTpSl(useTP3 and multTP3 != 0, tp3_y, color.green, line.style_dotted)
// Reversal Signals
enableReversal = true
ReversalInputs = 25//input.int(14, minval=1, title="Reversals Sensitivity",
group="Reversal Settings")
overbought = 75//input(75, 'Reversal Down Level', group='Reversal Settings')
oversold = 25//input(25, 'Reversal Up Level', group='Reversal Settings')
//Channel Breakouts
bars = 3//input(3)
checkbox = true//input.bool(title= "color chenging by trend", defval=true)
//INIT VARIABLES
var int ph_uptrend_flag = 0
var float ph_valid1 = 0
var float ph_valid2 = 0
var float ph_valid3 = 0
var float ph_valid4 = 0
var float ph_valid5 = 0S