Use a profile of close, to find the MODE of a period.
this will find the MODE of a collection of prices, over a time period,
the close price (range) that occurs with the greatest frequency.
use a profile of close, to find the POC, point of control, the MODE of the period.
can choose profile row type,
. automatic (85 rows)
. ticksize (usually 0.01)
. number (enter a number of a price range)
labels for,
ticksize, row type, MODE price, profile highest price, profile lowest price, profile range.
DataProfile
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Profiles/DataProfile
info on MODE
https://www.microeconomicsnotes.com...e-with-examples-formula-merits-demerits/15177
https://www.purplemath.com/modules/meanmode.htm
this will find the MODE of a collection of prices, over a time period,
the close price (range) that occurs with the greatest frequency.
use a profile of close, to find the POC, point of control, the MODE of the period.
can choose profile row type,
. automatic (85 rows)
. ticksize (usually 0.01)
. number (enter a number of a price range)
labels for,
ticksize, row type, MODE price, profile highest price, profile lowest price, profile range.
Ruby:# profile_close_03 # https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Profiles/DataProfile # DataProfile # default row qty = 85 # ------------------------------------- def t = ticksize(); addlabel(1, "ticksize " + t, color.yellow); input pick_row_type = { default auto , tick , number }; #hint pick_row_type: Row height. \n -- auto , calculated automatically, 85 rows. \n -- tick , ticksize, 0.01 for most stocks. \n -- number , enter a price number to define the height of each row. input row_height_number = 0.25; def ppr; switch (pick_row_type) { case auto: ppr = PricePerRow.AUTOMATIC; case tick: ppr = PricePerRow.TICKSIZE; case number: ppr = row_height_number; } addlabel(1, " row type " + pick_row_type , color.yellow); # stuff from volumeprofile input showPointOfControl = yes; input showValueArea = no; #hint showValueArea: "light shading around the horz lines" input valueAreaPercent = 70; input opacity = 20; def cls = close; def condition = GetYear() != GetYear()[1]; # "onExpansion" = onExpansion # yes, place to the right. no, place over candles input onExpansion = no; profile CustomProfile = DataProfile(data = cls, pricePerRow = ppr, onExpansion = onExpansion, startNewProfile = condition); CustomProfile.Show(); plot POC = CustomProfile.GetPointOfControl(); addlabel(1, "MODE, close price of highest reoccurance " + poc, color.yellow); DefineGlobalColor("Profile", GetColor(1)); DefineGlobalColor("Point Of Control", GetColor(5)); DefineGlobalColor("Value Area", GetColor(8)); CustomProfile.show(globalColor("Profile"), if showPointOfControl then globalColor("Point Of Control") else color.current, if showValueArea then globalColor("Value Area") else color.current, opacity); def maxp = CustomProfile.GetHighest(); def minp = CustomProfile.Getlowest(); addlabel(1, "profile highest " + maxp, color.yellow); addlabel(1, "profile lowest " + minp, color.yellow); def profile_range = maxp - minp; addlabel(1, "profile range " + profile_range, color.yellow); #
DataProfile
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Profiles/DataProfile
info on MODE
https://www.microeconomicsnotes.com...e-with-examples-formula-merits-demerits/15177
https://www.purplemath.com/modules/meanmode.htm
Last edited: