Spongebob [TFO]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tradeforopp

//@version=5
indicator("Spongebob [TFO]", "Spongebob [TFO]", true)

body_color = #eee866
outline_color = #c0bd16
black = #000000
white = color.white
red = #d44b2e
iris = #37a7dc
pants_upper = #b97c33
pants_lower = #855c27

atr = ta.atr(50) * 2.0

// ------------------------------ BODY ------------------------------
left_offset = bar_index + 10
L_x = 2
L_y = atr / 3
B_x = 5
B_y = L_y / 5

L1x = left_offset - 5
L1y = open - (0.5 * L_y)
L2x = left_offset + L_x - 4
L2y = L1y - (1 * L_y)
L3x = left_offset - 3
L3y = L1y - (2 * L_y)
L4x = left_offset + L_x - 3
L4y = L1y - (3 * L_y)
L5x = left_offset - 3
L5y = L1y - (4 * L_y)
L6x = left_offset + L_x - 2
L6y = L1y - (5 * L_y)
L7x = left_offset - 2
L7y = L1y - (6 * L_y)
L8x = left_offset + L_x - 1
L8y = L1y - (7 * L_y)
L9x = left_offset
L9y = L1y - (8 * L_y)
L10x = left_offset + L_x
L10y = L1y - (9 * L_y)

Lx = array.from(L1x, L2x, L3x, L4x, L5x, L6x, L7x, L8x, L9x, L10x)
Ly = array.from(L1y, L2y, L3y, L4y, L5y, L6y, L7y, L8y, L9y, L10y)

BLx = L10x
BLy = L10y

B1x = BLx + (1 * B_x)
B1y = BLy + B_y
B2x = BLx + (2 * B_x)
B2y = BLy - B_y
B3x = BLx + (3 * B_x)
B3y = BLy + B_y
B4x = BLx + (4 * B_x)
B4y = BLy - B_y
B5x = BLx + (5 * B_x)
B5y = BLy + B_y
B6x = BLx + (6 * B_x)
B6y = BLy - B_y
B7x = BLx + (7 * B_x)
B7y = BLy + B_y
B8x = BLx + (8 * B_x)
B8y = BLy - B_y
B9x = BLx + (9 * B_x)
B9y = BLy + B_y
B10x = BLx + (10 * B_x)
B10y = BLy

Bx = array.from(B1x, B2x, B3x, B4x, B5x, B6x, B7x, B8x, B9x, B10x)
By = array.from(B1y, B2y, B3y, B4y, B5y, B6y, B7y, B8y, B9y, B10y)

RBx = B10x + (1 * L_x)
RBy = B10y

R1x = RBx
R1y = RBy + (1 * L_y)
R2x = RBx - L_x + 1
R2y = RBy + (2 * L_y)
R3x = RBx + 2
R3y = RBy + (3 * L_y)
R4x = RBx - L_x + 2
R4y = RBy + (4 * L_y)
R5x = RBx + 3
R5y = RBy + (5 * L_y)
R6x = RBx - L_x + 3
R6y = RBy + (6 * L_y)
R7x = RBx + 3
R7y = RBy + (7 * L_y)
R8x = RBx - L_x + 4
R8y = RBy + (8 * L_y)
R9x = RBx + 5
R9y = RBy + (9 * L_y)

Rx = array.from(R1x, R2x, R3x, R4x, R5x, R6x, R7x, R8x, R9x)
Ry = array.from(R1y, R2y, R3y, R4y, R5y, R6y, R7y, R8y, R9y)

RTx = R9x - (1 * L_x)
RTy = R9y + (0.5 * L_y)

T1x = RTx
T1y = RTy + B_y * 0.5
T2x = RTx - (1 * B_x)
T2y = RTy - (0.5 * B_y)
T3x = RTx - (2 * B_x)
T3y = RTy + B_y * 1.2
T4x = RTx - (3 * B_x)
T4y = RTy - (0.5 * B_y)
T5x = RTx - (4 * B_x)
T5y = RTy + B_y * 1.35
T6x = RTx - (5 * B_x)
T6y = RTy - (0.5 * B_y)
T7x = RTx - (6 * B_x)
T7y = RTy + B_y * 1.5
T8x = RTx - (7 * B_x)
T8y = RTy - (0.5 * B_y)
T9x = RTx - (8 * B_x)
T9y = RTy + B_y * 1.35
T10x = RTx - (9 * B_x)
T10y = RTy - (0.5 * B_y)
T11x = RTx - (10 * B_x)
T11y = RTy + B_y * 1.2
T12x = RTx - (11 * B_x)
T12y = RTy - (0.5 * B_y)
T13x = RTx - (12 * B_x)
T13y = RTy + B_y * 0.5

Tx = array.from(T1x, T2x, T3x, T4x, T5x, T6x, T7x, T8x, T9x, T10x, T11x, T12x, T13x)
Ty = array.from(T1y, T2y, T3y, T4y, T5y, T6y, T7y, T8y, T9y, T10y, T11y, T12y, T13y)
// ------------------------------ BODY ------------------------------

// ------------------------------ LEFT EYE - OUTLINE ------------------------------
Lcenter_x = math.floor((RTx - L1x) / 2.7 + L1x)
Lcenter_y = RTy - (RTy - RBy) / 3

E_x = 10
E_y = atr / 1.8

LE1x = Lcenter_x - E_x
LE1y = Lcenter_y
LE2x = Lcenter_x
LE2y = Lcenter_y + E_y
LE3x = Lcenter_x + E_x
LE3y = Lcenter_y
LE4x = Lcenter_x
LE4y = Lcenter_y - E_y

LEx = array.from(LE1x, LE2x, LE3x, LE4x)
LEy = array.from(LE1y, LE2y, LE3y, LE4y)
// ------------------------------ LEFT EYE - OUTLINE ------------------------------

// ------------------------------ RIGHT EYE - OUTLINE ------------------------------
Rcenter_x = math.floor(RTx - (RTx - L1x) / 2.9) + 1
Rcenter_y = RTy - (RTy - RBy) / 3

RE1x = Rcenter_x - E_x
RE1y = Rcenter_y
RE2x = Rcenter_x
RE2y = Rcenter_y + E_y
RE3x = Rcenter_x + E_x
RE3y = Rcenter_y
RE4x = Rcenter_x
RE4y = Rcenter_y - E_y

REx = array.from(RE1x, RE2x, RE3x, RE4x)
REy = array.from(RE1y, RE2y, RE3y, RE4y)
// ------------------------------ RIGHT EYE - OUTLINE ------------------------------

// ------------------------------ LEFT EYE - IRIS ------------------------------
LIcenter_x = math.floor((RTx - L1x) / 2.5 + L1x)
LIcenter_y = RTy - (RTy - RBy) / 3

I_x = 5
I_y = atr / 3.8

LEI1x = LIcenter_x - I_x
LEI1y = LIcenter_y
LEI2x = LIcenter_x
LEI2y = LIcenter_y + I_y
LEI3x = LIcenter_x + I_x
LEI3y = LIcenter_y
LEI4x = LIcenter_x
LEI4y = LIcenter_y - I_y

LEIx = array.from(LEI1x, LEI2x, LEI3x, LEI4x)
LEIy = array.from(LEI1y, LEI2y, LEI3y, LEI4y)
// ------------------------------ LEFT EYE - IRIS ------------------------------

// ------------------------------ RIGHT EYE - IRIS ------------------------------
RIcenter_x = math.floor(RTx - (RTx - L1x) / 2.8)
RIcenter_y = RTy - (RTy - RBy) / 3

REI1x = RIcenter_x - I_x
REI1y = RIcenter_y
REI2x = RIcenter_x
REI2y = RIcenter_y + I_y
REI3x = RIcenter_x + I_x
REI3y = RIcenter_y
REI4x = RIcenter_x
REI4y = RIcenter_y - I_y

REIx = array.from(REI1x, REI2x, REI3x, REI4x)
REIy = array.from(REI1y, REI2y, REI3y, REI4y)
// ------------------------------ RIGHT EYE - IRIS ------------------------------

// ------------------------------ LEFT EYE - PUPIL ------------------------------
P_x = 2
P_y = atr / 9.5

LEP1x = LIcenter_x - P_x
LEP1y = LIcenter_y
LEP2x = LIcenter_x
LEP2y = LIcenter_y + P_y
LEP3x = LIcenter_x + P_x
LEP3y = LIcenter_y
LEP4x = LIcenter_x
LEP4y = LIcenter_y - P_y

LEPx = array.from(LEP1x, LEP2x, LEP3x, LEP4x)
LEPy = array.from(LEP1y, LEP2y, LEP3y, LEP4y)
// ------------------------------ LEFT EYE - PUPIL ------------------------------

// ------------------------------ RIGHT EYE - PUPIL ------------------------------
REP1x = RIcenter_x - P_x
REP1y = RIcenter_y
REP2x = RIcenter_x
REP2y = RIcenter_y + P_y
REP3x = RIcenter_x + P_x
REP3y = RIcenter_y
REP4x = RIcenter_x
REP4y = RIcenter_y - P_y

REPx = array.from(REP1x, REP2x, REP3x, REP4x)
REPy = array.from(REP1y, REP2y, REP3y, REP4y)
// ------------------------------ RIGHT EYE - PUPIL ------------------------------

// ------------------------------ LEFT EYELASHES ------------------------------
LEL1x = LIcenter_x - 9
LEL1y = LIcenter_y + I_y * 2.8
LEL2x = LIcenter_x - 2
LEL2y = LIcenter_y
LEL3x = LIcenter_x - 2
LEL3y = LIcenter_y + I_y * 3.1
LEL4x = LIcenter_x - 2
LEL4y = LIcenter_y
LEL5x = LIcenter_x + 4
LEL5y = LIcenter_y + I_y * 2.8

LELx = array.from(LEL1x, LEL2x, LEL3x, LEL4x, LEL5x)
LELy = array.from(LEL1y, LEL2y, LEL3y, LEL4y, LEL5y)
// ------------------------------ LEFT EYELASHES ------------------------------

// ------------------------------ RIGHT EYELASHES ------------------------------
REL1x = RIcenter_x - 4
REL1y = RIcenter_y + I_y * 2.8
REL2x = RIcenter_x + 2
REL2y = RIcenter_y
REL3x = RIcenter_x + 2
REL3y = RIcenter_y + I_y * 3.1
REL4x = RIcenter_x + 2
REL4y = RIcenter_y
REL5x = RIcenter_x + 9
REL5y = RIcenter_y + I_y * 2.7

RELx = array.from(REL1x, REL2x, REL3x, REL4x, REL5x)
RELy = array.from(REL1y, REL2y, REL3y, REL4y, REL5y)
// ------------------------------ RIGHT EYELASHES ------------------------------

// ------------------------------ NOSE ------------------------------
Ncenter_x = math.floor((RTx - L1x) / 2 + L1x)
Ncenter_y = RTy - (RTy - RBy) / 2

N_x = 4
N_y = atr / 4.2

N1x = Ncenter_x - N_x
N1y = Ncenter_y
N2x = Ncenter_x
N2y = Ncenter_y + N_y
N3x = Ncenter_x + N_x
N3y = Ncenter_y
N4x = Ncenter_x
N4y = Ncenter_y - N_y

Nx = array.from(N1x, N2x, N3x, N4x)
Ny = array.from(N1y, N2y, N3y, N4y)
// ------------------------------ NOSE ------------------------------

// ------------------------------ LEFT CHEEK ------------------------------
LCcenter_x = math.floor((RTx - L1x) / 5 + L1x)
LCcenter_y = RTy - (RTy - RBy) / 1.9

LC_x = 4
LC_y = N_y

LC1x = LCcenter_x - LC_x
LC1y = LCcenter_y - (LC_y / 2)
LC2x = LCcenter_x - LC_x
LC2y = LCcenter_y + (LC_y)
LC3x = LCcenter_x + LC_x
LC3y = LCcenter_y + (LC_y)
LC4x = LCcenter_x + LC_x
LC4y = LCcenter_y - (LC_y / 2)

LCx = array.from(LC1x, LC2x, LC3x, LC4x)
LCy = array.from(LC1y, LC2y, LC3y, LC4y)
// ------------------------------ LEFT CHEEK ------------------------------

// ------------------------------ RIGHT CHEEK ------------------------------
RCcenter_x = math.floor(RTx - (RTx - L1x) / 5) + 1
RCcenter_y = RTy - (RTy - RBy) / 1.9

RC1x = RCcenter_x - LC_x
RC1y = RCcenter_y - (LC_y / 2)
RC2x = RCcenter_x - LC_x
RC2y = RCcenter_y + (LC_y)
RC3x = RCcenter_x + LC_x
RC3y = RCcenter_y + (LC_y)
RC4x = RCcenter_x + LC_x
RC4y = RCcenter_y - (LC_y / 2)

RCx = array.from(RC1x, RC2x, RC3x, RC4x)
RCy = array.from(RC1y, RC2y, RC3y, RC4y)
// ------------------------------ RIGHT CHEEK ------------------------------

// ------------------------------ SMILE ------------------------------
S_x = math.floor((RTx - L1x) / 5 + L1x)
S_y = (LCcenter_y - RBy) / 1.6 + RBy

S1x = LCcenter_x
S1y = LCcenter_y
S2x = LCcenter_x + (RCcenter_x - LCcenter_x) / 2
S2y = S_y
S3x = RCcenter_x
S3y = RCcenter_y

Sx = array.from(S1x, S2x, S3x)
Sy = array.from(S1y, S2y, S3y)
// ------------------------------ SMILE ------------------------------

// ------------------------------ LEFT DIMPLE ------------------------------
LD1x = LCcenter_x - (LC_x / 2)
LD1y = LCcenter_y - (LC_y / 3)
LD2x = LCcenter_x
LD2y = LCcenter_y
LD3x = LCcenter_x + (LC_x / 2)
LD3y = LCcenter_y

LDx = array.from(LD1x, LD2x, LD3x)
LDy = array.from(LD1y, LD2y, LD3y)
// ------------------------------ LEFT DIMPLE ------------------------------

// ------------------------------ RIGHT DIMPLE ------------------------------
RD1x = RCcenter_x - (LC_x / 2)
RD1y = RCcenter_y
RD2x = RCcenter_x
RD2y = RCcenter_y
RD3x = RCcenter_x + (LC_x / 2)
RD3y = RCcenter_y - (LC_y / 3)

RDx = array.from(RD1x, RD2x, RD3x)
RDy = array.from(RD1y, RD2y, RD3y)
// ------------------------------ RIGHT DIMPLE ------------------------------

// ------------------------------ LEFT TOOTH ------------------------------
LT1x = S2x
LT1y = S2y + LC_y / 2
LT2x = S2x - 6
LT2y = S2y + LC_y / 2
LT3x = S2x - 6
LT3y = S2y - LC_y * 1.4
LT4x = S2x
LT4y = S2y - LC_y * 1.4
LT5x = S2x
LT5y = S2y + LC_y / 2

LTx = array.from(LT1x, LT2x, LT3x, LT4x, LT5x)
LTy = array.from(LT1y, LT2y, LT3y, LT4y, LT5y)
// ------------------------------ LEFT TOOTH ------------------------------

// ------------------------------ RIGHT TOOTH ------------------------------
RT1x = S2x + 2
RT1y = S2y + LC_y / 2
RT2x = S2x + 8
RT2y = S2y + LC_y / 2
RT3x = S2x + 8
RT3y = S2y - LC_y * 1.4
RT4x = S2x + 2
RT4y = S2y - LC_y * 1.4
RT5x = S2x + 2
RT5y = S2y + LC_y / 2

Rtoothx = array.from(RT1x, RT2x, RT3x, RT4x, RT5x)
Rtoothy = array.from(RT1y, RT2y, RT3y, RT4y, RT5y)
// ------------------------------ RIGHT TOOTH ------------------------------

// ------------------------------ CHIN ------------------------------
C1x = LT3x - 4
C1y = LT3y
C2x = LT3x
C2y = LT3y - LC_y / 1.3
C3x = S2x + 1
C3y = LT3y - LC_y / 3
C4x = RT3x
C4y = RT3y - LC_y / 1.3
C5x = RT3x + 4
C5y = RT3y

Cx = array.from(C1x, C2x, C3x, C4x, C5x)
Cy = array.from(C1y, C2y, C3y, C4y, C5y)
// ------------------------------ CHIN ------------------------------

// ------------------------------ SHIRT ------------------------------
SH1x = BLx
SH1y = BLy + LC_y
SH2x = BLx
SH2y = BLy - LC_y * 1.3
SH3x = RBx - 2
SH3y = RBy - LC_y * 1.3
SH4x = RBx - 2
SH4y = RBy + LC_y

SHx = array.from(SH1x, SH2x, SH3x, SH4x)
SHy = array.from(SH1y, SH2y, SH3y, SH4y)
// ------------------------------ SHIRT ------------------------------

// ------------------------------ COLLAR ------------------------------
CL1x = LIcenter_x - 4
CL1y = BLy + LC_y / 2
CL2x = LIcenter_x + 1
CL2y = BLy - LC_y
CL3x = S2x + 1
CL3y = BLy + LC_y / 2
CL4x = RIcenter_x
CL4y = RBy - LC_y
CL5x = RIcenter_x + 5
CL5y = BLy + LC_y / 2

CLy = array.from(CL1y, CL2y, CL3y, CL4y, CL5y)
CLx = array.from(CL1x, CL2x, CL3x, CL4x, CL5x)
// ------------------------------ COLLAR ------------------------------

// ------------------------------ TIE ------------------------------
TI1x = S2x - 2
TI1y = BLy + LC_y / 2
TI2x = S2x
TI2y = BLy - LC_y / 2
TI3x = S2x - 3
TI3y = BLy - LC_y * 1.8
TI4x = S2x + 1
TI4y = BLy - LC_y * 2.8
TI5x = S2x + 5
TI5y = BLy - LC_y * 1.8
TI6x = S2x + 2
TI6y = BLy - LC_y / 2
TI7x = S2x
TI7y = BLy - LC_y / 2
TI8x = S2x + 2
TI8y = BLy - LC_y / 2
TI9x = S2x + 4
TI9y = BLy + LC_y / 2

TIy = array.from(TI1y, TI2y, TI3y, TI4y, TI5y, TI6y, TI7y, TI8y, TI9y)
TIx = array.from(TI1x, TI2x, TI3x, TI4x, TI5x, TI6x, TI7x, TI8x, TI9x)
// ------------------------------ TIE ------------------------------

// ------------------------------ PANTS ------------------------------
P1x = BLx
P1y = BLy - LC_y * 1.3
P2x = BLx
P2y = BLy - LC_y * 3.3
P3x = RBx - 2
P3y = RBy - LC_y * 3.3
P4x = RBx - 2
P4y = RBy + LC_y * 1.3

Px = array.from(P1x, P2x, P3x, P4x)
Py = array.from(P1y, P2y, P3y, P4y)
// ------------------------------ PANTS ------------------------------

// ------------------------------ LEFT PANT LEG ------------------------------
LP1x = P2x + 8
LP1y = P2y + LC_y / 2
LP2x = P2x + 8
LP2y = P2y - LC_y * 1.3
LP3x = P2x + 18
LP3y = P2y - LC_y * 1.3
LP4x = P2x + 18
LP4y = P2y + LC_y / 2

LPx = array.from(LP1x, LP2x, LP3x, LP4x)
LPy = array.from(LP1y, LP2y, LP3y, LP4y)
// ------------------------------ LEFT PANT LEG ------------------------------

// ------------------------------ RIGHT PANT LEG ------------------------------
RP1x = P3x - 8
RP1y = P3y + LC_y / 2
RP2x = P3x - 8
RP2y = P3y - LC_y * 1.3
RP3x = P3x - 18
RP3y = P3y - LC_y * 1.3
RP4x = P3x - 18
RP4y = P3y + LC_y / 2

RPx = array.from(RP1x, RP2x, RP3x, RP4x)
RPy = array.from(RP1y, RP2y, RP3y, RP4y)
// ------------------------------ RIGHT PANT LEG ------------------------------

// ------------------------------ LEFT LEG ------------------------------
LL1x = P2x + 12
LL1y = LP2y
LL2x = P2x + 12
LL2y = LP2y - LC_y * 2.0
LL3x = P2x + 15
LL3y = LP2y - LC_y * 2.0
LL4x = P2x + 15
LL4y = LP2y

LLx = array.from(LL1x, LL2x, LL3x, LL4x)
LLy = array.from(LL1y, LL2y, LL3y, LL4y)
// ------------------------------ LEFT LEG ------------------------------

// ------------------------------ RIGHT LEG ------------------------------
RL1x = P3x - 12
RL1y = LP2y
RL2x = P3x - 12
RL2y = LP2y - LC_y * 2.0
RL3x = P3x - 15
RL3y = LP2y - LC_y * 2.0
RL4x = P3x - 15
RL4y = LP2y

RLx = array.from(RL1x, RL2x, RL3x, RL4x)
RLy = array.from(RL1y, RL2y, RL3y, RL4y)
// ------------------------------ RIGHT LEG ------------------------------

