'************************************************************** '* Stochastic Heat (StochHeat.txt) '* by Jeremy Williams '* January 13, 2012 '* '* Adapted from Technical Analysis of Stocks and Commodities '* March 2012 '* '* Summary: '* '* This indicator plots a Heatmap of the Percent D line '* of the Stochastics Indicator. For more information see '* "Introducing SwamiCharts" in the March 2012 edition of '* Technical Analysis of Stocks and Commodities. '* '* Notes: '* '* This indicator requires the PercentD (PercentD.txt) '* indicator to function. This can be found at: '* '* www.omnitrader.com/ProSI '* '* This indicator is only a visual tool and does not '* return a value. '* '************************************************************** #Indicator ' Setup Plot area Y- Axis from 4 to 48 corresponding with the ' period of the Stochastic used. SetScales(4,48) ' Process the 4 period stochastics Dim oColor4 As Object Dim myStoch4 As Single myStoch4 = PercentD(4) ' Color heatmap line based on value If myStoch4 < .50 Then oColor4 = Color.FromARGB(255,255*2*myStoch4,0) Else oColor4 = Color.FromARGB(255*(2-2*myStoch4),255,0) End If ' Plot line for period 4 stochastics Plot("4",4,oColor4,10) ' Contiune similarly for other periods. Dim oColor5 As Object Dim myStoch5 As Single myStoch5 = PercentD(5) If myStoch5 < .50 Then oColor5 = Color.FromARGB(255,255*2*myStoch5,0) Else oColor5 = Color.FromARGB(255*(2-2*myStoch5),255,0) End If Plot("5",5,oColor5,10) Dim oColor6 As Object Dim myStoch6 As Single myStoch6 = PercentD(6) If myStoch6 < .50 Then oColor6 = Color.FromARGB(255,255*2*myStoch6,0) Else oColor6 = Color.FromARGB(255*(2-2*myStoch6),255,0) End If Plot("6",6,oColor6,10) Dim oColor7 As Object Dim myStoch7 As Single myStoch7 = PercentD(7) If myStoch7 < .50 Then oColor7 = Color.FromARGB(255,255*2*myStoch7,0) Else oColor7 = Color.FromARGB(255*(2-2*myStoch7),255,0) End If Plot("7",7,oColor7,10) Dim oColor8 As Object Dim myStoch8 As Single myStoch8 = PercentD(8) If myStoch8 < .50 Then oColor8 = Color.FromARGB(255,255*2*myStoch8,0) Else oColor8 = Color.FromARGB(255*(2-2*myStoch8),255,0) End If Plot("8",8,oColor8,10) Dim oColor9 As Object Dim myStoch9 As Single myStoch9 = PercentD(9) If myStoch9 < .50 Then oColor9 = Color.FromARGB(255,255*2*myStoch9,0) Else oColor9 = Color.FromARGB(255*(2-2*myStoch9),255,0) End If Plot("9",9,oColor9,10) Dim oColor10 As Object Dim myStoch10 As Single myStoch10 = PercentD(10) If myStoch10 < .50 Then oColor10 = Color.FromARGB(255,255*2*myStoch10,0) Else oColor10 = Color.FromARGB(255*(2-2*myStoch10),255,0) End If Plot("10",10,oColor10,10) Dim oColor11 As Object Dim myStoch11 As Single myStoch11 = PercentD(11) If myStoch11 < .50 Then oColor11 = Color.FromARGB(255,255*2*myStoch11,0) Else oColor11 = Color.FromARGB(255*(2-2*myStoch11),255,0) End If Plot("11",11,oColor11,10) Dim oColor12 As Object Dim myStoch12 As Single myStoch12 = PercentD(12) If myStoch12 < .50 Then oColor12 = Color.FromARGB(255,255*2*myStoch12,0) Else oColor12 = Color.FromARGB(255*(2-2*myStoch12),255,0) End If Plot("12",12,oColor12,10) Dim oColor13 As Object Dim myStoch13 As Single myStoch13 = PercentD(13) If myStoch13 < .50 Then oColor13 = Color.FromARGB(255,255*2*myStoch13,0) Else oColor13 = Color.FromARGB(255*(2-2*myStoch13),255,0) End If Plot("13",13,oColor13,10) Dim oColor14 As Object Dim myStoch14 As Single myStoch14 = PercentD(14) If myStoch14 < .50 Then oColor14 = Color.FromARGB(255,255*2*myStoch14,0) Else oColor14 = Color.FromARGB(255*(2-2*myStoch14),255,0) End If Plot("14",14,oColor14,10) Dim oColor15 As Object Dim myStoch15 As Single myStoch15 = PercentD(15) If myStoch15 < .50 Then oColor15 = Color.FromARGB(255,255*2*myStoch15,0) Else oColor15 = Color.FromARGB(255*(2-2*myStoch15),255,0) End If Plot("15",15,oColor15,10) Dim oColor16 As Object Dim myStoch16 As Single myStoch16 = PercentD(16) If myStoch16 < .50 Then oColor16 = Color.FromARGB(255,255*2*myStoch16,0) Else oColor16 = Color.FromARGB(255*(2-2*myStoch16),255,0) End If Plot("16",16,oColor16,10) Dim oColor17 As Object Dim myStoch17 As Single myStoch17 = PercentD(17) If myStoch17 < .50 Then oColor17 = Color.FromARGB(255,255*2*myStoch17,0) Else oColor17 = Color.FromARGB(255*(2-2*myStoch17),255,0) End If Plot("17",17,oColor17,10) Dim oColor18 As Object Dim myStoch18 As Single myStoch18 = PercentD(18) If myStoch18 < .50 Then oColor18 = Color.FromARGB(255,255*2*myStoch18,0) Else oColor18 = Color.FromARGB(255*(2-2*myStoch18),255,0) End If Plot("18",18,oColor18,10) Dim oColor19 As Object Dim myStoch19 As Single myStoch19 = PercentD(19) If myStoch19 < .50 Then oColor19 = Color.FromARGB(255,255*2*myStoch19,0) Else oColor19 = Color.FromARGB(255*(2-2*myStoch19),255,0) End If Plot("19",19,oColor19,10) Dim oColor20 As Object Dim myStoch20 As Single myStoch20 = PercentD(20) If myStoch20 < .50 Then oColor20 = Color.FromARGB(255,255*2*myStoch20,0) Else oColor20 = Color.FromARGB(255*(2-2*myStoch20),255,0) End If Plot("20",20,oColor20,10) Dim oColor21 As Object Dim myStoch21 As Single myStoch21 = PercentD(21) If myStoch21 < .50 Then oColor21 = Color.FromARGB(255,255*2*myStoch21,0) Else oColor21 = Color.FromARGB(255*(2-2*myStoch21),255,0) End If Plot("21",21,oColor21,10) Dim oColor22 As Object Dim myStoch22 As Single myStoch22 = PercentD(22) If myStoch22 < .50 Then oColor22 = Color.FromARGB(255,255*2*myStoch22,0) Else oColor22 = Color.FromARGB(255*(2-2*myStoch22),255,0) End If Plot("22",22,oColor22,10) Dim oColor23 As Object Dim myStoch23 As Single myStoch23 = PercentD(23) If myStoch23 < .50 Then oColor23 = Color.FromARGB(255,255*2*myStoch23,0) Else oColor23 = Color.FromARGB(255*(2-2*myStoch23),255,0) End If Plot("23",23,oColor23,10) Dim oColor24 As Object Dim myStoch24 As Single myStoch24 = PercentD(24) If myStoch24 < .50 Then oColor24 = Color.FromARGB(255,255*2*myStoch24,0) Else oColor24 = Color.FromARGB(255*(2-2*myStoch24),255,0) End If Plot("24",24,oColor24,10) Dim oColor25 As Object Dim myStoch25 As Single myStoch25 = PercentD(25) If myStoch25 < .50 Then oColor25 = Color.FromARGB(255,255*2*myStoch25,0) Else oColor25 = Color.FromARGB(255*(2-2*myStoch25),255,0) End If Plot("25",25,oColor25,10) Dim oColor26 As Object Dim myStoch26 As Single myStoch26 = PercentD(26) If myStoch26 < .50 Then oColor26 = Color.FromARGB(255,255*2*myStoch26,0) Else oColor26 = Color.FromARGB(255*(2-2*myStoch26),255,0) End If Plot("26",26,oColor26,10) Dim oColor27 As Object Dim myStoch27 As Single myStoch27 = PercentD(27) If myStoch27 < .50 Then oColor27 = Color.FromARGB(255,255*2*myStoch27,0) Else oColor27 = Color.FromARGB(255*(2-2*myStoch27),255,0) End If Plot("27",27,oColor27,10) Dim oColor28 As Object Dim myStoch28 As Single myStoch28 = PercentD(28) If myStoch28 < .50 Then oColor28 = Color.FromARGB(255,255*2*myStoch28,0) Else oColor28 = Color.FromARGB(255*(2-2*myStoch28),255,0) End If Plot("28",28,oColor28,10) Dim oColor29 As Object Dim myStoch29 As Single myStoch29 = PercentD(29) If myStoch29 < .50 Then oColor29 = Color.FromARGB(255,255*2*myStoch29,0) Else oColor29 = Color.FromARGB(255*(2-2*myStoch29),255,0) End If Plot("29",29,oColor29,10) Dim oColor30 As Object Dim myStoch30 As Single myStoch30 = PercentD(30) If myStoch30 < .50 Then oColor30 = Color.FromARGB(255,255*2*myStoch30,0) Else oColor30 = Color.FromARGB(255*(2-2*myStoch30),255,0) End If Plot("30",30,oColor30,10) Dim oColor31 As Object Dim myStoch31 As Single myStoch31 = PercentD(31) If myStoch31 < .50 Then oColor31 = Color.FromARGB(255,255*2*myStoch31,0) Else oColor31 = Color.FromARGB(255*(2-2*myStoch31),255,0) End If Plot("31",31,oColor31,10) Dim oColor32 As Object Dim myStoch32 As Single myStoch32 = PercentD(32) If myStoch32 < .50 Then oColor32 = Color.FromARGB(255,255*2*myStoch32,0) Else oColor32 = Color.FromARGB(255*(2-2*myStoch32),255,0) End If Plot("32",32,oColor32,10) Dim oColor33 As Object Dim myStoch33 As Single myStoch33 = PercentD(33) If myStoch33 < .50 Then oColor33 = Color.FromARGB(255,255*2*myStoch33,0) Else oColor33 = Color.FromARGB(255*(2-2*myStoch33),255,0) End If Plot("33",33,oColor33,10) Dim oColor34 As Object Dim myStoch34 As Single myStoch34 = PercentD(34) If myStoch34 < .50 Then oColor34 = Color.FromARGB(255,255*2*myStoch34,0) Else oColor34 = Color.FromARGB(255*(2-2*myStoch34),255,0) End If Plot("34",34,oColor34,10) Dim oColor35 As Object Dim myStoch35 As Single myStoch35 = PercentD(35) If myStoch35 < .50 Then oColor35 = Color.FromARGB(255,255*2*myStoch35,0) Else oColor35 = Color.FromARGB(255*(2-2*myStoch35),255,0) End If Plot("35",35,oColor35,10) Dim oColor36 As Object Dim myStoch36 As Single myStoch36 = PercentD(36) If myStoch36 < .50 Then oColor36 = Color.FromARGB(255,255*2*myStoch36,0) Else oColor36 = Color.FromARGB(255*(2-2*myStoch36),255,0) End If Plot("36",36,oColor36,10) Dim oColor37 As Object Dim myStoch37 As Single myStoch37 = PercentD(37) If myStoch37 < .50 Then oColor37 = Color.FromARGB(255,255*2*myStoch37,0) Else oColor37 = Color.FromARGB(255*(2-2*myStoch37),255,0) End If Plot("37",37,oColor37,10) Dim oColor38 As Object Dim myStoch38 As Single myStoch38 = PercentD(38) If myStoch38 < .50 Then oColor38 = Color.FromARGB(255,255*2*myStoch38,0) Else oColor38 = Color.FromARGB(255*(2-2*myStoch38),255,0) End If Plot("38",38,oColor38,10) Dim oColor39 As Object Dim myStoch39 As Single myStoch39 = PercentD(39) If myStoch39 < .50 Then oColor39 = Color.FromARGB(255,255*2*myStoch39,0) Else oColor39 = Color.FromARGB(255*(2-2*myStoch39),255,0) End If Plot("39",39,oColor39,10) Dim oColor40 As Object Dim myStoch40 As Single myStoch40 = PercentD(40) If myStoch40 < .50 Then oColor40 = Color.FromARGB(255,255*2*myStoch40,0) Else oColor40 = Color.FromARGB(255*(2-2*myStoch40),255,0) End If Plot("40",40,oColor40,10) Dim oColor41 As Object Dim myStoch41 As Single myStoch41 = PercentD(41) If myStoch41 < .50 Then oColor41 = Color.FromARGB(255,255*2*myStoch41,0) Else oColor41 = Color.FromARGB(255*(2-2*myStoch41),255,0) End If Plot("41",41,oColor41,10) Dim oColor42 As Object Dim myStoch42 As Single myStoch42 = PercentD(42) If myStoch42 < .50 Then oColor42 = Color.FromARGB(255,255*2*myStoch42,0) Else oColor42 = Color.FromARGB(255*(2-2*myStoch42),255,0) End If Plot("42",42,oColor42,10) Dim oColor43 As Object Dim myStoch43 As Single myStoch43 = PercentD(43) If myStoch43 < .50 Then oColor43 = Color.FromARGB(255,255*2*myStoch43,0) Else oColor43 = Color.FromARGB(255*(2-2*myStoch43),255,0) End If Plot("43",43,oColor43,10) Dim oColor44 As Object Dim myStoch44 As Single myStoch44 = PercentD(44) If myStoch44 < .50 Then oColor44 = Color.FromARGB(255,255*2*myStoch44,0) Else oColor44 = Color.FromARGB(255*(2-2*myStoch44),255,0) End If Plot("44",44,oColor44,10) Dim oColor45 As Object Dim myStoch45 As Single myStoch45 = PercentD(45) If myStoch45 < .50 Then oColor45 = Color.FromARGB(255,255*2*myStoch45,0) Else oColor45 = Color.FromARGB(255*(2-2*myStoch45),255,0) End If Plot("45",45,oColor45,10) Dim oColor46 As Object Dim myStoch46 As Single myStoch46 = PercentD(46) If myStoch46 < .50 Then oColor46 = Color.FromARGB(255,255*2*myStoch46,0) Else oColor46 = Color.FromARGB(255*(2-2*myStoch46),255,0) End If Plot("46",46,oColor46,10) Dim oColor47 As Object Dim myStoch47 As Single myStoch47 = PercentD(47) If myStoch47 < .50 Then oColor47 = Color.FromARGB(255,255*2*myStoch47,0) Else oColor47 = Color.FromARGB(255*(2-2*myStoch47),255,0) End If Plot("47",47,oColor47,10) Dim oColor48 As Object Dim myStoch48 As Single myStoch48 = PercentD(48) If myStoch48 < .50 Then oColor48 = Color.FromARGB(255,255*2*myStoch48,0) Else oColor48 = Color.FromARGB(255*(2-2*myStoch48),255,0) End If Plot("48",48,oColor48,10) Return 0 ' Return the value calculated by the indicator