Intraday Session Table 
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © avsr90

//@version=5
/// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © avsr90


indicator("Intraday Session Table ",overlay =false,max_bars_back=5000,precision=2)

Table=input.bool(defval=true,title="Table")
Multi=input.string(defval="ROC",options=["ROC","CLOSE","RSI","MA20","MA50","MOM","CL-OP","NetB","NetV"])
To_View_individual_Charts_Check_Out_Above_Table_Check_in_Box=input.string("Check out above 'TABLE' inputCheck in Box ")
//Resolution,"RedB","Net B"
Resn1=input.timeframe(defval="D",title="Resolution")


//INTRADAY LENGTH
Cle=math.round_to_mintick(close)
Open= request.security(syminfo.tickerid ,Resn1,close[1],barmerge.gaps_off, barmerge.lookahead_on) 
opcl=math.round_to_mintick(Cle-Open)


//length from Day open 
Nifnum= ta.change(Open)
Lb=int(math.max(1, nz(ta.barssince(Nifnum)) + 1))

// Date and Timer
Named=str.tostring(dayofweek(timenow))
Named1=Named=="1" ? "SUNDAY":Named=="2" ? "MONDAY":Named=="3" ? "TUESDAY":Named=="4" ? "WEDNESDAY":
 Named=="5" ?"THURSDAY": Named=="6" ? "FRIDAY":Named=="7" ?"SATURDAY":na
Years=year(timenow)
Months=month(timenow)
Days= dayofmonth (timenow)
pr=str.tostring(hour(timenow), "00:") + str.tostring(minute(timenow), "00:") + str.tostring(second(timenow), "00") 
prd=str.tostring((Days),"00/") + str.tostring((Months),"00/") + str.tostring((Years),"0000")
prd1=str.tostring(Named1)


//Lengths
L_rsi=input(defval=14,title="L for RSI")
L_mom=input(defval=10,title="L for Mom")

Intra_bars_count() =>
    greenBars = 0.00
    redBars = 0.00
    
    for i=1 to Lb
        if  ( close[i]*volume[i]>open[i]*volume[i])
            greenBars:= greenBars+1
        if not (close[i]*volume[i] > open[i]*volume[i])
            redBars := redBars+1
    
    [greenBars,redBars] 
[greenB, redB] = Intra_bars_count()
NetB=greenB-redB


//Session


ses1 = input.session("0915-0929")
ses2 = input.session("0930-0944")
ses3 = input.session("0945-0959")
ses4 = input.session("1000-1014")
ses5 = input.session("1015-1029")
ses6 = input.session("1030-1044")
ses7 = input.session("1045-1059")
ses8 = input.session("1100-1114")
ses9 = input.session("1115-1129")
ses10 = input.session("1130-1144")
ses11 = input.session("1145-1159")
ses12 = input.session("1200-1214")
ses13 = input.session("1215-1229")
ses14 = input.session("1230-1244")
ses15 = input.session("1245-1259")
ses16 = input.session("1300-1314")
ses17 = input.session("1315-1329")
ses18 = input.session("1330-1344")
ses19 = input.session("1345-1359")
ses20 = input.session("1400-1414")
ses21 = input.session("1415-1429")
ses22 = input.session("1430-1444")
ses23 = input.session("1445-1459")
ses24 = input.session("1500-1514")
ses25 = input.session("1515-1529")
ses26 = input.session("1530-1544")
ses27 = input.session("1545-1559")
ses28 = input.session("1600-1614")
ses29 = input.session("1615-1629")
ses30 = input.session("1630-1644")
ses31 = input.session("1645-1659")
ses32 = input.session("1700-1714")


IsLastBarSession(sessionTime, sessionTimeZone=syminfo.timezone) =>
    var int lastBarHour   = na
    var int lastBarMinute = na
    var int lastBarSecond = na
    inSess = not na(time(timeframe.period, sessionTime, sessionTimeZone))

    if not inSess and inSess[1]
        lastBarHour   := hour[1]
        lastBarMinute := minute[1]
        lastBarSecond := second[1]
    
    hour == lastBarHour and minute == lastBarMinute and second == lastBarSecond

//New Day
t1 = ta.change(time("D","0915-1630",syminfo.timezone))  

var float o1 = 0
if IsLastBarSession(ses1, sessionTimeZone=syminfo.timezone) 
    o1:= opcl
var float o2 = 0
if t1
    o2:=0
if IsLastBarSession(ses2, sessionTimeZone=syminfo.timezone) 
    o2:= opcl
var float o3 = 0
if t1
    o3:=0
if IsLastBarSession(ses3, sessionTimeZone=syminfo.timezone) 
    o3:= opcl
var float o4 = 0
if t1
    o4:=0
if IsLastBarSession(ses4, sessionTimeZone=syminfo.timezone) 
    o4:= opcl
var float o5 = 0
if t1
    o5:=0
if IsLastBarSession(ses5, sessionTimeZone=syminfo.timezone) 
    o5:= opcl
var float o6 = 0
if t1
    o6:=0
if IsLastBarSession(ses6, sessionTimeZone=syminfo.timezone) 
    o6:= opcl
var float o7 = 0
if t1
    o7:=0
if IsLastBarSession(ses7, sessionTimeZone=syminfo.timezone) 
    o7:= opcl
var float o8 = 0
if t1
    o8:=0
if IsLastBarSession(ses8, sessionTimeZone=syminfo.timezone) 
    o8:= opcl
var float o9 = 0
if t1
    o9:=0
if IsLastBarSession(ses9, sessionTimeZone=syminfo.timezone) 
    o9:= opcl
var float o10 = 0
if t1
    o10:=0
if IsLastBarSession(ses10, sessionTimeZone=syminfo.timezone) 
    o10:= opcl
var float o11 = 0
if t1
    o11:=0
if IsLastBarSession(ses11, sessionTimeZone=syminfo.timezone) 
    o11:= opcl
var float o12 = 0
if t1
    o12:=0
if IsLastBarSession(ses12, sessionTimeZone=syminfo.timezone) 
    o12:= opcl
var float o13 = 0
if t1
    o13:=0
if IsLastBarSession(ses13, sessionTimeZone=syminfo.timezone) 
    o13:= opcl
var float o14 = 0
if IsLastBarSession(ses14, sessionTimeZone=syminfo.timezone) 
    o14:= opcl
if t1
    o14:=0
var float o15 = 0
if t1
    o15:=0
if IsLastBarSession(ses15, sessionTimeZone=syminfo.timezone) 
    o15:= opcl  
var float o16 = 0
if t1
    o16:= 0  
if IsLastBarSession(ses16, sessionTimeZone=syminfo.timezone) 
    o16:= opcl
var float o17 = 0
float o17a=0
if t1
    o17:=0
if IsLastBarSession(ses17, sessionTimeZone=syminfo.timezone) 
    o17:= opcl
var float o18 = 0
if t1
    o18:=0
if IsLastBarSession(ses18, sessionTimeZone=syminfo.timezone) 
    o18:= opcl
var float o19 = 0
if t1
    o19:=0
if IsLastBarSession(ses19, sessionTimeZone=syminfo.timezone) 
    o19:= opcl
var float o20 = 0
if t1
    o20:=0
if IsLastBarSession(ses20, sessionTimeZone=syminfo.timezone) 
    o20:= opcl
var float o21 = 0
if t1
    o21:=0
if IsLastBarSession(ses21, sessionTimeZone=syminfo.timezone) 
    o21:= opcl
var float o22 = 0
if t1
    o22:=0
if IsLastBarSession(ses22, sessionTimeZone=syminfo.timezone) 
    o22:= opcl
var float o23 = 0
if t1
    o23:=0
if IsLastBarSession(ses23, sessionTimeZone=syminfo.timezone) 
    o23:= opcl
var float o24=0
if t1
    o24:=0
if IsLastBarSession(ses24, sessionTimeZone=syminfo.timezone) 
    o24:= opcl
var float o25 = 0
if t1
    o25:=0
if IsLastBarSession(ses25, sessionTimeZone=syminfo.timezone) 
    o25:= opcl
var float o26 = 0
if t1
    o26:=0
if IsLastBarSession(ses26, sessionTimeZone=syminfo.timezone) 
    o26:= opcl
var float o27 = 0
if t1
    o27:=0
if IsLastBarSession(ses27, sessionTimeZone=syminfo.timezone) 
    o27:= opcl
var float o28 = 0
if t1
    o28:=0
if IsLastBarSession(ses28, sessionTimeZone=syminfo.timezone) 
    o28:= opcl
var float o29 = 0
if t1
    o29:=0
if IsLastBarSession(ses29, sessionTimeZone=syminfo.timezone) 
    o29:= opcl
var float o30 = 0
if t1
    o30:=0
if IsLastBarSession(ses30, sessionTimeZone=syminfo.timezone) 
    o30:= opcl
var float o31 = 0
if t1
    o31:=0
if IsLastBarSession(ses31, sessionTimeZone=syminfo.timezone) 
    o31:= opcl
var float o32=0
if t1
    o32:=0
if IsLastBarSession(ses32, sessionTimeZone=syminfo.timezone) 
    o32:= opcl


//Increase/Decrease in OP-Cl
var float v1 = 0
if IsLastBarSession(ses1,sessionTimeZone=syminfo.timezone) 
    v1 := 0
var float v2 = 0
if IsLastBarSession(ses2,sessionTimeZone=syminfo.timezone) and ( o2>o1)
    v2:=o2-o1
if IsLastBarSession(ses2,sessionTimeZone=syminfo.timezone) and ( o2<o1)
    v2 := o1-o2
if t1
    v2:=0
var float v3 = 0
if IsLastBarSession(ses3,sessionTimeZone=syminfo.timezone) and ( o3>o2)
    v3:=o3-o2
if IsLastBarSession(ses3,sessionTimeZone=syminfo.timezone) and ( o3<o2)
    v3 := o2-o3
if t1
    v3:=0
var float v4 = 0
if IsLastBarSession(ses4,sessionTimeZone=syminfo.timezone) and ( o4>o3)
    v4:=o4-o3
if IsLastBarSession(ses4,sessionTimeZone=syminfo.timezone) and ( o4<o3)
    v4 := o3-o4
if t1
    v4:=0
var float v5 = 0
if IsLastBarSession(ses5,sessionTimeZone=syminfo.timezone) and ( o5>o4)
    v5:=o5-o4
if IsLastBarSession(ses5,sessionTimeZone=syminfo.timezone) and ( o5<o4)
    v5 := o4-o5
if t1
    v5:=0
var float v6 = 0
if IsLastBarSession(ses6,sessionTimeZone=syminfo.timezone) and ( o6>o5)
    v6:=o6-o5
if IsLastBarSession(ses6,sessionTimeZone=syminfo.timezone) and ( o6<o5)
    v6 := o5-o6
if t1
    v6:=0
var float v7 = 0
if IsLastBarSession(ses7,sessionTimeZone=syminfo.timezone) and ( o7>o6)
    v7:=o7-o6
if IsLastBarSession(ses7,sessionTimeZone=syminfo.timezone) and ( o7<o6)
    v7 := o6-o7
if t1
    v7:=0
var float v8 = 0
if IsLastBarSession(ses8,sessionTimeZone=syminfo.timezone) and ( o8>o7)
    v8:=o8-o7
if IsLastBarSession(ses8,sessionTimeZone=syminfo.timezone) and ( o8<o7)
    v8 := o7-o8
if t1
    v8:=0
var float v9 = 0
if IsLastBarSession(ses9,sessionTimeZone=syminfo.timezone) and ( o9>o8)
    v9:=o9-o8
if IsLastBarSession(ses9,sessionTimeZone=syminfo.timezone) and ( o9<o8)
    v9 := o8-o9
if t1
    v9:=0
var float v10 = 0
if IsLastBarSession(ses10,sessionTimeZone=syminfo.timezone) and ( o10>o9)
    v10:=o10-o9
if IsLastBarSession(ses10,sessionTimeZone=syminfo.timezone) and ( o10<o9)
    v10 := o9-o10
if t1
    v10:=0
var float v11 = 0
if IsLastBarSession(ses11,sessionTimeZone=syminfo.timezone) and ( o11>o10)
    v11:=o11-o10
if IsLastBarSession(ses11,sessionTimeZone=syminfo.timezone) and ( o11<o10)
    v11 := o10-o11
if t1
    v11:=0
var float v12 = 0
if IsLastBarSession(ses12,sessionTimeZone=syminfo.timezone) and ( o12>o11)
    v12:=o12-o11
if IsLastBarSession(ses12,sessionTimeZone=syminfo.timezone) and ( o12<o11)
    v12 := o11-o12
if t1
    v12:=0
var float v13 = 0
if IsLastBarSession(ses13,sessionTimeZone=syminfo.timezone) and ( o13>o12)
    v13:=o13-o12
if IsLastBarSession(ses13,sessionTimeZone=syminfo.timezone) and ( o13<o12)
    v13 := o12-o13
if t1
    v13:=0
var float v14 = 0
if IsLastBarSession(ses14,sessionTimeZone=syminfo.timezone) and ( o14>o13)
    v14:=o14-o13
if IsLastBarSession(ses14,sessionTimeZone=syminfo.timezone) and ( o14<o13)
    v14 := o13-o14
if t1
    v14:=0
var float v15 = 0
if IsLastBarSession(ses15,sessionTimeZone=syminfo.timezone) and ( o15>o14)
    v15:=o15-o14
if IsLastBarSession(ses15,sessionTimeZone=syminfo.timezone) and ( o15<o14)
    v15 := o14-o15
if t1
    v15:=0
var float v16 = 0
if IsLastBarSession(ses16,sessionTimeZone=syminfo.timezone) and ( o16>o15)
    v16:=o16-o15
if IsLastBarSession(ses16,sessionTimeZone=syminfo.timezone) and ( o16<o15)
    v16 := o15-o16
if t1
    v16:=0
var float v17 = 0
if IsLastBarSession(ses17,sessionTimeZone=syminfo.timezone) and ( o17>o16)
    v17:=o17-o16
if IsLastBarSession(ses17,sessionTimeZone=syminfo.timezone) and ( o17<o16)
    v17 := o16-o17
if t1
    v17:=0
var float v18 = 0
if IsLastBarSession(ses18,sessionTimeZone=syminfo.timezone) and ( o18>o17)
    v18:=o18-o17
if IsLastBarSession(ses18,sessionTimeZone=syminfo.timezone) and ( o18<o17)
    v18 := o17-o18
if t1
    v18:=0
var float v19 = 0
if IsLastBarSession(ses19,sessionTimeZone=syminfo.timezone) and ( o19>o18)
    v19:=o19-o18
if IsLastBarSession(ses19,sessionTimeZone=syminfo.timezone) and ( o19<o18)
    v19 := o18-o19
if t1
    v19:=0
var float v20 = 0
if IsLastBarSession(ses20,sessionTimeZone=syminfo.timezone) and ( o20>o19)
    v20:=o20-o19
if IsLastBarSession(ses20,sessionTimeZone=syminfo.timezone) and ( o20<o19)
    v20 := o19-o20
if t1
    v20:=0
var float v21 = 0
if IsLastBarSession(ses21,sessionTimeZone=syminfo.timezone) and ( o21>o20)
    v21:=o21-o20
if IsLastBarSession(ses21,sessionTimeZone=syminfo.timezone) and ( o21<o20)
    v21 := o20-o21
if t1
    v21:=0
var float v22 = 0
if IsLastBarSession(ses22,sessionTimeZone=syminfo.timezone) and ( o22>o21)
    v22:=o22-o21
if IsLastBarSession(ses22,sessionTimeZone=syminfo.timezone) and ( o22<o21)
    v22 := o21-o22
if t1
    v22:=0
var float v23 = 0
if IsLastBarSession(ses23,sessionTimeZone=syminfo.timezone) and ( o23>o22)
    v23:=o23-o22
if IsLastBarSession(ses23,sessionTimeZone=syminfo.timezone) and ( o23<o22)
    v23 := o22-o23
if t1
    v23:=0
var float v24 = 0
if IsLastBarSession(ses24,sessionTimeZone=syminfo.timezone) and ( o24>o23)
    v24:=o24-o23
if IsLastBarSession(ses24,sessionTimeZone=syminfo.timezone) and ( o24<o23)
    v24 := o23-o24
if t1
    v24:=0
var float v25 = 0
if IsLastBarSession(ses25,sessionTimeZone=syminfo.timezone) and ( o25>o24)
    v25:=o25-o24
if IsLastBarSession(ses25,sessionTimeZone=syminfo.timezone) and ( o25<o24)
    v25 := o24-o25
if t1
    v25:=0
var float v26 = 0
if IsLastBarSession(ses26,sessionTimeZone=syminfo.timezone) and ( o26>o25)
    v26:=o26-o25
if IsLastBarSession(ses26,sessionTimeZone=syminfo.timezone) and ( o26<o25)
    v26 := o25-o26
if t1
    v26:=0
var float v27 = 0
if IsLastBarSession(ses27,sessionTimeZone=syminfo.timezone) and ( o27>o26)
    v27:=o27-o26
if IsLastBarSession(ses27,sessionTimeZone=syminfo.timezone) and ( o27<o26)
    v27 := o26-o27
if t1
    v27:=0
var float v28 = 0
if IsLastBarSession(ses28,sessionTimeZone=syminfo.timezone) and ( o28>o27)
    v28:=o28-o27
if IsLastBarSession(ses28,sessionTimeZone=syminfo.timezone) and (o28<o27)
    v28 := o27-o28
if t1
    v28:=0
var float v29 = 0
if IsLastBarSession(ses29,sessionTimeZone=syminfo.timezone) and ( o29>o28)
    v29:=o29-o28