// ------------------------------ LEFT SOCK ------------------------------
LS1x = P2x + 12
LS1y = LL2y
LS2x = P2x + 12
LS2y = LL2y - LC_y * 2.1
LS3x = P2x + 15
LS3y = LL2y - LC_y * 2.1
LS4x = P2x + 15
LS4y = LL2y

LSx = array.from(LS1x, LS2x, LS3x, LS4x)
LSy = array.from(LS1y, LS2y, LS3y, LS4y)
// ------------------------------ LEFT SOCK ------------------------------

// ------------------------------ RIGHT SOCK ------------------------------
RS1x = P3x - 12
RS1y = LL2y
RS2x = P3x - 12
RS2y = LL2y - LC_y * 2.1
RS3x = P3x - 15
RS3y = LL2y - LC_y * 2.1
RS4x = P3x - 15
RS4y = LL2y

RSx = array.from(RS1x, RS2x, RS3x, RS4x)
RSy = array.from(RS1y, RS2y, RS3y, RS4y)
// ------------------------------ RIGHT SOCK ------------------------------

// ------------------------------ LEFT SHOE BULB ------------------------------
LSO1x = LS1x - 5
LSO1y = LS2y - LC_y * 0
LSO2x = LS1x - 10
LSO2y = LS2y - LC_y * 1
LSO3x = LS1x - 5
LSO3y = LS2y - LC_y * 2.1
LSO4x = LS1x
LSO4y = LS2y - LC_y * 1.1

LSOx = array.from(LSO1x, LSO2x, LSO3x, LSO4x)
LSOy = array.from(LSO1y, LSO2y, LSO3y, LSO4y)
// ------------------------------ LEFT SHOE BULB ------------------------------

// ------------------------------ RIGHT SHOE BULB ------------------------------
RSO1x = RS1x + 5
RSO1y = RS2y - LC_y * 0
RSO2x = RS1x + 10
RSO2y = RS2y - LC_y * 1
RSO3x = RS1x + 5
RSO3y = RS2y - LC_y * 2.1
RSO4x = RS1x
RSO4y = RS2y - LC_y * 1

RSOx = array.from(RSO1x, RSO2x, RSO3x, RSO4x)
RSOy = array.from(RSO1y, RSO2y, RSO3y, RSO4y)
// ------------------------------ RIGHT SHOE BULB ------------------------------

// ------------------------------ LEFT SHOE BACK ------------------------------
LSB1x = LS1x
LSB1y = LS2y - LC_y * 0
LSB2x = LS1x + 3
LSB2y = LS2y - LC_y * 0
LSB3x = LS1x + 3
LSB3y = LS2y - LC_y * 2
LSB4x = LS1x
LSB4y = LS2y - LC_y * 2
LSB5x = LS1x
LSB5y = LS2y - LC_y * 1
LSB6x = LS1x - 3
LSB6y = LS2y - LC_y * 0.5

LSBx = array.from(LSB1x, LSB2x, LSB3x, LSB4x, LSB5x, LSB6x)
LSBy = array.from(LSB1y, LSB2y, LSB3y, LSB4y, LSB5y, LSB6y)
// ------------------------------ LEFT SHOE BACK ------------------------------

// ------------------------------ RIGHT SHOE BACK ------------------------------
RSB1x = RS1x
RSB1y = LS2y - LC_y * 0
RSB2x = RS1x - 3
RSB2y = LS2y - LC_y * 0
RSB3x = RS1x - 3
RSB3y = LS2y - LC_y * 2
RSB4x = RS1x
RSB4y = LS2y - LC_y * 2
RSB5x = RS1x
RSB5y = LS2y - LC_y * 1
RSB6x = RS1x + 3
RSB6y = LS2y - LC_y * 0.5

RSBx = array.from(RSB1x, RSB2x, RSB3x, RSB4x, RSB5x, RSB6x)
RSBy = array.from(RSB1y, RSB2y, RSB3y, RSB4y, RSB5y, RSB6y)
// ------------------------------ RIGHT SHOE BACK ------------------------------

// ------------------------------ LEFT SHOULDER ------------------------------
LSH1x = L7x + 2
LSH1y = S2y
LSH2x = L7x - 2
LSH2y = S2y - LC_y * 0.3
LSH3x = L7x - 4
LSH3y = S2y - LC_y * 1.8
LSH4x = L7x - 2
LSH4y = S2y - LC_y * 2.2
LSH5x = L7x + 4
LSH5y = S2y - LC_y * 1.8

LSHx = array.from(LSH1x, LSH2x, LSH3x, LSH4x, LSH5x)
LSHy = array.from(LSH1y, LSH2y, LSH3y, LSH4y, LSH5y)
// ------------------------------ LEFT SHOULDER ------------------------------

// ------------------------------ RIGHT SHOULDER ------------------------------
RSH1x = R3x - 2
RSH1y = S2y
RSH2x = R3x + 2
RSH2y = S2y - LC_y * 0.3
RSH3x = R3x + 4
RSH3y = S2y - LC_y * 1.8
RSH4x = R3x + 2
RSH4y = S2y - LC_y * 2.2
RSH5x = R3x - 4
RSH5y = S2y - LC_y * 1.8

RSHx = array.from(RSH1x, RSH2x, RSH3x, RSH4x, RSH5x)
RSHy = array.from(RSH1y, RSH2y, RSH3y, RSH4y, RSH5y)
// ------------------------------ RIGHT SHOULDER ------------------------------

// ------------------------------ LEFT ARM ------------------------------
LA1x = L7x - 2
LA1y = S2y - LC_y
LA2x = L7x - 5
LA2y = S2y - LC_y * 7
LA3x = L7x - 2
LA3y = S2y - LC_y * 7
LA4x = L7x + 1
LA4y = S2y - LC_y

LAx = array.from(LA1x, LA2x, LA3x, LA4x)
LAy = array.from(LA1y, LA2y, LA3y, LA4y)
// ------------------------------ LEFT ARM ------------------------------

// ------------------------------ RIGHT ARM ------------------------------
RA1x = R3x + 2
RA1y = S2y - LC_y
RA2x = R3x + 5
RA2y = S2y - LC_y * 7
RA3x = R3x + 2
RA3y = S2y - LC_y * 7
RA4x = R3x - 1
RA4y = S2y - LC_y

RAx = array.from(RA1x, RA2x, RA3x, RA4x)
RAy = array.from(RA1y, RA2y, RA3y, RA4y)
// ------------------------------ RIGHT ARM ------------------------------

// ------------------------------ LEFT HAND ------------------------------ 
//palm
LH1x = P2x - 7
LH1y = P2y + LC_y * 0.3
LH2x = P2x - 10
LH2y = P2y + LC_y * 0.2
//finger 1
LH3x = P2x - 12
LH3y = P2y - LC_y * 0.8
LH4x = P2x - 15
LH4y = P2y - LC_y * 1.1
LH5x = P2x - 14
LH5y = P2y - LC_y * 1.5
LH6x = P2x - 12
LH6y = P2y - LC_y * 1.3
//finger 2
LH7x = P2x - 12
LH7y = P2y - LC_y * 1.5
LH8x = P2x - 14
LH8y = P2y - LC_y * 1.8
LH9x = P2x - 12
LH9y = P2y - LC_y * 2.1
LH10x = P2x - 10
LH10y = P2y - LC_y * 1.5
//finger 3
LH11x = P2x - 10
LH11y = P2y - LC_y * 2.4
LH12x = P2x - 8
LH12y = P2y - LC_y * 2.4
LH13x = P2x - 7
LH13y = P2y - LC_y * 1.4
//finger 4
LH14x = P2x - 4
LH14y = P2y - LC_y * 1.9
LH15x = P2x - 3
LH15y = P2y - LC_y * 1.5
//palm again
LH16x = P2x - 5
LH16y = P2y - LC_y * 1.0
LH17x = P2x - 5
LH17y = P2y - LC_y * 0

LHx = array.from(LH1x, LH2x, LH3x, LH4x, LH5x, LH6x, LH7x, LH8x, LH9x, LH10x, LH11x, LH12x, LH13x, LH14x, LH15x, LH16x, LH17x)
LHy = array.from(LH1y, LH2y, LH3y, LH4y, LH5y, LH6y, LH7y, LH8y, LH9y, LH10y, LH11y, LH12y, LH13y, LH14y, LH15y, LH16y, LH17y)
// ------------------------------ LEFT HAND ------------------------------

// ------------------------------ RIGHT HAND ------------------------------
//palm
RH1x = P3x + 7
RH1y = P2y + LC_y * 0.3
RH2x = P3x + 10
RH2y = P2y + LC_y * 0.2
//finger 1
RH3x = P3x + 12
RH3y = P2y - LC_y * 0.8
RH4x = P3x + 15
RH4y = P2y - LC_y * 1.1
RH5x = P3x + 14
RH5y = P2y - LC_y * 1.5
RH6x = P3x + 12
RH6y = P2y - LC_y * 1.3
//finger 2
RH7x = P3x + 12
RH7y = P2y - LC_y * 1.5
RH8x = P3x + 14
RH8y = P2y - LC_y * 1.8
RH9x = P3x + 12
RH9y = P2y - LC_y * 2.1
RH10x = P3x + 10
RH10y = P2y - LC_y * 1.5
//finger 3
RH11x = P3x + 10
RH11y = P2y - LC_y * 2.4
RH12x = P3x + 8
RH12y = P2y - LC_y * 2.4
RH13x = P3x + 7
RH13y = P2y - LC_y * 1.4
//finger 4
RH14x = P3x + 4
RH14y = P2y - LC_y * 1.9
RH15x = P3x + 3
RH15y = P2y - LC_y * 1.5
//palm again
RH16x = P3x + 5
RH16y = P2y - LC_y * 1.0
RH17x = P3x + 5
RH17y = P2y - LC_y * 0

RHx = array.from(RH1x, RH2x, RH3x, RH4x, RH5x, RH6x, RH7x, RH8x, RH9x, RH10x, RH11x, RH12x, RH13x, RH14x, RH15x, RH16x, RH17x)
RHy = array.from(RH1y, RH2y, RH3y, RH4y, RH5y, RH6y, RH7y, RH8y, RH9y, RH10y, RH11y, RH12y, RH13y, RH14y, RH15y, RH16y, RH17y)
// ------------------------------ RIGHT HAND ------------------------------

// ------------------------------ SPOT 1 ------------------------------
SP11x = BLx + 3
SP11y = BLy + (RTy - BLy) / 5
SP12x = BLx + 5
SP12y = BLy + (RTy - BLy) / 5
SP13x = BLx + 3
SP13y = BLy + (RTy - BLy) / 6.5

SP1x = array.from(SP11x, SP12x, SP13x)
SP1y = array.from(SP11y, SP12y, SP13y)
// ------------------------------ SPOT 1 ------------------------------

// ------------------------------ SPOT 2 ------------------------------
SP21x = BLx + 4
SP21y = BLy + (RTy - BLy) / 15
SP22x = BLx + 6
SP22y = BLy + (RTy - BLy) / 8
SP23x = BLx + 8
SP23y = BLy + (RTy - BLy) / 15

SP2x = array.from(SP21x, SP22x, SP23x)
SP2y = array.from(SP21y, SP22y, SP23y)
// ------------------------------ SPOT 2 ------------------------------

// ------------------------------ SPOT 3 ------------------------------
SP31x = RBx - 12
SP31y = BLy + (RTy - BLy) / 8
SP32x = RBx - 11
SP32y = BLy + (RTy - BLy) / 10
SP33x = RBx - 10
SP33y = BLy + (RTy - BLy) / 8

SP3x = array.from(SP31x, SP32x, SP33x)
SP3y = array.from(SP31y, SP32y, SP33y)
// ------------------------------ SPOT 3 ------------------------------

// ------------------------------ SPOT 4 ------------------------------
SP41x = RBx - 9
SP41y = BLy + (RTy - BLy) / 5.7
SP42x = RBx - 6
SP42y = BLy + (RTy - BLy) / 3.7
SP43x = RBx - 5
SP43y = BLy + (RTy - BLy) / 5.5

SP4x = array.from(SP41x, SP42x, SP43x)
SP4y = array.from(SP41y, SP42y, SP43y)
// ------------------------------ SPOT 4 ------------------------------

// ------------------------------ SPOT 5 ------------------------------
SP51x = BLx - 2
SP51y = BLy + (RTy - BLy) / 1.35
SP52x = BLx - 1
SP52y = BLy + (RTy - BLy) / 1.42
SP53x = BLx
SP53y = BLy + (RTy - BLy) / 1.35

SP5x = array.from(SP51x, SP52x, SP53x)
SP5y = array.from(SP51y, SP52y, SP53y)
// ------------------------------ SPOT 5 ------------------------------

// ------------------------------ SPOT 6 ------------------------------
SP61x = BLx
SP61y = BLy + (RTy - BLy) / 1.15
SP62x = BLx + 2
SP62y = BLy + (RTy - BLy) / 1.25
SP63x = BLx + 4
SP63y = BLy + (RTy - BLy) / 1.15

SP6x = array.from(SP61x, SP62x, SP63x)
SP6y = array.from(SP61y, SP62y, SP63y)
// ------------------------------ SPOT 6 ------------------------------

// ------------------------------ SPOT 7 ------------------------------
SP71x = RTx - 8
SP71y = BLy + (RTy - BLy) / 1.25
SP72x = RTx - 6
SP72y = BLy + (RTy - BLy) / 1.15
SP73x = RTx - 4
SP73y = BLy + (RTy - BLy) / 1.25

SP7x = array.from(SP71x, SP72x, SP73x)
SP7y = array.from(SP71y, SP72y, SP73y)
// ------------------------------ SPOT 7 ------------------------------

// ------------------------------ BELT 1 ------------------------------
B11x = P2x + 4
B11y = P3y + (P1y - P2y) / 1.8
B12x = P2x + 11
B12y = P3y + (P1y - P2y) / 1.8
B13x = P2x + 11
B13y = P3y + (P1y - P2y) / 1.4
B14x = P2x + 4
B14y = P3y + (P1y - P2y) / 1.4

