Chinga
Chinga
Chinga
// 3560 $
// Signal Partabe golabi Ver teta 110
// Copyright Mosaver
// Email : 3drahimi@gmail.com
// 110 نسخه آزمایشی تتا
// Director : Mosaver_graphic
//@version=5
indicator('Chinga Burkulit', overlay=true, max_lines_count=500,
max_labels_count=500, overlay=true, max_bars_back=5000)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
i_hi = input.string('high' , title= '' , group='source
[high - low]', inline='hl', options=['high', 'close', 'max open/close'])
i_lo = input.string('low' , title= '' , group='source
[high - low]', inline='hl', options=['low' , 'close', 'min open/close'])
//-----------------------------------------------------------------------------}
//User Defined Types
//-----------------------------------------------------------------------------{
type ZZ
int [] d
int [] x
float[] y
line [] l
type Ewave
line l1
line l2
line l3
line l4
line l5
label b1
label b2
label b3
label b4
label b5
//
bool on
bool br //= na
//
int dir
//
line lA
line lB
line lC
label bA
label bB
label bC
//
bool next = false
//
label lb
box bx
type fibL
line wave1_0_500
line wave1_0_618
line wave1_0_764
line wave1_0_854
line wave1_pole_
linefill l_fill_
bool breaks //= na
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
hi = i_hi == 'high' ? high : i_hi == 'close' ? close : math.max(open, close)
lo = i_lo == 'low' ? low : i_hi == 'close' ? close : math.min(open, close)
in_out(aZZ, d, x1, y1, x2, y2, col) =>
aZZ.d.unshift(d), aZZ.x.unshift(x2), aZZ.y.unshift(y2), aZZ.d.pop(),
aZZ.x.pop(), aZZ.y.pop()
if shZZ
aZZ.l.unshift(line.new(x1, y1, x2, y2, color= col)), aZZ.l.pop().delete()
method set(fibL nFibL, int x1, int x2, float max_500, float max_618, float max_764,
float max_854, float y2) =>
nFibL.wave1_0_500.set_xy1(x1, max_500)
nFibL.wave1_0_500.set_xy2(x2, max_500)
nFibL.wave1_0_618.set_xy1(x1, max_618)
nFibL.wave1_0_618.set_xy2(x2, max_618)
nFibL.wave1_0_764.set_xy1(x1, max_764)
nFibL.wave1_0_764.set_xy2(x2, max_764)
nFibL.wave1_0_854.set_xy1(x1, max_854)
nFibL.wave1_0_854.set_xy2(x2, max_854)
nFibL.wave1_pole_.set_xy1(x1, y2 )
nFibL.wave1_pole_.set_xy2(x1, max_854)
nFibL.l_fill_.get_line1().set_xy1(x1, max_764)
nFibL.l_fill_.get_line1().set_xy2(x2, max_764)
nFibL.l_fill_.get_line2().set_xy1(x1, max_854)
nFibL.l_fill_.get_line2().set_xy2(x2, max_854)
if aEW.size() > 15
pop = aEW.pop()
pop.l1.delete(), pop.b1.delete()
pop.l2.delete(), pop.b2.delete()
pop.l3.delete(), pop.b3.delete()
pop.l4.delete(), pop.b4.delete()
pop.l5.delete(), pop.b5.delete()
pop.lA.delete(), pop.bA.delete()
pop.lB.delete(), pop.bB.delete()
pop.lC.delete(), pop.bC.delete()
pop.lb.delete(), pop.bx.delete()
//----------------------------------
//-----------------------------------------------------------------------------}
//Plots
//-----------------------------------------------------------------------------{
draw(s1, len1, col1, 0)
draw(s2, len2, col2, 1)
draw(s3, len3, col3, 2)
//-----------------------------------------------------------------------------}
leftt = input(10)
rightt = input(10)
// alerts
alertcondition(Trend == 1 and Trend[1] == -1, title='Buy Signal', message='Buy
Signal')
alertcondition(Trend == -1 and Trend[1] == 1, title='Sell Signal', message='Sell
Signal')
alertcondition(ta.change(Trend), title='Trend Changed', message='Trend Changed')
// Labels
var label labelll = na
var label labelhh = na
// Swing lines
var line line_up = na
var line line_down = na
// FUNCTIONS
obLabelText() =>
if last_actual_label_hh_price < high
'HH'
else
'LH'
//plot(last_actual_label_hh_price)
osLabelText() =>
if last_actual_label_ll_price < low
'HL'
else
'LL'
moveOverBoughtLabel() =>
label.set_x(labelhh, bar_index)
label.set_y(labelhh, high)
label.set_text(labelhh, obLabelText())
line.set_x1(line_up, bar_index)
line.set_y1(line_up, high)
// If we are oversold
if isOversold
if low <= lll
lll := low
moveOversoldLabel()
laststate := 2
laststate
//If we are oversold and the last state was oversold, move the drawings to the
lowest price
if laststate == 2 and isOversold
if low <= lll
lll := low
moveOversoldLabel()
// ©Mosaver_graphic
// 3560 $
// Signal Partabe golabi Ver teta 110
// Copyright Mosaver
// Email : 3drahimi@gmail.com
// 110 نسخه آزمایشی تتا
// Director : Mosaver_graphic