# dividing a RSI by a slower RSI "using a ratio of 1 to 4"gives a base line of 1 any reading above 1 is bullish and colored Cyan for short term Blue for longer term. Any Reading below 1 is bearish and colored magenta for short term Red for a longer term pertains to Lines 1,4,7,10,13,16,19,22,25,28,31,34,& 37.
#Using 4 colors to determine Bullish Rising "Green", Bullish Falling "Dark_Green", Bearish Rising "Light_Red", and Bearish Falling "Dark_Red" Pertains to Lines 2,5,8,11,14,17,20,23,26,29,32,35,38
#using Standard Deviation channels on the faster RSI, A yellow dot shows when the RSI is above the Upper dev Channel. An Orange Dot shows when the RSI is below the Lower Dev Channel. Pertains to Lines 3,6,9,12,15,18,21,24,27,30,33,36,39
#Changing the APC input from 0 to which ever line you input will change the price color to reflect the selected line. Pertains to all Lines
input period1 = 3;
input period2 = 5;
input period3 = 8;
input period4 = 10;
input period5 = 12;
input period6 = 15;
input period7 = 20;
input period8 = 30;
input period9 = 32;
input period10 = 35;
input period11 = 40;
input period12 = 45;
input period13 = 48;
input period14 = 50;
input period15 = 60;
input period16 = 80;
input period17 = 120;
input period18 = 140;
input period19 = 160;
input period20 = 180;
input period21 = 200;
input period22 = 240;
input APC = 0;
Input dotsize = 3;
def Price = (open + close) / 2;
input averageType = AverageType.WILDERS;
def NetChgAvgA = MovingAverage(averageType, Price - Price[1], period1);
def TotChgAvgA = MovingAverage(averageType, AbsValue(Price - Price[1]), period1);
def ChgRatioA = if TotChgAvgA != 0 then NetChgAvgA / TotChgAvgA else 0;
def RSIA = 50 * (ChgRatioA + 1);
def NetChgAvgB = MovingAverage(averageType, Price - Price[1], period2);
def TotChgAvgB = MovingAverage(averageType, AbsValue(Price - Price[1]), period2);
def ChgRatioB = if TotChgAvgB != 0 then NetChgAvgB / TotChgAvgB else 0;
def RSIB = 50 * (ChgRatioB + 1);
def NetChgAvgC = MovingAverage(averageType, Price - Price[1], period3);
def TotChgAvgC = MovingAverage(averageType, AbsValue(Price - Price[1]), period3);
def ChgRatioC = if TotChgAvgC != 0 then NetChgAvgC / TotChgAvgC else 0;
def RSIC = 50 * (ChgRatioC + 1);
def NetChgAvgD = MovingAverage(averageType, Price - Price[1], period4);
def TotChgAvgD = MovingAverage(averageType, AbsValue(Price - Price[1]), period4);
def ChgRatioD = if TotChgAvgD != 0 then NetChgAvgD / TotChgAvgD else 0;
def RSID = 50 * (ChgRatioD + 1);
def NetChgAvgE = MovingAverage(averageType, Price - Price[1], period5);
def TotChgAvgE = MovingAverage(averageType, AbsValue(Price - Price[1]), period5);
def ChgRatioE = if TotChgAvgE != 0 then NetChgAvgE / TotChgAvgE else 0;
def RSIE = 50 * (ChgRatioE + 1);
def NetChgAvgF = MovingAverage(averageType, Price - Price[1], period6);
def TotChgAvgF = MovingAverage(averageType, AbsValue(Price - Price[1]), period6);
def ChgRatioF = if TotChgAvgF != 0 then NetChgAvgF / TotChgAvgF else 0;
def RSIF = 50 * (ChgRatioF + 1);
def NetChgAvgG = MovingAverage(averageType, Price - Price[1], period7);
def TotChgAvgG = MovingAverage(averageType, AbsValue(Price - Price[1]), period7);
def ChgRatioG = if TotChgAvgG != 0 then NetChgAvgG / TotChgAvgG else 0;
def RSIG = 50 * (ChgRatioG + 1);
def NetChgAvgH = MovingAverage(averageType, Price - Price[1], period8);
def TotChgAvgH = MovingAverage(averageType, AbsValue(Price - Price[1]), period8);
def ChgRatioH = if TotChgAvgH != 0 then NetChgAvgH / TotChgAvgH else 0;
def RSIH = 50 * (ChgRatioH + 1);
def NetChgAvgI = MovingAverage(averageType, Price - Price[1], period9);
def TotChgAvgI = MovingAverage(averageType, AbsValue(Price - Price[1]), period9);
def ChgRatioI = if TotChgAvgI != 0 then NetChgAvgI / TotChgAvgI else 0;
def RSII = 50 * (ChgRatioI + 1);
def NetChgAvgJ = MovingAverage(averageType, Price - Price[1], period10);
def TotChgAvgJ = MovingAverage(averageType, AbsValue(Price - Price[1]), period10);
def ChgRatioJ = if TotChgAvgJ != 0 then NetChgAvgJ / TotChgAvgJ else 0;
def RSIJ = 50 * (ChgRatioJ + 1);
def NetChgAvgK = MovingAverage(averageType, Price - Price[1], period11);
def TotChgAvgK = MovingAverage(averageType, AbsValue(Price - Price[1]), period11);
def ChgRatioK = if TotChgAvgK != 0 then NetChgAvgK / TotChgAvgK else 0;
def RSIK = 50 * (ChgRatioK + 1);
def NetChgAvgL = MovingAverage(averageType, Price - Price[1], period12);
def TotChgAvgL = MovingAverage(averageType, AbsValue(Price - Price[1]), period12);
def ChgRatioL = if TotChgAvgL != 0 then NetChgAvgL / TotChgAvgL else 0;
def RSIL = 50 * (ChgRatioL + 1);
def NetChgAvgM = MovingAverage(averageType, Price - Price[1], period13);
def TotChgAvgM = MovingAverage(averageType, AbsValue(Price - Price[1]), period13);
def ChgRatioM = if TotChgAvgM != 0 then NetChgAvgM / TotChgAvgM else 0;
def RSIM = 50 * (ChgRatioM + 1);
def NetChgAvgN = MovingAverage(averageType, Price - Price[1], period14);
def TotChgAvgN = MovingAverage(averageType, AbsValue(Price - Price[1]), period14);
def ChgRatioN = if TotChgAvgN != 0 then NetChgAvgN / TotChgAvgN else 0;
def RSIN = 50 * (ChgRatioN + 1);
def NetChgAvgO = MovingAverage(averageType, Price - Price[1], period15);
def TotChgAvgO = MovingAverage(averageType, AbsValue(Price - Price[1]), period15);
def ChgRatioO = if TotChgAvgO != 0 then NetChgAvgO / TotChgAvgO else 0;
def RSIO = 50 * (ChgRatioO + 1);
def NetChgAvgP = MovingAverage(averageType, Price - Price[1], period16);
def TotChgAvgP = MovingAverage(averageType, AbsValue(Price - Price[1]), period16);
def ChgRatioP = if TotChgAvgP != 0 then NetChgAvgP / TotChgAvgP else 0;
def RSIP = 50 * (ChgRatioP + 1);
def NetChgAvgQ = MovingAverage(averageType, Price - Price[1], period17);
def TotChgAvgQ = MovingAverage(averageType, AbsValue(Price - Price[1]), period17);
def ChgRatioQ = if TotChgAvgQ != 0 then NetChgAvgQ / TotChgAvgQ else 0;
def RSIQ = 50 * (ChgRatioQ + 1);
def NetChgAvgR = MovingAverage(averageType, Price - Price[1], period18);
def TotChgAvgR = MovingAverage(averageType, AbsValue(Price - Price[1]), period18);
def ChgRatioR = if TotChgAvgR != 0 then NetChgAvgR / TotChgAvgR else 0;
def RSIR = 50 * (ChgRatioR + 1);
def NetChgAvgS = MovingAverage(averageType, Price - Price[1], period19);
def TotChgAvgS = MovingAverage(averageType, AbsValue(Price - Price[1]), period19);
def ChgRatioS = if TotChgAvgS != 0 then NetChgAvgS / TotChgAvgS else 0;
def RSIS = 50 * (ChgRatioS + 1);
def NetChgAvgT = MovingAverage(averageType, Price - Price[1], period20);
def TotChgAvgT = MovingAverage(averageType, AbsValue(Price - Price[1]), period20);
def ChgRatioT = if TotChgAvgT != 0 then NetChgAvgT / TotChgAvgT else 0;
def RSIT = 50 * (ChgRatioT + 1);
def NetChgAvgU = MovingAverage(averageType, Price - Price[1], period21);
def TotChgAvgU = MovingAverage(averageType, AbsValue(Price - Price[1]), period21);
def ChgRatioU = if TotChgAvgU != 0 then NetChgAvgU / TotChgAvgU else 0;
def RSIU = 50 * (ChgRatioU + 1);
def NetChgAvgV = MovingAverage(averageType, Price - Price[1], period22);
def TotChgAvgV = MovingAverage(averageType, AbsValue(Price - Price[1]), period22);
def ChgRatioV = if TotChgAvgV != 0 then NetChgAvgV / TotChgAvgV else 0;
def RSIV = 50 * (ChgRatioV + 1);
def Diff1 = RSIA/RSIE;
def Diff2 = RSIB/RSIG;
def Diff3 = RSIC/RSII;
def Diff4 = RSID/RSIK;
def Diff5 = RSIE/RSIM;
def Diff6 = RSIF/RSIO;
def Diff7 = RSIG/RSIP;
def Diff8 = RSIH/RSIS;
def Diff9 = RSIJ/RSIR;
def Diff10 = RSIK/RSIS;
def Diff11 = RSIL/RSIT;
def Diff12 = RSIN/RSIU;
def Diff13 = RSIO/RSIV;
def UZA = Average(Diff1,34) + (1.3185*StDev(Diff1,34));
def LZA = Average(Diff1,34) - (1.3185*StDev(Diff1,34));
def UZB = Average(Diff2,34) + (1.3185*StDev(Diff2,34));
def LZB = Average(Diff2,34) - (1.3185*StDev(Diff2,34));
def UZC = Average(Diff3,34) + (1.3185*StDev(Diff3,34));
def LZC = Average(Diff3,34) - (1.3185*StDev(Diff3,34));
def UZD = Average(Diff4,34) + (1.3185*StDev(Diff4,34));
def LZD = Average(Diff4,34) - (1.3185*StDev(Diff4,34));
def UZE = Average(Diff5,34) + (1.3185*StDev(Diff5,34));
def LZE = Average(Diff5,34) - (1.3185*StDev(Diff5,34));
def UZF = Average(Diff6,34) + (1.3185*StDev(Diff6,34));
def LZF = Average(Diff6,34) - (1.3185*StDev(Diff6,34));
def UZG = Average(Diff7,34) + (1.3185*StDev(Diff7,34));
def LZG = Average(Diff7,34) - (1.3185*StDev(Diff7,34));
def UZH = Average(Diff8,34) + (1.3185*StDev(Diff8,34));
def LZH = Average(Diff8,34) - (1.3185*StDev(Diff8,34));
def UZI = Average(Diff9,34) + (1.3185*StDev(Diff9,34));
def LZI = Average(Diff9,34) - (1.3185*StDev(Diff9,34));
def UZJ = Average(Diff10,34) + (1.3185*StDev(Diff10,34));
def LZJ = Average(Diff10,34) - (1.3185*StDev(Diff10,34));
def UZK = Average(Diff11,34) + (1.3185*StDev(Diff11,34));
def LZK = Average(Diff11,34) - (1.3185*StDev(Diff11,34));
def UZL = Average(Diff12,34) + (1.3185*StDev(Diff12,34));
def LZL = Average(Diff12,34) - (1.3185*StDev(Diff12,34));
def UZM = Average(Diff13,34) + (1.3185*StDev(Diff13,34));
def LZM = Average(Diff13,34) - (1.3185*StDev(Diff13,34));
Def Con1A = Diff1 >= 1;
Def Con2A = Diff1 < 1;
Def Con3A = Diff1 >= Diff1[1];
Def Con4A = Diff1 < Diff1[1];
Def Con1B = Diff2 >= 1;
Def Con2B = Diff2 < 1;
Def Con3B = Diff2 >= Diff2[1];
Def Con4B = Diff2 < Diff2[1];
Def Con1C = Diff3 >= 1;
Def Con2C = Diff3 < 1;
Def Con3C = Diff3 >= Diff3[1];
Def Con4C = Diff3 < Diff3[1];
Def Con1D = Diff4 >= 1;
Def Con2D = Diff4 < 1;
Def Con3D = Diff4 >= Diff4[1];
Def Con4D = Diff4 < Diff4[1];
Def Con1E = Diff5 >= 1;
Def Con2E = Diff5 < 1;
Def Con3E = Diff5 >= Diff5[1];
Def Con4E = Diff5 < Diff5[1];
Def Con1F = Diff6 >= 1;
Def Con2F = Diff6 < 1;
Def Con3F = Diff6 >= Diff6[1];
Def Con4F = Diff6 < Diff6[1];
Def Con1G = Diff7 >= 1;
Def Con2G = Diff7 < 1;
Def Con3G = Diff7 >= Diff7[1];
Def Con4G = Diff7 < Diff7[1];
Def Con1H = Diff8 >= 1;
Def Con2H = Diff8 < 1;
Def Con3H = Diff8 >= Diff8[1];
Def Con4H = Diff8 < Diff8[1];
Def Con1I = Diff9 >= 1;
Def Con2I = Diff9 < 1;
Def Con3I = Diff9 >= Diff9[1];
Def Con4I = Diff9 < Diff9[1];
Def Con1J = Diff10 >= 1;
Def Con2J = Diff10 < 1;
Def Con3J = Diff10 >= Diff10[1];
Def Con4J = Diff10 < Diff10[1];
Def Con1K = Diff11 >= 1;
Def Con2K = Diff11 < 1;
Def Con3K = Diff11 >= Diff11[1];
Def Con4K = Diff11 < Diff11[1];
Def Con1L = Diff12 >= 1;
Def Con2L = Diff12 < 1;
Def Con3L = Diff12 >= Diff12[1];
Def Con4L = Diff12 < Diff12[1];
Def Con1M = Diff13 >= 1;
Def Con2M = Diff13 < 1;
Def Con3M = Diff13 >= Diff13[1];
Def Con4M = Diff13 < Diff13[1];
plot A1_Dot = if IsNaN(close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A1_Dot.SetLineWeight(Dotsize);
A1_Dot.AssignValueColor(if Diff1>=1 then Color.CYAN else Color.Magenta);
plot A2_Dot = if IsNaN(close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A2_Dot.SetLineWeight(Dotsize);
A2_Dot.AssignValueColor(if Con1A and Con3A then Color.Green else if Con1A and Con4A then Color.Dark_Green else if Con2A and Con3A then Color.Light_Red else if Con2A and Con4A then Color.Dark_Red else Color.Black);
plot A3_Dot = if IsNaN(close) then Double.NaN else 3;
A3_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A3_Dot.SetLineWeight(Dotsize+1);
A3_Dot.AssignValueColor(if Diff1>=UZA then Color.YELLOW else IF Diff1 < LZA then Color.Dark_Orange else Color.Black);
plot A4_Dot = if IsNaN(close) then Double.NaN else 4;
A4_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A4_Dot.SetLineWeight(Dotsize);
A4_Dot.AssignValueColor(if Diff2>=1 then Color.CYAN else Color.Magenta);
plot A5_Dot = if IsNaN(close) then Double.NaN else 5;
A5_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A5_Dot.SetLineWeight(Dotsize);
A5_Dot.AssignValueColor(if Con1B and Con3B then Color.Green else if Con1B and Con4B then Color.Dark_Green else if Con2B and Con3B then Color.Light_Red else if Con2B and Con4B then Color.Dark_Red else Color.Black);
plot A6_Dot = if IsNaN(close) then Double.NaN else 6;
A6_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A6_Dot.SetLineWeight(Dotsize+1);
A6_Dot.AssignValueColor(if Diff2>=UZB then Color.YELLOW else IF Diff2 < LZB then Color.Dark_Orange else Color.Black);
plot A7_Dot = if IsNaN(close) then Double.NaN else 7;
A7_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A7_Dot.SetLineWeight(Dotsize);
A7_Dot.AssignValueColor(if Diff3>=1 then Color.CYAN else Color.Magenta);
plot A8_Dot = if IsNaN(close) then Double.NaN else 8;
A8_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A8_Dot.SetLineWeight(Dotsize);
A8_Dot.AssignValueColor(if Con1C and Con3C then Color.Green else if Con1C and Con4C then Color.Dark_Green else if Con2C and Con3C then Color.Light_Red else if Con2C and Con4C then Color.Dark_Red else Color.Black);
plot A9_Dot = if IsNaN(close) then Double.NaN else 9;
A9_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A9_Dot.SetLineWeight(Dotsize+1);
A9_Dot.AssignValueColor(if Diff3>=UZC then Color.YELLOW else IF Diff3 < LZC then Color.Dark_Orange else Color.Black);
plot A10_Dot = if IsNaN(close) then Double.NaN else 10;
A10_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A10_Dot.SetLineWeight(Dotsize);
A10_Dot.AssignValueColor(if Diff4>=1 then Color.CYAN else Color.Magenta);
plot A11_Dot = if IsNaN(close) then Double.NaN else 11;
A11_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A11_Dot.SetLineWeight(Dotsize);
A11_Dot.AssignValueColor(if Con1D and Con3D then Color.Green else if Con1D and Con4D then Color.Dark_Green else if Con2D and Con3D then Color.Light_Red else if Con2D and Con4D then Color.Dark_Red else Color.Black);
plot A12_Dot = if IsNaN(close) then Double.NaN else 12;
A12_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A12_Dot.SetLineWeight(Dotsize+1);
A12_Dot.AssignValueColor(if Diff4>=UZD then Color.YELLOW else IF Diff4 < LZD then Color.Dark_Orange else Color.Black);
plot A13_Dot = if IsNaN(close) then Double.NaN else 13;
A13_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A13_Dot.SetLineWeight(Dotsize);
A13_Dot.AssignValueColor(if Diff5>=1 then Color.CYAN else Color.Magenta);
plot A14_Dot = if IsNaN(close) then Double.NaN else 14;
A14_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A14_Dot.SetLineWeight(Dotsize);
A14_Dot.AssignValueColor(if Con1E and Con3E then Color.Green else if Con1E and Con4E then Color.Dark_Green else if Con2E and Con3E then Color.Light_Red else if Con2E and Con4E then Color.Dark_Red else Color.Black);
plot A15_Dot = if IsNaN(close) then Double.NaN else 15;
A15_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A15_Dot.SetLineWeight(Dotsize+1);
A15_Dot.AssignValueColor(if Diff5>=UZE then Color.YELLOW else IF Diff5 < LZE then Color.Dark_Orange else Color.Black);
plot A16_Dot = if IsNaN(close) then Double.NaN else 16;
A16_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A16_Dot.SetLineWeight(Dotsize);
A16_Dot.AssignValueColor(if Diff6>=1 then Color.CYAN else Color.Magenta);
plot A17_Dot = if IsNaN(close) then Double.NaN else 17;
A17_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A17_Dot.SetLineWeight(Dotsize);
A17_Dot.AssignValueColor(if Con1F and Con3F then Color.Green else if Con1F and Con4F then Color.Dark_Green else if Con2F and Con3F then Color.Light_Red else if Con2F and Con4F then Color.Dark_Red else Color.Black);
plot A18_Dot = if IsNaN(close) then Double.NaN else 18;
A18_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A18_Dot.SetLineWeight(Dotsize+1);
A18_Dot.AssignValueColor(if Diff6>=UZF then Color.YELLOW else IF Diff6 < LZF then Color.Dark_Orange else Color.Black);
plot A19_Dot = if IsNaN(close) then Double.NaN else 19;
A19_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A19_Dot.SetLineWeight(Dotsize);
A19_Dot.AssignValueColor(if Diff7>=1 then Color.BLUE else Color.RED);
plot A20_Dot = if IsNaN(close) then Double.NaN else 20;
A20_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A20_Dot.SetLineWeight(Dotsize);
A20_Dot.AssignValueColor(if Con1G and Con3G then Color.Green else if Con1G and Con4G then Color.Dark_Green else if Con2G and Con3G then Color.Light_Red else if Con2G and Con4G then Color.Dark_Red else Color.Black);
plot A21_Dot = if IsNaN(close) then Double.NaN else 21;
A21_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A21_Dot.SetLineWeight(Dotsize+1);
A21_Dot.AssignValueColor(if Diff7>=UZG then Color.YELLOW else IF Diff7 < LZG then Color.Dark_Orange else Color.Black);
plot A22_Dot = if IsNaN(close) then Double.NaN else 22;
A22_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A22_Dot.SetLineWeight(Dotsize);
A22_Dot.AssignValueColor(if Diff8>=1 then Color.BLUE else Color.RED);
plot A23_Dot = if IsNaN(close) then Double.NaN else 23;
A23_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A23_Dot.SetLineWeight(Dotsize);
A23_Dot.AssignValueColor(if Con1H and Con3H then Color.Green else if Con1H and Con4H then Color.Dark_Green else if Con2H and Con3H then Color.Light_Red else if Con2H and Con4H then Color.Dark_Red else Color.Black);
plot A24_Dot = if IsNaN(close) then Double.NaN else 24;
A24_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A24_Dot.SetLineWeight(Dotsize+1);
A24_Dot.AssignValueColor(if Diff8>=UZH then Color.YELLOW else IF Diff8 < LZH then Color.Dark_Orange else Color.Black);
plot A25_Dot = if IsNaN(close) then Double.NaN else 25;
A25_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A25_Dot.SetLineWeight(Dotsize);
A25_Dot.AssignValueColor(if Diff9>=1 then Color.BLUE else Color.RED);
plot A26_Dot = if IsNaN(close) then Double.NaN else 26;
A26_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A26_Dot.SetLineWeight(Dotsize);
A26_Dot.AssignValueColor(if Con1I and Con3I then Color.Green else if Con1I and Con4I then Color.Dark_Green else if Con2I and Con3I then Color.Light_Red else if Con2I and Con4I then Color.Dark_Red else Color.Black);
plot A27_Dot = if IsNaN(close) then Double.NaN else 27;
A27_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A27_Dot.SetLineWeight(Dotsize+1);
A27_Dot.AssignValueColor(if Diff9>=UZI then Color.YELLOW else IF Diff9 < LZI then Color.Dark_Orange else Color.Black);
plot A28_Dot = if IsNaN(close) then Double.NaN else 28;
A28_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A28_Dot.SetLineWeight(Dotsize);
A28_Dot.AssignValueColor(if Diff10>=1 then Color.BLUE else Color.RED);
plot A29_Dot = if IsNaN(close) then Double.NaN else 29;
A29_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A29_Dot.SetLineWeight(Dotsize);
A29_Dot.AssignValueColor(if Con1J and Con3J then Color.Green else if Con1J and Con4J then Color.Dark_Green else if Con2J and Con3J then Color.Light_Red else if Con2J and Con4J then Color.Dark_Red else Color.Black);
plot A30_Dot = if IsNaN(close) then Double.NaN else 30;
A30_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A30_Dot.SetLineWeight(Dotsize+1);
A30_Dot.AssignValueColor(if Diff10>=UZJ then Color.YELLOW else IF Diff10 < LZJ then Color.Dark_Orange else Color.Black);
plot A31_Dot = if IsNaN(close) then Double.NaN else 31;
A31_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A31_Dot.SetLineWeight(Dotsize);
A31_Dot.AssignValueColor(if Diff11>=1 then Color.BLUE else Color.RED);
plot A32_Dot = if IsNaN(close) then Double.NaN else 32;
A32_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A32_Dot.SetLineWeight(Dotsize);
A32_Dot.AssignValueColor(if Con1K and Con3K then Color.Green else if Con1K and Con4K then Color.Dark_Green else if Con2K and Con3K then Color.Light_Red else if Con2K and Con4K then Color.Dark_Red else Color.Black);
plot A33_Dot = if IsNaN(close) then Double.NaN else 33;
A33_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A33_Dot.SetLineWeight(Dotsize+1);
A33_Dot.AssignValueColor(if Diff11>=UZK then Color.YELLOW else IF Diff11 < LZK then Color.Dark_Orange else Color.Black);
plot A34_Dot = if IsNaN(close) then Double.NaN else 34;
A34_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A34_Dot.SetLineWeight(Dotsize);
A34_Dot.AssignValueColor(if Diff12>=1 then Color.BLUE else Color.RED);
plot A35_Dot = if IsNaN(close) then Double.NaN else 35;
A35_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A35_Dot.SetLineWeight(Dotsize);
A35_Dot.AssignValueColor(if Con1L and Con3L then Color.Green else if Con1L and Con4L then Color.Dark_Green else if Con2L and Con3L then Color.Light_Red else if Con2L and Con4L then Color.Dark_Red else Color.Black);
plot A36_Dot = if IsNaN(close) then Double.NaN else 36;
A36_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A36_Dot.SetLineWeight(Dotsize+1);
A36_Dot.AssignValueColor(if Diff12>=UZL then Color.YELLOW else IF Diff12 < LZL then Color.Dark_Orange else Color.Black);
plot A37_Dot = if IsNaN(close) then Double.NaN else 37;
A37_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A37_Dot.SetLineWeight(Dotsize);
A37_Dot.AssignValueColor(if Diff13>=1 then Color.BLUE else Color.RED);
plot A38_Dot = if IsNaN(close) then Double.NaN else 38;
A38_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A38_Dot.SetLineWeight(Dotsize);
A38_Dot.AssignValueColor(if Con1M and Con3M then Color.Green else if Con1M and Con4M then Color.Dark_Green else if Con2M and Con3M then Color.Light_Red else if Con2M and Con4M then Color.Dark_Red else Color.Black);
plot A39_Dot = if IsNaN(close) then Double.NaN else 39;
A39_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
A39_Dot.SetLineWeight(Dotsize+1);
A39_Dot.AssignValueColor(if Diff13>=UZM then Color.YELLOW else IF Diff13 < LZM then Color.Dark_Orange else Color.Black);
AssignPriceColor(if APC== 1 and Diff1 >= 1 then Color.Cyan else if APC== 1 and Diff1 < 1 then Color.Magenta else if APC== 2 and Con1A and Con3A then Color.Green else if APC ==2 and Con1A and Con4A then Color.Dark_Green else if APC ==2 and Con2A and Con3A then Color.Light_Red else if APC == 2 and Con2A and Con4A then Color.Dark_Red else if APC ==3 and Diff1>=UZA then Color.YELLOW else if APC ==3 and Diff1 < LZA then Color.Dark_Orange else if APC ==3 then Color.Dark_Gray else
if APC== 4 and Diff2 >= 1 then Color.Cyan else if APC== 4 and Diff2 < 1 then Color.Magenta else if APC== 5 and Con1B and Con3B then Color.Green else if APC ==5 and Con1B and Con4B then Color.Dark_Green else if APC ==5 and Con2B and Con3B then Color.Light_Red else if APC == 5 and Con2B and Con4B then Color.Dark_Red else if APC ==6 and Diff2>=UZB then Color.YELLOW else if APC ==6 and Diff2 < LZB then Color.Dark_Orange else if APC ==6 then Color.Dark_Gray else
if APC== 7 and Diff3 >= 1 then Color.Cyan else if APC== 7 and Diff3 < 1 then Color.Magenta else if APC== 8 and Con1C and Con3C then Color.Green else if APC ==8 and Con1C and Con4C then Color.Dark_Green else if APC ==8 and Con2C and Con3C then Color.Light_Red else if APC == 8 and Con2C and Con4C then Color.Dark_Red else if APC ==9 and Diff3>=UZC then Color.YELLOW else if APC ==9 and Diff3 < LZC then Color.Dark_Orange else if APC ==9 then Color.Dark_Gray else
if APC== 10 and Diff4 >= 1 then Color.Cyan else if APC== 10 and Diff4 < 1 then Color.Magenta else if APC== 11 and Con1D and Con3D then Color.Green else if APC ==11 and Con1D and Con4D then Color.Dark_Green else if APC ==11 and Con2D and Con3D then Color.Light_Red else if APC == 11 and Con2D and Con4D then Color.Dark_Red else if APC ==12 and Diff4>=UZD then Color.YELLOW else if APC ==12 and Diff4 < LZD then Color.Dark_Orange else if APC ==12 then Color.Dark_Gray else
if APC== 13 and Diff5 >= 1 then Color.Cyan else if APC== 13 and Diff5 < 1 then Color.Magenta else if APC== 14 and Con1E and Con3E then Color.Green else if APC ==14 and Con1E and Con4E then Color.Dark_Green else if APC ==14 and Con2E and Con3E then Color.Light_Red else if APC == 14 and Con2E and Con4E then Color.Dark_Red else if APC ==15 and Diff5>=UZE then Color.YELLOW else if APC ==15 and Diff5 < LZE then Color.Dark_Orange else if APC ==15 then Color.Dark_Gray else
if APC== 16 and Diff6 >= 1 then Color.Cyan else if APC== 16 and Diff6 < 1 then Color.Magenta else if APC== 17 and Con1F and Con3F then Color.Green else if APC ==17 and Con1F and Con4F then Color.Dark_Green else if APC ==17 and Con2F and Con3F then Color.Light_Red else if APC == 17 and Con2F and Con4F then Color.Dark_Red else if APC ==18 and Diff6>=UZF then Color.YELLOW else if APC ==18 and Diff6 < LZF then Color.Dark_Orange else if APC ==18 then Color.Dark_Gray else
if APC== 19 and Diff7 >= 1 then Color.BLUE else if APC== 19 and Diff7 < 1 then Color.RED else if APC== 20 and Con1G and Con3G then Color.Green else if APC ==20 and Con1G and Con4G then Color.Dark_Green else if APC ==20 and Con2G and Con3G then Color.Light_Red else if APC == 20 and Con2G and Con4G then Color.Dark_Red else if APC ==21 and Diff7>=UZG then Color.YELLOW else if APC ==21 and Diff7 < LZG then Color.Dark_Orange else if APC ==21 then Color.Dark_Gray else
if APC== 22 and Diff8 >= 1 then Color.BLUE else if APC== 22 and Diff8 < 1 then Color.RED else if APC== 23 and Con1H and Con3H then Color.Green else if APC ==23 and Con1H and Con4H then Color.Dark_Green else if APC ==23 and Con2H and Con3H then Color.Light_Red else if APC == 23 and Con2H and Con4H then Color.Dark_Red else if APC ==24 and Diff8>=UZH then Color.YELLOW else if APC ==24 and Diff8 < LZH then Color.Dark_Orange else if APC ==24 then Color.Dark_Gray else
if APC== 25 and Diff9 >= 1 then Color.BLUE else if APC== 25 and Diff9 < 1 then Color.RED else if APC== 26 and Con1I and Con3I then Color.Green else if APC ==26 and Con1I and Con4I then Color.Dark_Green else if APC ==26 and Con2I and Con3I then Color.Light_Red else if APC == 26 and Con2I and Con4I then Color.Dark_Red else if APC ==27 and Diff9>=UZI then Color.YELLOW else if APC ==27 and Diff9 < LZI then Color.Dark_Orange else if APC ==27 then Color.Dark_Gray else
if APC== 28 and Diff10 >= 1 then Color.BLUE else if APC== 28 and Diff10 < 1 then Color.RED else if APC== 29 and Con1J and Con3J then Color.Green else if APC ==29 and Con1J and Con4J then Color.Dark_Green else if APC ==29 and Con2J and Con3J then Color.Light_Red else if APC == 29 and Con2J and Con4J then Color.Dark_Red else if APC ==30 and Diff10>=UZJ then Color.YELLOW else if APC ==30 and Diff10 < LZJ then Color.Dark_Orange else if APC ==30 then Color.Dark_Gray else
if APC== 31 and Diff11 >= 1 then Color.BLUE else if APC== 31 and Diff11 < 1 then Color.RED else if APC== 32 and Con1K and Con3K then Color.Green else if APC ==32 and Con1K and Con4K then Color.Dark_Green else if APC ==32 and Con2K and Con3K then Color.Light_Red else if APC == 32 and Con2K and Con4K then Color.Dark_Red else if APC ==33 and Diff11>=UZK then Color.YELLOW else if APC ==33 and Diff11 < LZK then Color.Dark_Orange else if APC ==33 then Color.Dark_Gray else
if APC== 34 and Diff12 >= 1 then Color.BLUE else if APC== 34 and Diff12 < 1 then Color.RED else if APC== 35 and Con1L and Con3L then Color.Green else if APC ==35 and Con1L and Con4L then Color.Dark_Green else if APC ==35 and Con2L and Con3L then Color.Light_Red else if APC == 35 and Con2L and Con4L then Color.Dark_Red else if APC ==36 and Diff12>=UZL then Color.YELLOW else if APC ==36 and Diff12 < LZL then Color.Dark_Orange else if APC ==36 then Color.Dark_Gray else
if APC== 37 and Diff13 >= 1 then Color.BLUE else if APC== 37 and Diff13 < 1 then Color.RED else if APC== 38 and Con1M and Con3M then Color.Green else if APC ==38 and Con1M and Con4M then Color.Dark_Green else if APC ==38 and Con2M and Con3M then Color.Light_Red else if APC == 38 and Con2M and Con4M then Color.Dark_Red else if APC ==39 and Diff13>=UZM then Color.YELLOW else if APC ==39 and Diff13 < LZM then Color.Dark_Orange else if APC ==39 then Color.Dark_Gray else Color.Current);