BL1x = array.from(B11x, B12x, B13x, B14x)
BL1y = array.from(B11y, B12y, B13y, B14y)
// ------------------------------ BELT 1 ------------------------------

// ------------------------------ BELT 2 ------------------------------
B21x = P2x + 17
B21y = P3y + (P1y - P2y) / 1.8
B22x = P2x + 23
B22y = P3y + (P1y - P2y) / 1.8
B23x = P2x + 23
B23y = P3y + (P1y - P2y) / 1.4
B24x = P2x + 17
B24y = P3y + (P1y - P2y) / 1.4

BL2x = array.from(B21x, B22x, B23x, B24x)
BL2y = array.from(B21y, B22y, B23y, B24y)
// ------------------------------ BELT 2 ------------------------------

// ------------------------------ BELT 3 ------------------------------
B31x = P2x + 27
B31y = P3y + (P1y - P2y) / 1.8
B32x = P2x + 33
B32y = P3y + (P1y - P2y) / 1.8
B33x = P2x + 33
B33y = P3y + (P1y - P2y) / 1.4
B34x = P2x + 27
B34y = P3y + (P1y - P2y) / 1.4

BL3x = array.from(B31x, B32x, B33x, B34x)
BL3y = array.from(B31y, B32y, B33y, B34y)
// ------------------------------ BELT 3 ------------------------------

// ------------------------------ BELT 4 ------------------------------
B41x = P2x + 39
B41y = P3y + (P1y - P2y) / 1.8
B42x = P2x + 46
B42y = P3y + (P1y - P2y) / 1.8
B43x = P2x + 46
B43y = P3y + (P1y - P2y) / 1.4
B44x = P2x + 39
B44y = P3y + (P1y - P2y) / 1.4

BL4x = array.from(B41x, B42x, B43x, B44x)
BL4y = array.from(B41y, B42y, B43y, B44y)
// ------------------------------ BELT 4 ------------------------------

if barstate.islastconfirmedhistory
    // ------------------------------ BODY ------------------------------
    var body = array.new<chart.point>()
    
    for i = 0 to Lx.size() - 1
        body.push(chart.point.from_index(Lx.get(i), Ly.get(i)))
        
    for i = 0 to Bx.size() - 1
        body.push(chart.point.from_index(Bx.get(i), By.get(i)))
        
    for i = 0 to Rx.size() - 1
        body.push(chart.point.from_index(Rx.get(i), Ry.get(i)))
        
    for i = 0 to Tx.size() - 1
        body.push(chart.point.from_index(Tx.get(i), Ty.get(i)))
// ------------------------------ BODY ------------------------------

// ------------------------------ LEFT EYE - OUTLINE ------------------------------
    var Leye = array.new<chart.point>()
    
    for i = 0 to LEx.size() - 1
        Leye.push(chart.point.from_index(LEx.get(i), LEy.get(i)))
// ------------------------------ LEFT EYE - OUTLINE ------------------------------

// ------------------------------ RIGHT EYE - OUTLINE ------------------------------
    var Reye = array.new<chart.point>()
    
    for i = 0 to REx.size() - 1
        Reye.push(chart.point.from_index(REx.get(i), REy.get(i)))
// ------------------------------ RIGHT EYE - OUTLINE ------------------------------

// ------------------------------ LEFT EYE - IRIS ------------------------------
    var LIeye = array.new<chart.point>()
    
    for i = 0 to LEIx.size() - 1
        LIeye.push(chart.point.from_index(LEIx.get(i), LEIy.get(i)))
// ------------------------------ LEFT EYE - IRIS ------------------------------

// ------------------------------ RIGHT EYE - IRIS ------------------------------
    var RIeye = array.new<chart.point>()
    
    for i = 0 to REIx.size() - 1
        RIeye.push(chart.point.from_index(REIx.get(i), REIy.get(i)))
// ------------------------------ RIGHT EYE - IRIS ------------------------------

// ------------------------------ LEFT EYE - PUPIL ------------------------------
    var LPeye = array.new<chart.point>()
    
    for i = 0 to LEPx.size() - 1
        LPeye.push(chart.point.from_index(LEPx.get(i), LEPy.get(i)))
// ------------------------------ LEFT EYE - PUPIL ------------------------------

// ------------------------------ RIGHT EYE - PUPIL ------------------------------
    var RPeye = array.new<chart.point>()
    
    for i = 0 to REPx.size() - 1
        RPeye.push(chart.point.from_index(REPx.get(i), REPy.get(i)))
// ------------------------------ RIGHT EYE - PUPIL ------------------------------

// ------------------------------ LEFT EYELASHES ------------------------------
    var LEL = array.new<chart.point>()
    
    for i = 0 to LELx.size() - 1
        LEL.push(chart.point.from_index(LELx.get(i), LELy.get(i)))
// ------------------------------ LEFT EYELASHES ------------------------------

// ------------------------------ RIGHT EYELASHES ------------------------------
    var REL = array.new<chart.point>()
    
    for i = 0 to RELx.size() - 1
        REL.push(chart.point.from_index(RELx.get(i), RELy.get(i)))
// ------------------------------ RIGHT EYELASHES ------------------------------

// ------------------------------ NOSE ------------------------------
    var nose = array.new<chart.point>()
    
    for i = 0 to Nx.size() - 1
        nose.push(chart.point.from_index(Nx.get(i), Ny.get(i)))
// ------------------------------ NOSE ------------------------------

// ------------------------------ LEFT CHEEK ------------------------------
    var Lcheek = array.new<chart.point>()
    
    for i = 0 to LCx.size() - 1
        Lcheek.push(chart.point.from_index(LCx.get(i), LCy.get(i)))
// ------------------------------ LEFT CHEEK ------------------------------

// ------------------------------ RIGHT CHEEK ------------------------------
    var Rcheek = array.new<chart.point>()
    
    for i = 0 to RCx.size() - 1
        Rcheek.push(chart.point.from_index(RCx.get(i), RCy.get(i)))
// ------------------------------ RIGHT CHEEK ------------------------------

// ------------------------------ Smile ------------------------------
    var smile = array.new<chart.point>()
    
    for i = 0 to Sx.size() - 1
        smile.push(chart.point.from_index(Sx.get(i), Sy.get(i)))
// ------------------------------ Smile ------------------------------

// ------------------------------ LEFT CHEEK ------------------------------
    var LD = array.new<chart.point>()
    
    for i = 0 to LDx.size() - 1
        LD.push(chart.point.from_index(LDx.get(i), LDy.get(i)))
// ------------------------------ LEFT CHEEK ------------------------------

// ------------------------------ RIGHT CHEEK ------------------------------
    var RD = array.new<chart.point>()
    
    for i = 0 to RDx.size() - 1
        RD.push(chart.point.from_index(RDx.get(i), RDy.get(i)))
// ------------------------------ RIGHT CHEEK ------------------------------

// ------------------------------ LEFT TOOTH ------------------------------
    var LT = array.new<chart.point>()
    
    for i = 0 to LTx.size() - 1
        LT.push(chart.point.from_index(LTx.get(i), LTy.get(i)))
// ------------------------------ LEFT TOOTH ------------------------------