if IsLastBarSession(ses29,sessionTimeZone=syminfo.timezone) and ( o29<o28)
    v29 := o28-o29
if t1
    v29:=0
var float v30 = 0
if IsLastBarSession(ses30,sessionTimeZone=syminfo.timezone) and ( o30>o29)
    v30:=o30-o29
if IsLastBarSession(ses30,sessionTimeZone=syminfo.timezone) and ( o30<o29)
    v30 := o29-o30
if t1
    v30:=0
var float v31 = 0
if IsLastBarSession(ses31,sessionTimeZone=syminfo.timezone) and ( o31>o30)
    v31:=o31-o30
if IsLastBarSession(ses31,sessionTimeZone=syminfo.timezone) and ( o31<o30)
    v31 := o30-o31
if t1
    v31:=0
var float v32 = 0
if IsLastBarSession(ses32,sessionTimeZone=syminfo.timezone) and ( o32>o31)
    v32:=o32-o31
if IsLastBarSession(ses32,sessionTimeZone=syminfo.timezone) and ( o32<o31)
    v32 := o31-o32
if t1
    v32:=0

//Sum Increase/Decrease in Op-Cl

v1a=0
v2a=o2<o1?v2*-1:v2
v3a=o3<o2?v3*-1:v3
v4a=o4<o3?v4*-1:v4
v5a=o5<o4?v5*-1:v5
v6a=o6<o5?v6*-1:v6
v7a=o7<o6?v7*-1:v7
v8a=o8<o7?v8*-1:v8
v9a=o9<o8?v9*-1:v9
v10a=o10<o9?v10*-1:v10
v11a=o11<o10?v11*-1:v11
v12a=o12<o11?v12*-1:v12
v13a=o13<o12?v13*-1:v13
v14a=o14<o13?v14*-1:v14
v15a=o15<o14?v15*-1:v15
v16a=o16<o15?v16*-1:v16
v17a=o17<o16?v17*-1:v17
v18a=o18<o17?v18*-1:v18
v19a=o19<o18?v19*-1:v19
v20a=o20<o19?v20*-1:v20
v21a=o21<o20?v21*-1:v21
v22a=o22<o21?v22*-1:v22
v23a=o23<o22?v23*-1:v23
v24a=o24<o23?v24*-1:v24
v25a=o25<o24?v25*-1:v25
v26a=o26<o25?v26*-1:v26
v27a=o27<o26?v27*-1:v27
v28a=o28<o27?v28*-1:v28

Sumv=o1+v1a+v2a+v3a+v4a+v5a+v6a+v7a+v8a+v9a+v10a+v11a+v12a+v13a+v14a+v15a+v16a+v17a+v18a+v19a+v20a+v21a+v22a+v23a+v24a+v25a+v26a+v27a+v28a
Rocp=math.round_to_mintick(ta.roc(close,Lb))
MA20p=math.round_to_mintick(ta.sma(close,20))
MA50p=math.round_to_mintick(ta.sma(close,50))
Momp=math.round_to_mintick(ta.mom(close,L_mom))
Rsip=math.round_to_mintick(ta.mom(close,L_rsi))
Closep=math.round_to_mintick(close)

Buyvol=  (high==low)? 0: volume*(close-low)/(high-low)
Sellvol = (high==low) ? 0: volume*(high-close)/(high-low)
Netvol= (Buyvol-Sellvol)
Buyvol_Intra=math.sum(Buyvol,Lb)
Sellvol_Intra=math.sum(Sellvol,Lb)
Netvol_Intra=Buyvol_Intra-Sellvol_Intra

 

//Calculations nof ROC,MA20,MA50,CLOSE,RSI,Op-CL

rr15=Multi=="ROC" ? math.round_to_mintick(ta.roc(close,Lb)):Multi=="MA20" ? math.round_to_mintick(ta.sma(close,20)):Multi=="RSI" ? math.round_to_mintick(ta.rsi(close,L_rsi)):
  Multi=="CLOSE" ? math.round_to_mintick(close):Multi=="MOM" ? math.round_to_mintick(ta.mom(close,L_mom)):Multi=="MA50" ? math.round_to_mintick(ta.sma(close,50)):
  Multi=="CL-OP" ? Sumv:Multi=="NetB" ? NetB:Multi=="NetV" ? math.round_to_mintick(Netvol_Intra/1000000):na


//Header Change 
change=Multi=="ROC" ? "ROC":Multi=="RSI" ?"RSI":Multi=="MA20" ?"MA20":Multi=="CLOSE" ?"CLOSE":Multi=="MA50" ?"MA50":Multi=="MOM" ?"MOM":Multi=="CL-OP"?
 "CL-OP":Multi=="NetB" ? "NetB":Multi=="NetV"?"NetV(M)":na
colmulti=Multi=="ROC" ?color.rgb(8, 100, 56):Multi=="RSI" ? color.rgb(86, 35, 95):Multi=="MA20" ? color.navy:Multi=="CLOSE" ? color.rgb(51, 86, 114):
 Multi=="MOM"  ? color.rgb(124, 71, 99): Multi=="MA50" ?color.rgb(49, 39, 94):Multi=="CL-OP"?color.rgb(124, 71, 99):Multi=="NetB"?color.navy:
 Multi=="NetV"?color.navy: na
 

//Plots 
plot(Sumv,title="Cl-OP ses wise Plot",color=Sumv>Sumv[1] ? color.green:color.red,display=not Table and Multi=="CL-OP" ? display.all:display.none)
plot(Rocp,title="ROC Plot",color=Rocp>0 ? color.green:color.red,display=not Table and Multi=="ROC"? display.all:display.none)
plot(MA20p,title="MA 20 Plot",color=color.orange,display=not Table and Multi=="MA20"? display.all:display.none)
plot(MA50p,title="MA50 Plot ",color=color.red,display=not Table and Multi=="MA50"? display.all:display.none)
plot(Momp,title="MOM plot",color=Momp>0 ? color.green:color.red,display=not Table and Multi=="MOM"? display.all:display.none)
plot(Rsip,title="RSI Plot",color=color.blue,display=not Table and Multi=="RSI"? display.all:display.none)
plot(Closep,title="ClosePlot",color=close>close[1]? color.green:color.red,display=not Table and Multi=="CLOSE"? display.all:display.none)
plot(math.round_to_mintick(Netvol_Intra/1000000),title="NetVol_Intra(M)", color=Netvol_Intra>0 ?color.green:color.red,display=not Table and Multi=="NetV"? display.all:display.none)
plot(NetB,title="Green Bars - Red Bars", color=Netvol_Intra>0 ?color.green:color.red,display=not Table and Multi=="NetB"? display.all:display.none)


//ROC,MA20,MA50,CLOSE,RSI
var float don1 = 0
if IsLastBarSession(ses1, sessionTimeZone=syminfo.timezone)
    don1 :=math.round_to_mintick(rr15)
if t1
    don1:=0
var float don2=0
if IsLastBarSession(ses2, sessionTimeZone=syminfo.timezone) 
    don2 := math.round_to_mintick(rr15)
if t1
    don2:=0
var float don3 = 0
if IsLastBarSession(ses3, sessionTimeZone=syminfo.timezone)
    don3 :=math.round_to_mintick(rr15)
if t1
    don3:=0
var float don4 = 0
if IsLastBarSession(ses4, sessionTimeZone=syminfo.timezone)
    don4 := math.round_to_mintick(rr15)
if t1
    don4:=0
var float don5 = 0
if IsLastBarSession(ses5, sessionTimeZone=syminfo.timezone)
    don5 := math.round_to_mintick(rr15)
if t1
    don5:=0
var float don6 = 0
if IsLastBarSession(ses6, sessionTimeZone=syminfo.timezone)
    don6 := math.round_to_mintick(rr15)
if t1
    don6:=0
var float don7 = 0
if IsLastBarSession(ses7, sessionTimeZone=syminfo.timezone)
    don7 :=math.round_to_mintick(rr15)
if t1
    don7:=0
var float don8 = 0
if IsLastBarSession(ses8, sessionTimeZone=syminfo.timezone)
    don8 := math.round_to_mintick(rr15)
if t1
    don8:=0
var float don9 = 0
if IsLastBarSession(ses9, sessionTimeZone=syminfo.timezone)
    don9 := math.round_to_mintick(rr15)
if t1
    don9:=0
var float don10 = 0
if IsLastBarSession(ses10, sessionTimeZone=syminfo.timezone)
    don10 := math.round_to_mintick(rr15)
if t1
    don10:=0
var float don11 = 0
if IsLastBarSession(ses11, sessionTimeZone=syminfo.timezone)
    don11 := math.round_to_mintick(rr15)
if t1
    don11:=0
var float don12 = 0
if IsLastBarSession(ses12, sessionTimeZone=syminfo.timezone)
    don12 := math.round_to_mintick(rr15)
if t1
    don12:=0
var float don13 = 0
if IsLastBarSession(ses13, sessionTimeZone=syminfo.timezone)
    don13 := math.round_to_mintick(rr15)
if t1
    don13:=0
var float don14 = 0
if IsLastBarSession(ses14, sessionTimeZone=syminfo.timezone)
    don14 := math.round_to_mintick(rr15)
if t1
    don14:=0
var float don15 = 0
if IsLastBarSession(ses15, sessionTimeZone=syminfo.timezone)
    don15 := math.round_to_mintick(rr15)
if t1
    don15:=0
var float don16 = 0
if IsLastBarSession(ses16, sessionTimeZone=syminfo.timezone)
    don16 := math.round_to_mintick(rr15)
if t1
    don16:=0
var float don17 = 0
if IsLastBarSession(ses17, sessionTimeZone=syminfo.timezone)
    don17 := math.round_to_mintick(rr15)
if t1
    don17:=0
var float don18 = 0
if IsLastBarSession(ses18, sessionTimeZone=syminfo.timezone)
    don18 := math.round_to_mintick(rr15)
if t1
    don18:=0
var float don19 = 0
if IsLastBarSession(ses19, sessionTimeZone=syminfo.timezone)
    don19 := math.round_to_mintick(rr15)
if t1
    don19:=0
var float don20 = 0
if IsLastBarSession(ses20, sessionTimeZone=syminfo.timezone)
    don20 := math.round_to_mintick(rr15)
if t1
    don20:=0
var float don21 = 0
if IsLastBarSession(ses21, sessionTimeZone=syminfo.timezone)
    don21 := math.round_to_mintick(rr15)
if t1
    don21:=0
var float don22 = 0
if IsLastBarSession(ses22, sessionTimeZone=syminfo.timezone)
    don22 := math.round_to_mintick(rr15)
if t1
    don22:=0
var float don23 = 0
if IsLastBarSession(ses23, sessionTimeZone=syminfo.timezone)
    don23 := math.round_to_mintick(rr15)
if t1
    don23:=0
var float don24 = 0
if IsLastBarSession(ses24, sessionTimeZone=syminfo.timezone)
    don24 := math.round_to_mintick(rr15)
if t1
    don24:=0
var float don25 = 0
if IsLastBarSession(ses25, sessionTimeZone=syminfo.timezone)
    don25 := math.round_to_mintick(rr15)
if t1
    don25:=0
var float don26 = 0
if IsLastBarSession(ses26, sessionTimeZone=syminfo.timezone)
    don26 := math.round_to_mintick(rr15)
if t1
    don26:=0
var float don27 = 0
if IsLastBarSession(ses27, sessionTimeZone=syminfo.timezone)
    don27 := math.round_to_mintick(rr15)
if t1
    don27:=0
var float don28 = 0
if IsLastBarSession(ses28, sessionTimeZone=syminfo.timezone)
    don28 := math.round_to_mintick(rr15)
if t1
    don28:=0
var float don29 = 0
if IsLastBarSession(ses29, sessionTimeZone=syminfo.timezone)
    don29 := math.round_to_mintick(rr15)
if t1
    don29:=0
var float don30 = 0
if IsLastBarSession(ses30, sessionTimeZone=syminfo.timezone)
    don30 := math.round_to_mintick(rr15)
if t1
    don30:=0
var float don31 = 0
if IsLastBarSession(ses31, sessionTimeZone=syminfo.timezone)
    don31 := math.round_to_mintick(rr15)
if t1
    don31:=0
var float don32 = 0
if IsLastBarSession(ses32, sessionTimeZone=syminfo.timezone)
    don32 := math.round_to_mintick(rr15)
if t1
    don32:=0



//TABLE

BorderThickness = 1
TableWidth = 0
Tableheight=0

TableLocation = input.string("top_left", title='Select Table Position',options=["top_left","top_center","top_right",
   "middle_left","middle_center","middle_right","bottom_left","bottom_center","bottom_right"] , 
   tooltip="Default location is at top_ left")
 //RoundingPrecision = input.int(title='Indicator Rounding Precision', defval=2, minval=0, maxval=5)
TableTextSize = input.string("Auto", title='Select Table Text Size',options=["Auto","Huge","Large","Normal","Small",
  "Tiny"] , tooltip="Default Text Size is Auto")


celltextsize = switch TableTextSize
    "Auto" => size.auto
    "Huge" => size.huge
    "Large" => size.large
    "Normal" => size.normal
    "Small" => size.small
    "Tiny" => size.tiny

TBGcol=input.color(defval=color.new(#ffffff,0),title="BG color")   
cellcol=color.new(#ffffff,0)
cellcolin=input.color(defval=color.new(#e10043,20),title="headercolor")
cellcol1=color.new(#ffffff,0)
cellcol1in=input.color(defval=color.new(#e10043,20),title="column headercolor")
ctexcol=input.color(defval=color.new(#000000,0),title="column header textcolor")

var table t = table.new (position=TableLocation,columns=30,rows= 50, bgcolor=colmulti,frame_color=color.black,frame_width=2,
 border_color=color.black,border_width=BorderThickness)

if  barstate.islast    
    if Table  
//Headers
        table.cell(t, 1, 1,str.tostring(pr)+"\n"+"TIME" ,text_size=size.normal, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,
         text_halign=text.align_left)
        table.cell(t, 2, 1,str.tostring(prd)+"\n"+"(DATE)" ,text_size=size.small, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,
         text_halign=text.align_left)
        table.cell(t, 3, 1,str.tostring(prd1)+"\n"+"(DAY)" ,text_size=size.small, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,
         text_halign=text.align_left)
        table.cell(t, 4, 1,text_size=size.normal, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,text_halign=text.align_left)
        table.cell(t, 5, 1,text_size=size.normal, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,text_halign=text.align_left)
        table.cell(t, 6, 1,"SESSION" ,text_size=size.normal, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,text_halign=text.align_left)
        table.cell(t, 7, 1,"WISE",text_size=size.normal, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,text_halign=text.align_left)
        table.cell(t, 8, 1,"MOVEMENT",text_size=size.normal, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,text_halign=text.align_left)
        table.cell(t, 9, 1,text_size=size.normal, width=TableWidth,height=Tableheight,text_color=ctexcol,bgcolor=cellcol,text_halign=text.align_left)

        table.cell(t, 1, 2,"Session",text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=ctexcol) 
        table.cell(t, 2, 2,"CL-OP",text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=ctexcol)
        table.cell(t, 3, 2,"CL-OP"+"\n"+ "Inc/Dec",text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=ctexcol)
        table.cell(t, 4, 2,str.tostring(change),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=colmulti)
         
               
        table.cell(t, 6,2,"Session",text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=ctexcol)
        table.cell(t, 7,2,"CL-OP",text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=ctexcol)
        table.cell(t, 8,2,"CL-OP"+"\n"+ "Inc/Dec",text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=ctexcol)
        table.cell(t, 9,2,str.tostring(change),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=colmulti)
      
// //Session
        table.cell(t, 1, 3, str.tostring(ses1),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,
         text_halign=text.align_right)
        table.cell(t, 1, 4, str.tostring(ses2),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,
         text_halign=text.align_right)
        table.cell(t, 1, 5, str.tostring(ses3),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,
         text_halign=text.align_right)
        table.cell(t, 1, 6, str.tostring(ses4),text_size=celltextsize, width=TableWidth,bgcolor=cellcol,text_color=color.blue,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 1, 7, str.tostring(ses5),text_size=celltextsize, width=TableWidth,bgcolor=cellcol,text_color=color.blue,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 1, 8, str.tostring(ses6),text_size=celltextsize, width=TableWidth,bgcolor=cellcol,text_color= color.blue,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 1, 9, str.tostring(ses7),text_size=celltextsize, width=TableWidth,bgcolor=cellcol,text_color=color.blue, height=Tableheight,text_halign=text.align_right)
        table.cell(t, 1, 10, str.tostring(ses8),text_size=celltextsize, width=TableWidth, bgcolor=cellcol,text_color=color.blue,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 1, 11, str.tostring(ses9),text_size=celltextsize, width=TableWidth, bgcolor=cellcol,text_color=color.blue,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 1, 12, str.tostring(ses10),text_size=celltextsize, width=TableWidth,bgcolor=cellcol, text_color=color.blue,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 1, 13, str.tostring(ses11),text_size=celltextsize, width=TableWidth, bgcolor=cellcol,text_color=color.blue, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 1, 14, str.tostring(ses12),text_size=celltextsize, width=TableWidth, bgcolor=cellcol,text_color=color.blue, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 1, 15, str.tostring(ses13),text_size=celltextsize, width=TableWidth, bgcolor=cellcol,text_color=color.blue, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 1, 16, str.tostring(ses14),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,
         text_halign=text.align_right)
        table.cell(t, 1, 17, str.tostring(ses15),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,
         text_halign=text.align_right)
        table.cell(t, 1, 18, str.tostring(ses16),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,
         text_halign=text.align_right)
        table.cell(t, 6, 3, str.tostring(ses17),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,
         text_halign=text.align_right)
        table.cell(t, 6, 4, str.tostring(ses18),text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,bgcolor=cellcol,text_color=color.blue,
         text_halign=text.align_right)
        table.cell(t, 6, 5, str.tostring(ses19),text_size=celltextsize, width=TableWidth,bgcolor=cellcol,bgcolor=cellcol,text_color=color.blue,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 6, 6, str.tostring(ses20),text_size=celltextsize, width=TableWidth,bgcolor=cellcol,bgcolor=cellcol,text_color=color.blue,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 6, 7, str.tostring(ses21),text_size=celltextsize, width=TableWidth,bgcolor=cellcol,bgcolor=cellcol,text_color= color.blue,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 6, 8, str.tostring(ses22),text_size=celltextsize, width=TableWidth,bgcolor=cellcol,bgcolor=cellcol,text_color=color.blue, height=Tableheight,text_halign=text.align_right)
        table.cell(t, 6, 9, str.tostring(ses23),text_size=celltextsize, width=TableWidth, bgcolor=cellcol,bgcolor=cellcol,text_color=color.blue,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 6, 10, str.tostring(ses24),text_size=celltextsize, width=TableWidth,bgcolor=cellcol, text_color=color.blue,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 6, 11, str.tostring(ses25),text_size=celltextsize, width=TableWidth, bgcolor=cellcol,text_color=color.blue,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 6, 12, str.tostring(ses26),text_size=celltextsize, width=TableWidth,bgcolor=cellcol, text_color=color.blue, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 6, 13, str.tostring(ses27),text_size=celltextsize, width=TableWidth, bgcolor=cellcol,text_color=color.blue, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 6, 14, text_size=celltextsize, width=TableWidth, bgcolor=cellcol,text_color=color.blue, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 6, 15, text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue, text_halign=text.align_right)
        table.cell(t, 6, 16, text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,text_halign=text.align_right)
        table.cell(t, 6, 17, text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,text_halign=text.align_right)
        table.cell(t, 6, 18, text_size=celltextsize, width=TableWidth,height=Tableheight,bgcolor=cellcol,text_color=color.blue,text_halign=text.align_right)
// Opcl
        table.cell(t, 2, 3, str.tostring(o1),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o1>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 2, 4,str.tostring(o2) ,text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o2>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 2, 5, str.tostring(o3),text_size=celltextsize, width=TableWidth,text_color=o3>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 2, 6, str.tostring(o4),text_size=celltextsize, width=TableWidth,text_color=o4>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 2, 7, str.tostring(o5),text_size=celltextsize, width=TableWidth, text_color=o5>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 2, 8, str.tostring(o6),text_size=celltextsize, width=TableWidth,text_color=o6>0 ? color.green: color.red, height=Tableheight,text_halign=text.align_right)
        table.cell(t, 2, 9, str.tostring(o7),text_size=celltextsize, width=TableWidth, text_color=o7>0 ? color.green: color.red,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 2, 10, str.tostring(o8),text_size=celltextsize, width=TableWidth, text_color=o8>0 ? color.green: color.red,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 2, 11, str.tostring(o9),text_size=celltextsize, width=TableWidth, text_color=o9>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 2, 12, str.tostring(o10),text_size=celltextsize, width=TableWidth, text_color=o10>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 2, 13, str.tostring(o11),text_size=celltextsize, width=TableWidth, text_color=o11>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 2, 14, str.tostring(o12),text_size=celltextsize, width=TableWidth, text_color=o12>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 2, 15, str.tostring(o13),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o13>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 2, 16, str.tostring(o14),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o14>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 2, 17, str.tostring(o15),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o15>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 2, 18,str.tostring(o16) ,text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o16>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 7, 3, str.tostring(o17 ),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o17>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 7, 4, str.tostring(o18 ),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o18>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 7, 5, str.tostring(o19),text_size=celltextsize, width=TableWidth,text_color=o19>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 7, 6, str.tostring(o20),text_size=celltextsize, width=TableWidth,text_color=o20>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 7, 7, str.tostring(o21),text_size=celltextsize, width=TableWidth, text_color=o21>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 7, 8, str.tostring(o22),text_size=celltextsize, width=TableWidth,text_color=o22>0 ? color.green: color.red, height=Tableheight,text_halign=text.align_right)
        table.cell(t, 7, 9, str.tostring(o23 ),text_size=celltextsize, width=TableWidth, text_color=o23>0 ? color.green: color.red,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 7, 10, str.tostring(o24 ),text_size=celltextsize, width=TableWidth, text_color=o24>0 ? color.green: color.red,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 7, 11, str.tostring(o25 ),text_size=celltextsize, width=TableWidth, text_color=o25>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 7, 12, str.tostring(o26),text_size=celltextsize, width=TableWidth, text_color=o26>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 7, 13, str.tostring(o27),text_size=celltextsize, width=TableWidth, text_color=o27>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)

    //Increase/Decrease in Op-Cl
        table.cell(t, 3, 3, str.tostring(v1),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=v1>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 3, 4, str.tostring(v2 ),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color= o2<o1 ? color.red: color.green,
         text_halign=text.align_right)
        table.cell(t, 3, 5, str.tostring(v3),text_size=celltextsize, width=TableWidth,text_color=o3<o2 ? color.red: color.green,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 3, 6, str.tostring(v4),text_size=celltextsize, width=TableWidth,text_color=o4<o3 ? color.red: color.green,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 3, 7, str.tostring(v5),text_size=celltextsize, width=TableWidth, text_color=o5<o4 ? color.red: color.green,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 3, 8, str.tostring(v6),text_size=celltextsize, width=TableWidth,text_color=o6<o5  ? color.red: color.green, height=Tableheight,text_halign=text.align_right)
        table.cell(t, 3, 9, str.tostring(v7),text_size=celltextsize, width=TableWidth, text_color=o7<o6 ? color.red: color.green,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 3, 10, str.tostring(v8),text_size=celltextsize, width=TableWidth, text_color=o8<o7  ? color.red: color.green,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 3, 11, str.tostring(v9),text_size=celltextsize, width=TableWidth, text_color=o9<o8  ? color.red: color.green,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 3, 12, str.tostring(v10),text_size=celltextsize, width=TableWidth, text_color=o10<o9  ? color.red: color.green, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 3, 13, str.tostring(v11),text_size=celltextsize, width=TableWidth, text_color=o11<o10  ? color.red: color.green, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 3, 14, str.tostring(v12),text_size=celltextsize, width=TableWidth, text_color=o12<o11  ? color.red: color.green, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 3, 15, str.tostring(v13),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o13<o12  ? color.red: color.green,
         text_halign=text.align_right)
        table.cell(t, 3, 16, str.tostring(v14),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o14<o13  ? color.red: color.green,
         text_halign=text.align_right)
        table.cell(t, 3, 17, str.tostring(v15),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o15<o14  ?  color.red: color.green,
         text_halign=text.align_right)
        table.cell(t, 3, 18, str.tostring(v16),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o16<o15  ?  color.red: color.green,
         text_halign=text.align_right)
        table.cell(t, 8, 3, str.tostring(v17),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o17<o16  ?   color.red: color.green,
         text_halign=text.align_right)
        table.cell(t, 8, 4, str.tostring(v18),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=o18<o17  ?   color.red: color.green,
         text_halign=text.align_right)
        table.cell(t, 8, 5, str.tostring(v19),text_size=celltextsize, width=TableWidth,text_color=o19<o18  ?   color.red: color.green,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 8, 6, str.tostring(v20),text_size=celltextsize, width=TableWidth,text_color=o20<o19  ?   color.red: color.green,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 8, 7, str.tostring(v21),text_size=celltextsize, width=TableWidth, text_color=o21<o20  ?  color.red: color.green,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 8, 8, str.tostring(v22),text_size=celltextsize, width=TableWidth,text_color=o22<o21  ?   color.red: color.green, height=Tableheight,text_halign=text.align_right)
        table.cell(t, 8, 9, str.tostring(v23),text_size=celltextsize, width=TableWidth, text_color=o23<o22  ?  color.red: color.green,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 8, 10, str.tostring(v24),text_size=celltextsize, width=TableWidth, text_color=o24<o23  ?  color.red: color.green,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 8, 11, str.tostring(v25),text_size=celltextsize, width=TableWidth, text_color=o25<o24  ? color.red: color.green,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 8, 12, str.tostring(v26),text_size=celltextsize, width=TableWidth, text_color=o26<o25  ? color.red: color.green, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 8, 13, str.tostring(v27),text_size=celltextsize, width=TableWidth, text_color=o27<o26  ? color.red: color.green, height=Tableheight, text_halign=text.align_right)
    
    //ROC,MA20,MA50,CLOSE,RSI,Op-CL
        table.cell(t, 4, 3, str.tostring(don1),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=  don1>0 ? color.green:color.red,text_halign=text.align_right)
        table.cell(t, 4, 4, str.tostring(don2),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=don2>0 ?color.green:color.red, text_halign=text.align_right)
        table.cell(t, 4, 5, str.tostring(don3),text_size=celltextsize, width=TableWidth,text_color=don3>0 ?  color.green:color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 4, 6, str.tostring(don4),text_size=celltextsize, width=TableWidth,text_color= don4>0 ?  color.green:color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 4, 7, str.tostring(don5),text_size=celltextsize, width=TableWidth, text_color=don5>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 4, 8, str.tostring(don6),text_size=celltextsize, width=TableWidth,text_color=don6>0 ? color.green: color.red, height=Tableheight,text_halign=text.align_right)
        table.cell(t, 4, 9, str.tostring(don7),text_size=celltextsize, width=TableWidth, text_color=don7>0 ? color.green: color.red,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 4, 10, str.tostring(don8),text_size=celltextsize, width=TableWidth, text_color=don8>0 ? color.green: color.red,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 4, 11, str.tostring(don9),text_size=celltextsize, width=TableWidth, text_color=don9>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 4, 12, str.tostring(don10),text_size=celltextsize, width=TableWidth, text_color=don10>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 4, 13, str.tostring(don11),text_size=celltextsize, width=TableWidth, text_color=don11>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 4, 14, str.tostring(don12),text_size=celltextsize, width=TableWidth, text_color=don12>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 4, 15, str.tostring(don13),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=don13>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 4, 16, str.tostring(don14),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=don14>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 4, 17, str.tostring(don15),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=don15>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 4, 18, str.tostring(don16),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=don16>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 9, 3, str.tostring(don17),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=don17>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 9, 4, str.tostring(don18),text_size=celltextsize, width=TableWidth,height=Tableheight,text_color=don18>0 ? color.green: color.red,
         text_halign=text.align_right)
        table.cell(t, 9, 5, str.tostring(don19),text_size=celltextsize, width=TableWidth,text_color=don19>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 9, 6, str.tostring(don20),text_size=celltextsize, width=TableWidth,text_color=don20>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 9, 7, str.tostring(don21),text_size=celltextsize, width=TableWidth, text_color=don21>0 ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 9, 8, str.tostring(don22),text_size=celltextsize, width=TableWidth,text_color=don22>0 ? color.green: color.red, height=Tableheight,text_halign=text.align_right)
        table.cell(t, 9, 9, str.tostring(don23),text_size=celltextsize, width=TableWidth, text_color=don23>0 ? color.green: color.red,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 9, 10, str.tostring(don24),text_size=celltextsize, width=TableWidth, text_color=don24>0 ?  color.green: color.red,height=Tableheight,
         text_halign=text.align_right)
        table.cell(t, 9, 11, str.tostring(don25),text_size=celltextsize, width=TableWidth, text_color=don25>0  ? color.green: color.red,height=Tableheight,text_halign=text.align_right)
        table.cell(t, 9, 12, str.tostring(don26),text_size=celltextsize, width=TableWidth, text_color=don26>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        table.cell(t, 9, 13, str.tostring(don27),text_size=celltextsize, width=TableWidth, text_color=don27>0 ? color.green: color.red, height=Tableheight, text_halign=text.align_right)
        
        
        