Musk335im3
Member
Hi all.
Is it possible to add a date (inside a bubble) located on top of the bar once the study triggers.
I'm trying to make a back study of large number of stocks and I need to see the dates right a way.
I saw similar request in the past and tried to copy/modify the code to fit my needs to no avail.
The study is posted below.
Thanks in advanced.
https://usethinkscript.com/threads/buyable-gap-up-indicator-and-strategy-for-thinkorswim.207/
And here's a similar request that I can seem to make it work on this study after mods: https://usethinkscript.com/threads/...long-with-the-arrow-when-using-a-study.13745/
Is it possible to add a date (inside a bubble) located on top of the bar once the study triggers.
I'm trying to make a back study of large number of stocks and I need to see the dates right a way.
I saw similar request in the past and tried to copy/modify the code to fit my needs to no avail.
The study is posted below.
Thanks in advanced.
https://usethinkscript.com/threads/buyable-gap-up-indicator-and-strategy-for-thinkorswim.207/
And here's a similar request that I can seem to make it work on this study after mods: https://usethinkscript.com/threads/...long-with-the-arrow-when-using-a-study.13745/
Code:
#
# By Scott J. Johnson (http://scottjjohnson.com)
#
# BuyableGapUpIndicator
#
# Based on Gil Morales and Chris Kacher's rules for buyable gaps up.
# http://www.traderplanet.com/articles/view/164232-gain-your-stock-edge-buyable-gap-up-strategy/
#
# This study doesn't work intraday because the volume used is the actual volume
# and not the projected end-of-day volume. Instead, this study is useful
# in post-analysis to quickly find buyable gaps up.
#
# TODO: Add logic to handle the current period gaps up by projecting the full day volume
# based on the current time and volume so far.
#
input AverageTrueRangeTimePeriod = 40;
input BuyableGapPercentOfATR = 75; # percent of average true range to qualify for as a gap
input AverageVolumeTimePeriod = 50; # calculate 50 day MA volume
input BuyableGapUpMinVolumePercent = 150; # 150% of 50 day MA volume
def AverageTrueRange = reference ATR(AverageTrueRangeTimePeriod, averageType = AverageType.SIMPLE);
def OpeningPriceGap = open - high[1];
def AverageVolume = MovingAverage(AverageType.SIMPLE, volume, AverageVolumeTimePeriod );
def GapUp = (OpeningPriceGap >= AverageTrueRange * BuyableGapPercentOfATR / 100) and (volume > AverageVolume * BuyableGapUpMinVolumePercent / 100);
## My mods start
## DefineGlobalColor("GU", Color.GREEN);
## (orig) AddChartBubble(GapUp > 0, low, “GU", Color.GREEN, no);
## AddChartBubble(GapUp > 0, low, “:", GLOBALCOLOR("GU"), no);
## My mods end
## White color tick
## AssignPriceColor(if GapUp > 0 then color.white else color.current);
plot GU = GapUp;
GU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
GU.SetDefaultColor(GetColor(8));
GU.SetLineWeight(2);
DefineGlobalColor("BGUP", Color.Violet);
AddChartBubble (GapUp, Low - (low * 0.02), “b", GlobalColor("BGUP"), no);
## https://usethinkscript.com/threads/buyable-gap-up-indicator-and-strategy-for-thinkorswim.207/#
Last edited by a moderator: