thinkscript

#hint: The JIN indicator includes a trend and a money flow component to help traders forecast future price direction input ReleaseVerson = “Genie Change Histogram 20180816 A”; declare lower; # # # # # # # # # # # # # # # # # # # # # # # # # BEGIN PARAMETERS SECTION # # # # # # # # # # # # # # # # # # # # # # # # # # input LevelMultiplier = 1; input ColorScheme = 0; #hint ColorScheme: Select color scheme to be displayed. DEFINED VALUES ARE: 0 = Normal, 1 = Color Blind Due to an anomaly in TOS changing ColorScheme value via Script Editor interface does not always work, so change it within the script instead. input ShowFibLines = no; #hint ShowFibLines: The indicator vertical display area is divided by and displays the key Fibonacci ratios and the extremes and 38.2, 61.8 above and below the 50% or mid-point of JIN’s range. These display lines help to normalize the indicator lines vis a vis each other. input FLOAverageType = AverageType.WEIGHTED; #hint FLOAverageType: Type used for the averages withing FLO calcuation. # # # # # # # # # # # # # # # # # # # # BEGIN PLOT SECTION # # # # # # # # # # # # # # # # # # # # # plot HistogramPlot; input GenieAverageType = AverageType.EXPONENTIAL; input GeniePeriod = 21; # # # # # # # # # # # # # # # # # # # # # # BEGIN PLOT SECTION # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # BEGIN BUSINESS PROCESS SECTION # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # BEGIN MOVING AVERAGE SECTION # # # # # # # # # # # # # # # # # # # # # # # # # # # # def Genie = Inertia(MovingAverage(GenieAverageType, close, GeniePeriod), 3); def SlopeDir = Genie; def GenieSlope = Inertia(Genie – Genie[1], 8); def HistogramValue = Inertia(GenieSlope – GenieSlope[1], 5); HistogramPlot = HistogramValue; # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # BEGIN DISPLAY SECTION # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # BEGIN DEFINE GLOBAL COLOR ASSIGNMENT SECTION # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # DefineGlobalColor(“Blue 300”, CreateColor(117, 125, 232)); DefineGlobalColor(“Blue 500”, CreateColor(63, 81, 181)); DefineGlobalColor(“Blue 900”, CreateColor(0, 41, 132)); DefineGlobalColor(“Red 300”, CreateColor(255, 121, 97)); DefineGlobalColor(“Red 500”, CreateColor(244, 67, 54)); DefineGlobalColor(“Red 900”, CreateColor(183, 28, 28)); DefineGlobalColor(“Green 300”, CreateColor(128, 226, 126)); DefineGlobalColor(“Green 500”, CreateColor(76, 175, 80)); DefineGlobalColor(“Green 900”, CreateColor(8, 127, 35)); DefineGlobalColor(“Amber 500”, CreateColor(255, 193, 7)); DefineGlobalColor(“Amber 900”, CreateColor(255, 111, 0)); DefineGlobalColor(“Gray 800”, CreateColor(68, 68, 68)); DefineGlobalColor(“Gray 500”, CreateColor(158, 158, 158)); DefineGlobalColor(“Gray 200”, CreateColor(238, 238, 238)); DefineGlobalColor(“Indigo 500”, CreateColor(63, 81, 181)); DefineGlobalColor(“White”, CreateColor(255, 255, 255)); DefineGlobalColor(“Black”, CreateColor(0, 0, 0)); # # # # # # # # # # # # # # # # # # # # # # # # # # BEGIN VERTICLE LINES SECTION # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # BEGIN LABELS SECTION # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # BEGIN DISPLAY SECTION # # # # # # # # # # # # # # # # # # # # # # # # HistogramPlot.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); HistogramPlot.DefineColor(“Up”, GlobalColor(“Green 500”)); HistogramPlot.DefineColor(“Down”, GlobalColor(“Red 900”)); HistogramPlot.DefineColor(“Flat”, GlobalColor(“Blue 500”)); HistogramPlot.AssignValueColor( if HistogramValue > HistogramValue[1] then GlobalColor(“Blue 300”) else if HistogramValue < HistogramValue[1] then GlobalColor(“Red 900”) else GlobalColor(“Gray 500”)); HistogramPlot.SetLineWeight(5); HistogramPlot.HideBubble(); HistogramPlot.HideTitle(); HistogramPlot.SetHiding(no); AssignPriceColor( if HistogramValue > HistogramValue[1] and Genie > Genie[1] then GlobalColor(“Green 500”) else if HistogramValue < HistogramValue[1] and Genie < Genie[1] then GlobalColor(“Red 900”) else GlobalColor(“Blue 500”));

Leave a Reply