// ------------------------------ LEFT TOOTH ------------------------------
    var RT = array.new<chart.point>()
    
    for i = 0 to Rtoothx.size() - 1
        RT.push(chart.point.from_index(Rtoothx.get(i), Rtoothy.get(i)))
// ------------------------------ LEFT TOOTH ------------------------------

// ------------------------------ CHIN ------------------------------
    var CH = array.new<chart.point>()
    
    for i = 0 to Cx.size() - 1
        CH.push(chart.point.from_index(Cx.get(i), Cy.get(i)))
// ------------------------------ CHIN ------------------------------

// ------------------------------ SHIRT ------------------------------
    var SH = array.new<chart.point>()
    
    for i = 0 to SHx.size() - 1
        SH.push(chart.point.from_index(SHx.get(i), SHy.get(i)))
// ------------------------------ SHIRT ------------------------------

// ------------------------------ COLLAR ------------------------------
    var CL = array.new<chart.point>()
    
    for i = 0 to CLx.size() - 1
        CL.push(chart.point.from_index(CLx.get(i), CLy.get(i)))
// ------------------------------ COLLAR ------------------------------

// ------------------------------ TIE ------------------------------
    var TI = array.new<chart.point>()
    
    for i = 0 to TIx.size() - 1
        TI.push(chart.point.from_index(TIx.get(i), TIy.get(i)))
// ------------------------------ TIE ------------------------------

// ------------------------------ PANTS ------------------------------
    var P = array.new<chart.point>()
    
    for i = 0 to Px.size() - 1
        P.push(chart.point.from_index(Px.get(i), Py.get(i)))
// ------------------------------ PANTS ------------------------------

// ------------------------------ LEFT PANT LEG ------------------------------
    var LP = array.new<chart.point>()
    
    for i = 0 to LPx.size() - 1
        LP.push(chart.point.from_index(LPx.get(i), LPy.get(i)))
// ------------------------------ LEFT PANT LEG ------------------------------

// ------------------------------ RIGHT PANT LEG ------------------------------
    var RP = array.new<chart.point>()
    
    for i = 0 to RPx.size() - 1
        RP.push(chart.point.from_index(RPx.get(i), RPy.get(i)))
// ------------------------------ RIGHT PANT LEG ------------------------------

// ------------------------------ LEFT LEG ------------------------------
    var LL = array.new<chart.point>()
    
    for i = 0 to LLx.size() - 1
        LL.push(chart.point.from_index(LLx.get(i), LLy.get(i)))
// ------------------------------ LEFT LEG ------------------------------

// ------------------------------ RIGHT LEG ------------------------------
    var RL = array.new<chart.point>()
    
    for i = 0 to RLx.size() - 1
        RL.push(chart.point.from_index(RLx.get(i), RLy.get(i)))
// ------------------------------ RIGHT LEG ------------------------------

// ------------------------------ LEFT SOCK ------------------------------
    var LS = array.new<chart.point>()
    
    for i = 0 to LSx.size() - 1
        LS.push(chart.point.from_index(LSx.get(i), LSy.get(i)))
// ------------------------------ LEFT SOCK ------------------------------

// ------------------------------ RIGHT SOCK ------------------------------
    var RS = array.new<chart.point>()
    
    for i = 0 to RSx.size() - 1
        RS.push(chart.point.from_index(RSx.get(i), RSy.get(i)))
// ------------------------------ RIGHT SOCK ------------------------------

// ------------------------------ LEFT SHOULDER ------------------------------
    var LSH = array.new<chart.point>()
    
    for i = 0 to LSHx.size() - 1
        LSH.push(chart.point.from_index(LSHx.get(i), LSHy.get(i)))
// ------------------------------ LEFT SHOULDER ------------------------------

// ------------------------------ RIGHT SHOULDER ------------------------------
    var RSH = array.new<chart.point>()
    
    for i = 0 to RSHx.size() - 1
        RSH.push(chart.point.from_index(RSHx.get(i), RSHy.get(i)))
// ------------------------------ RIGHT SHOULDER ------------------------------

// ------------------------------ LEFT SHOULDER ------------------------------
    var LA = array.new<chart.point>()
    
    for i = 0 to LAx.size() - 1
        LA.push(chart.point.from_index(LAx.get(i), LAy.get(i)))
// ------------------------------ LEFT SHOULDER ------------------------------

// ------------------------------ RIGHT SHOULDER ------------------------------
    var RA = array.new<chart.point>()
    
    for i = 0 to RAx.size() - 1
        RA.push(chart.point.from_index(RAx.get(i), RAy.get(i)))
// ------------------------------ RIGHT SHOULDER ------------------------------

// ------------------------------ LEFT SHOE BULB ------------------------------
    var LSO = array.new<chart.point>()
    
    for i = 0 to LSOx.size() - 1
        LSO.push(chart.point.from_index(LSOx.get(i), LSOy.get(i)))
// ------------------------------ LEFT SHOE BULB ------------------------------

// ------------------------------ RIGHT SHOE BULB ------------------------------
    var RSO = array.new<chart.point>()
    
    for i = 0 to RSOx.size() - 1
        RSO.push(chart.point.from_index(RSOx.get(i), RSOy.get(i)))
// ------------------------------ RIGHT SHOE BULB ------------------------------

// ------------------------------ LEFT SHOE BACK ------------------------------
    var LSB = array.new<chart.point>()
    
    for i = 0 to LSBx.size() - 1
        LSB.push(chart.point.from_index(LSBx.get(i), LSBy.get(i)))
// ------------------------------ LEFT SHOE BACK ------------------------------

// ------------------------------ RIGHT SHOE BACK ------------------------------
    var RSB = array.new<chart.point>()
    
    for i = 0 to RSBx.size() - 1
        RSB.push(chart.point.from_index(RSBx.get(i), RSBy.get(i)))
// ------------------------------ RIGHT SHOE BACK ------------------------------

// ------------------------------ LEFT HAND ------------------------------
    var LH = array.new<chart.point>()
    
    for i = 0 to LHx.size() - 1
        LH.push(chart.point.from_index(LHx.get(i), LHy.get(i)))
// ------------------------------ LEFT HAND ------------------------------

// ------------------------------ RIGHT HAND ------------------------------
    var RH = array.new<chart.point>()
    
    for i = 0 to RHx.size() - 1
        RH.push(chart.point.from_index(RHx.get(i), RHy.get(i)))
// ------------------------------ RIGHT HAND ------------------------------

// ------------------------------ SPOT 1 ------------------------------
    var SP1 = array.new<chart.point>()
    
    for i = 0 to SP1x.size() - 1
        SP1.push(chart.point.from_index(SP1x.get(i), SP1y.get(i)))
// ------------------------------ SPOT 1 ------------------------------

// ------------------------------ SPOT 2 ------------------------------
    var SP2 = array.new<chart.point>()
    
    for i = 0 to SP2x.size() - 1
        SP2.push(chart.point.from_index(SP2x.get(i), SP2y.get(i)))
// ------------------------------ SPOT 2 ------------------------------

// ------------------------------ SPOT 3 ------------------------------
    var SP3 = array.new<chart.point>()
    
    for i = 0 to SP3x.size() - 1
        SP3.push(chart.point.from_index(SP3x.get(i), SP3y.get(i)))
