######################################################################### # EminiAddict.com # BWD_TICKEntry ToS Study # # Author: BigWaveDave (dopdahl). # Version: 1.4 # Release Date: 4/23/12 # Email me with bugs: dopdahl@gmail.com # No guarantees as to accuracy expressed or implied # Use at your own discretion # # # Usage: # Run on a non-tick aggregation /es chart # # Version 1.4 Changes # =================== # + Added TICK molester indicator. This code will display another bubble # and an arrow indicating a hard buy or sell signal based on the strength or # weakness of the TICK. Strength or weakness is determined by a # formula that essentially looks at the overall intensity of the TICK # over a short duration. The idea is to identify likely turning points # in the market based on extreme TICK readings. See the bottom of this # study for the new code. Use this signal in addition to our normal fib # analysis, not on it's own. You should ignore this indicator during # Intense and sustained buying or selling pressure (sustained extreme TICKS). # As it will give false signals. # # Version 1.3 Changes # =================== # + Added settings option to hide the text in the bubble making it smaller # # Version 1.2 Changes # =================== # + Fixed bad code checking for time window # + Fixed issue with bubble being displayed on tick chart # # Version 1.1 Changes # =================== # + Fixed bogus vertical offset of 'Extreme TICK' bubble # # input TICKEntryWindowOpenTime = 1000; input TICKEntryWindowCloseTime = 1600; input HighTICKEntryLevel = 400; input LowTICKEntryLevel = -400; input ExtremeHighTICKLevel = 1000; input ExtremeLowTICKLevel = -1000; input BubbleHorizontalOffset = 6; input BubbleVerticalOffset = 0; input DiplayTICKValueOnly = {default "No", "Yes"}; input EnableTICKMolester = {"No", default "Yes"}; input MolesterLowTICKCutoff = 500; input MolesterHighTICKCutoff = 1000; input MolesterVericalOffset = 8; #input DrawIndicatorLine = {"No", default "Yes"}; DefineGlobalColor("Buy Color", color.dark_orange); DefineGlobalColor("Sell Color", color.dark_orange); DefineGlobalColor("Extreme TICK Color", color.dark_orange); DefineGlobalColor("Molester Buy Color", color.green); DefineGlobalColor("Molester Sell Color", color.red); # Are we processing the current bar? def isLastValidBar = if (!IsNaN(close("$TICK")) and IsNaN(close("$TICK")[-1]), 1, 0); # Are we inside of normal trading hours? rec bWindowOpen = compoundValue(1, if (isLastValidBar, if (secondsTillTime(TICKEntryWindowOpenTime) <= 0 and secondsTillTime(TICKEntryWindowCloseTime) > 0, 1, 0), bWindowOpen[1]), 0); def isLastValidBarES = if (!IsNaN(close) and IsNaN(close[-1]) , 1, 0); # Figure out where the 'right expansion area' starts and nudge it a little. rec DrawingZoneBarNumber = compoundValue(1, if (isLastValidBarES, barNumber() + BubbleHorizontalOffset + 1, DrawingZoneBarNumber[1]), 0); rec IndicatorStartBarNumber = compoundValue(1, if (isLastValidBarES, barNumber(), IndicatorStartBarNumber[1]), 0); # set some stuff up for live updates (at the completion of each bar)... # Get the close value of the last valid bar rec ActiveBarTICK = compoundValue(1, if (isLastValidBar, close("$TICK"), ActiveBarTICK[1]), double.nan); rec ActiveBarClose = compoundValue(1, if (isLastValidBarES, close(), ActiveBarClose[1]), double.nan); def bShowEntryBubbleHigh = (ActiveBarTICK > HighTICKEntryLevel); def bShowEntryBubbleLow = (ActiveBarTICK < LowTICKEntryLevel); def bShowExtremeEntryBubbleHigh = (ActiveBarTICK > ExtremeHighTICKLevel); def bShowExtremeEntryBubbleLow = (ActiveBarTICK < ExtremeLowTICKLevel); def DoWeShowIt = (barNumber() == DrawingZoneBarNumber) and bWindowOpen and (getAggregationPeriod() >= 60000); # Draw the line #plot CurrentPriceIndicator = if (DrawIndicatorLine and bWindowOpen and #(bShowEntryBubbleHigh or bShowEntryBubbleLow) and (barNumber() >= IndicatorStartBarNumber) #and (barNumber() <= DrawingZoneBarNumber), ActiveBarClose + (BubbleVerticalOffset / 4), #double.nan); #CurrentPriceIndicator.SetStyle(curve.FIRM); #CurrentPriceIndicator.SetDefaultColor(globalColor("Extreme TICK Color")); #CurrentPriceIndicator.SetPaintingStrategy(paintingstrategy.LINE); #CurrentPriceIndicator.HideBubble(); #CurrentPriceIndicator.HideTitle(); # Show the regular High/Low TICK Bubble AddChartBubble(DoWeShowIt and (bShowEntryBubbleHigh or bShowEntryBubbleLow) and !DiplayTICKValueOnly, ActiveBarClose + (BubbleVerticalOffset / 4), concat(if bShowEntryBubbleHigh then "High TICK: " else "Low TICK: ", ActiveBarTICK), if bShowEntryBubbleLow then globalColor("Buy Color") else globalColor("Sell Color"), if (bShowEntryBubbleHigh, 1, 0)); # TOS script bugs force me to do it this way... AddChartBubble(DoWeShowIt and (bShowEntryBubbleHigh or bShowEntryBubbleLow) and DiplayTICKValueOnly, ActiveBarClose + (BubbleVerticalOffset / 4), ActiveBarTICK, if bShowEntryBubbleLow then globalColor("Buy Color") else globalColor("Sell Color"), if (bShowEntryBubbleHigh, 1, 0)); # Show the extreme High/Low TICK Bubble AddChartBubble(DoWeShowIt and (bShowExtremeEntryBubbleHigh or bShowExtremeEntryBubbleLow), ActiveBarClose + ((BubbleVerticalOffset) / 4), "Extreme TICK!", globalColor("Extreme TICK Color"), if (bShowEntryBubbleHigh, 0, 1)); #plot an up or down arrow depending on the trade #plot TradeArrowUp = if (DoWeShowIt and bShowEntryBubbleLow, ActiveBarClose + #(BubbleVerticalOffset / 4), double.nan); #TradeArrowUp.SetPaintingStrategy(paintingstrategy.ARROW_UP); #TradeArrowUp.SetDefaultColor(globalColor("Buy Color")); #TradeArrowUp.HideBubble(); #TradeArrowUp.HideTitle(); #plot TradeArrowDown = if (DoWeShowIt and bShowEntryBubbleHigh, ActiveBarClose + #(BubbleVerticalOffset / 4), double.nan); #TradeArrowDown.SetPaintingStrategy(paintingstrategy.ARROW_DOWN); #TradeArrowDown.SetDefaultColor(globalColor("Sell Color")); #TradeArrowDown.HideBubble(); #TradeArrowDown.HideTitle(); ###################################################################### # New TICKMolester code. Modified by BigWaveDave # # TICK Interpretation Indicator # Based on work by Richard Todd (http://www.movethemarkets.com/blog/) # Adapted for thinkorswim by Sergey@fastmail.net (aka Eternum on # http://www.thinkscripter.com/forum/) # Oct 4, 2009: v1.0 # # def median_price = (high("$tick") + low("$tick")) / 2; def tmp1 = if high("$tick") > MolesterLowTICKCutoff then high("$tick") - MolesterLowTICKCutoff else 0; def tmp2 = if median_price > MolesterLowTICKCutoff then median_price - MolesterLowTICKCutoff else 0; def tmp3 = if high("$tick") > MolesterHighTICKCutoff then 2 * (high("$tick") - MolesterHighTICKCutoff) else 0; def tmp4 = if low("$tick") < -MolesterLowTICKCutoff then MolesterLowTICKCutoff + low("$tick") else 0; def tmp5 = if median_price < -MolesterLowTICKCutoff then MolesterLowTICKCutoff + median_price else 0; def tmp6 = if low("$tick") < -MolesterHighTICKCutoff then 2 * (MolesterHighTICKCutoff + low("$tick")) else 0; def tmp7 = tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6; # Molest it... def tick_molester = (tmp7[1] + 2 * tmp7) / 3; # Display it... def bMolesterHigh = (tick_molester > MolesterHighTICKCutoff); def bMolesterLow = (tick_molester < -MolesterHighTICKCutoff); AddChartBubble(DoWeShowIt and EnableTICKMolester and (bMolesterHigh or bMolesterLow), ActiveBarClose + ((BubbleVerticalOffset+MolesterVericalOffset) / 4), if bMolesterLow then "STRONG BUY!" else "STRONG SELL!", if bMolesterLow then globalColor("Molester Buy Color") else globalColor("Molester Sell Color"), if (bMolesterLow, 0, 1)); plot TradeArrowDown = if (EnableTICKMolester and bMolesterHigh, high, double.nan); TradeArrowDown.SetPaintingStrategy(paintingstrategy.ARROW_DOWN); TradeArrowDown.SetDefaultColor(globalColor("Molester Sell Color")); TradeArrowDown.HideBubble(); TradeArrowDown.HideTitle(); plot TradeArrowUp = if (EnableTICKMolester and bMolesterLow, low, double.nan); TradeArrowUp.SetPaintingStrategy(paintingstrategy.ARROW_UP); TradeArrowUp.SetDefaultColor(globalColor("Molester Buy Color")); TradeArrowUp.HideBubble(); TradeArrowUp.HideTitle(); #AddChartBubble(EnableTICKMolester and (bMolesterHigh or bMolesterLow), close, if #bMolesterLow then "Strong Buy!" else "Strong Sell!", if bMolesterLow then #globalColor("Molester Buy Color") else globalColor("Molester Sell Color"), if #(bMolesterLow, 0, 1)); #AddVerticalLine(EnableTICKMolester and (bMolesterHigh or bMolesterLow), if bMolesterLow #then "Strong Buy" else "Strong Sell", if bMolesterLow then globalColor("Molester Buy #Color") else globalColor("Molester Sell Color"), Curve.FIRM);