// ------------------------------ SPOT 3 ------------------------------

// ------------------------------ SPOT 4 ------------------------------
    var SP4 = array.new<chart.point>()
    
    for i = 0 to SP4x.size() - 1
        SP4.push(chart.point.from_index(SP4x.get(i), SP4y.get(i)))
// ------------------------------ SPOT 4 ------------------------------

// ------------------------------ SPOT 5 ------------------------------
    var SP5 = array.new<chart.point>()
    
    for i = 0 to SP5x.size() - 1
        SP5.push(chart.point.from_index(SP5x.get(i), SP5y.get(i)))
// ------------------------------ SPOT 5 ------------------------------

// ------------------------------ SPOT 6 ------------------------------
    var SP6 = array.new<chart.point>()
    
    for i = 0 to SP6x.size() - 1
        SP6.push(chart.point.from_index(SP6x.get(i), SP6y.get(i)))
// ------------------------------ SPOT 6 ------------------------------

// ------------------------------ SPOT 7 ------------------------------
    var SP7 = array.new<chart.point>()
    
    for i = 0 to SP2x.size() - 1
        SP7.push(chart.point.from_index(SP7x.get(i), SP7y.get(i)))
// ------------------------------ SPOT 7 ------------------------------

// ------------------------------ BELT 1 ------------------------------
    var BL1 = array.new<chart.point>()
    
    for i = 0 to BL1x.size() - 1
        BL1.push(chart.point.from_index(BL1x.get(i), BL1y.get(i)))
// ------------------------------ BELT 1 ------------------------------

// ------------------------------ BELT 2 ------------------------------
    var BL2 = array.new<chart.point>()
    
    for i = 0 to BL2x.size() - 1
        BL2.push(chart.point.from_index(BL2x.get(i), BL2y.get(i)))
// ------------------------------ BELT 2 ------------------------------

// ------------------------------ BELT 3 ------------------------------
    var BL3 = array.new<chart.point>()
    
    for i = 0 to BL3x.size() - 1
        BL3.push(chart.point.from_index(BL3x.get(i), BL3y.get(i)))
// ------------------------------ BELT 3 ------------------------------

// ------------------------------ BELT 4 ------------------------------
    var BL4 = array.new<chart.point>()
    
    for i = 0 to BL4x.size() - 1
        BL4.push(chart.point.from_index(BL4x.get(i), BL4y.get(i)))
// ------------------------------ BELT 4 ------------------------------
    
    polyline.new(LA, curved = false, closed = true, fill_color = body_color, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RA, curved = false, closed = true, fill_color = body_color, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(LSH, curved = true, closed = true, fill_color = white, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RSH, curved = true, closed = true, fill_color = white, line_color = black, line_width = 3, xloc = xloc.bar_index) 

    polyline.new(LL, curved = false, closed = true, fill_color = body_color, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RL, curved = false, closed = true, fill_color = body_color, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(LS, curved = false, closed = true, fill_color = white, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RS, curved = false, closed = true, fill_color = white, line_color = black, line_width = 3, xloc = xloc.bar_index) 

    polyline.new(LP, curved = false, closed = true, fill_color = pants_lower, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RP, curved = false, closed = true, fill_color = pants_lower, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(P, curved = false, closed = true, fill_color = pants_upper, line_color = black, line_width = 3, xloc = xloc.bar_index) 

    polyline.new(BL1, curved = false, closed = true, fill_color = black, line_color = black, line_width = 5, xloc = xloc.bar_index)
    polyline.new(BL2, curved = false, closed = true, fill_color = black, line_color = black, line_width = 5, xloc = xloc.bar_index)
    polyline.new(BL3, curved = false, closed = true, fill_color = black, line_color = black, line_width = 5, xloc = xloc.bar_index)
    polyline.new(BL4, curved = false, closed = true, fill_color = black, line_color = black, line_width = 5, xloc = xloc.bar_index)

    polyline.new(SH, curved = false, closed = true, fill_color = white, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(TI, curved = false, closed = true, fill_color = red, line_color = black, line_width = 3, xloc = xloc.bar_index)     
    polyline.new(CL, curved = false, closed = true, fill_color = white, line_color = black, line_width = 3, xloc = xloc.bar_index)
    
    polyline.new(body, curved = true, closed = true, fill_color = body_color, line_color = outline_color, line_width = 3, xloc = xloc.bar_index) 

    polyline.new(LEL, curved = false, closed = false, fill_color = na, line_color = black, line_width = 6, xloc = xloc.bar_index) 
    polyline.new(REL, curved = false, closed = false, fill_color = na, line_color = black, line_width = 6, xloc = xloc.bar_index) 

    polyline.new(Leye, curved = true, closed = true, fill_color = white, line_color = black, line_width = 2, xloc = xloc.bar_index) 
    polyline.new(Reye, curved = true, closed = true, fill_color = white, line_color = black, line_width = 2, xloc = xloc.bar_index) 

    polyline.new(LIeye, curved = true, closed = true, fill_color = iris, line_color = black, line_width = 2, xloc = xloc.bar_index) 
    polyline.new(RIeye, curved = true, closed = true, fill_color = iris, line_color = black, line_width = 2, xloc = xloc.bar_index) 
    
    polyline.new(LPeye, curved = true, closed = true, fill_color = black, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RPeye, curved = true, closed = true, fill_color = black, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(Lcheek, curved = true, closed = false, fill_color = body_color, line_color = red, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(Rcheek, curved = true, closed = false, fill_color = body_color, line_color = red, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(LT, curved = false, closed = false, fill_color = white, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RT, curved = false, closed = false, fill_color = white, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(smile, curved = true, closed = false, fill_color = body_color, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(nose, curved = true, closed = false, fill_color = body_color, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(LD, curved = true, closed = false, fill_color = na, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RD, curved = true, closed = false, fill_color = na, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(CH, curved = true, closed = false, fill_color = na, line_color = red, line_width = 3, xloc = xloc.bar_index)  
    
    polyline.new(LSO, curved = true, closed = true, fill_color = black, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RSO, curved = true, closed = true, fill_color = black, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(LSB, curved = false, closed = true, fill_color = black, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RSB, curved = false, closed = true, fill_color = black, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(LH, curved = true, closed = true, fill_color = body_color, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(RH, curved = true, closed = true, fill_color = body_color, line_color = black, line_width = 3, xloc = xloc.bar_index) 
    
    polyline.new(SP1, curved = true, closed = true, fill_color = outline_color, line_color = outline_color, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(SP2, curved = true, closed = true, fill_color = outline_color, line_color = outline_color, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(SP3, curved = true, closed = true, fill_color = outline_color, line_color = outline_color, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(SP4, curved = true, closed = true, fill_color = outline_color, line_color = outline_color, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(SP5, curved = true, closed = true, fill_color = outline_color, line_color = outline_color, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(SP6, curved = true, closed = true, fill_color = outline_color, line_color = outline_color, line_width = 3, xloc = xloc.bar_index) 
    polyline.new(SP7, curved = true, closed = true, fill_color = outline_color, line_color = outline_color, line_width = 3, xloc = xloc.bar_index)