Re: Fun with ThinkScript September 15, 2015 05:59AM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript September 16, 2015 11:39AM |
Registered: 8 years ago Posts: 2 |
Re: Intraday bull flag in Watchlist in ThinkorSwim September 17, 2015 08:48PM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript September 22, 2015 06:00PM |
Registered: 8 years ago Posts: 7 |
TOS scanner September 24, 2015 04:37PM |
Registered: 8 years ago Posts: 1 |
Re: Fun with ThinkScript September 25, 2015 11:35AM |
Registered: 9 years ago Posts: 5 |
Re: Fun with ThinkScript September 28, 2015 06:51AM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript September 28, 2015 07:04AM |
Registered: 10 years ago Posts: 615 |
Quote
RichieRick
Simple question smiling smiley
Is there a way to display the chart time frame on or within the chart window? When I change from a 233 to a 55 chart I'd like to be able to see at a glance which time frame I am currently looking at?
Seems like a simple question anyways. smiling smiley
DefineGlobalColor("time", CreateColor(234, 220, 112)); def nMinutes = GetAggregationPeriod() / 60000; def Weekly = if nMinutes == 10080 then 1 else Double.NaN; def Daily = if nMinutes == 1440 then 1 else Double.NaN; def Intraday = if nMinutes < 1440 then 1 else Double.NaN; addlabel(yes, getsymbol(), globalcolor("time" )); AddLabel(Weekly, "Weekly Chart", GlobalColor("time" )); AddLabel(Daily, "Daily Chart", GlobalColor("time" )); AddLabel(Intraday, nMinutes + " min Chart", GlobalColor("time" ));
Re: Fun with ThinkScript September 28, 2015 07:09AM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript September 28, 2015 07:10AM |
Registered: 10 years ago Posts: 615 |
Quote
linter
Wonder if any of my betters here can confirm that this study does what I'm hoping it does. Which is, to give the daily range from open to close such that gaps at the open are not included.
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
######################################################################################
Declare lower;
declare once_per_bar;
Input Lgt = 20;
plot RangeAverage = Average(high(period = AggregationPeriod.Day)-low(period = AggregationPeriod.Day),Lgt);
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Thoughts, anyone?
Re: Fun with ThinkScript September 28, 2015 07:13AM |
Registered: 10 years ago Posts: 615 |
Quote
Ralph53
And 2) How can I get the price value of X below to appear in the Bubble " " ? Thanks.
def X = Highest(open, 12); def lastbar = HighestAll(if IsNaN(close) then 0 else BarNumber()); plot condition = if BarNumber() <= lastbar - 19 and BarNumber() >= lastbar - 20 then GetValue(X, BarNumber() - lastbar) else Double.NaN; AddChartBubble(BarNumber() == lastbar - 19, condition, X, Color.YELLOW, 0);
Re: Fun with ThinkScript September 28, 2015 07:16AM |
Registered: 10 years ago Posts: 615 |
Quote
RichieRick
For the Autowave we use in TOS, is there a way to put the chartbubble or the data on the center of the Autowave line just like it is in Qcharts?
Re: Fun with ThinkScript September 28, 2015 07:20AM |
Registered: 10 years ago Posts: 615 |
Quote
gblinc2
I do need help on scripting for a scan on optionable weekly stocks with vol greater than 500,000, minimum of 9 consecutive of lower closes or higher closes and a change in price direction. I am essentially looking for trend reversal based on price action. I am imagining this will be a study filter on ToS?
Re: Fun with ThinkScript September 28, 2015 07:37AM |
Registered: 10 years ago Posts: 615 |
Quote
gblinc2
I am also interested in creating what I call the slingshot rubber band effect on Bollinger band by looking for when price action is greater than 2 standard deviation, plus and minus. Have it as a watchlist and on the chart.
#Out of Bounds def sDev = StDev(close, 21); def MidLine = Average(close, 21); def UpperBand = MidLine + 2 * sDev; def LowerBand = MidLine - 2 * sDev; def CloseAbove = close > UpperBand; def CloseBelow = close < LowerBand; plot price = if CloseAbove then close - UpperBand else if CloseBelow then close - LowerBand else Double.NaN; price.AssignValueColor(if CloseAbove then Color.BLACK else if CloseBelow then Color.WHITE else Color.DARK_GRAY); AssignBackgroundColor(if CloseAbove then Color.GREEN else if CloseBelow then Color.RED else Color.DARK_GRAY);
Re: Fun with ThinkScript September 28, 2015 07:55AM |
Registered: 10 years ago Posts: 615 |
Quote
pivotalinsight
I'm trying to create a scan that identifies stock breakout candidates where today's open is 2+ standard deviations of the ATR above or below the previous day's close. Here's what I have so far however TOS doesn't like it so I believe I have the incorrect syntax. Any help is much appreciated!
Open > Close[1] + (2*StDev(ATR, 10)) or Open < Close[1] – (2*StDev(ATR, 10))
plot signal = Open > Close[1] + (2*StDev(reference ATR, 10)) or Open < Close[1] – (2*StDev(reference ATR, 10));
Re: Fun with ThinkScript September 28, 2015 07:58AM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript September 28, 2015 08:51AM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript October 02, 2015 10:51AM |
Registered: 8 years ago Posts: 7 |
Re: Fun with ThinkScript October 02, 2015 11:41PM |
Registered: 8 years ago Posts: 7 |
Re: Fun with ThinkScript October 05, 2015 10:42AM |
Registered: 9 years ago Posts: 60 |
Re: Fun with ThinkScript October 06, 2015 03:31AM |
Registered: 8 years ago Posts: 3 |
- If Previous Bar is SH, BuyStop is Current Bar High + 0.02 SellStop is Current Bar Low - 0.02 - else If SH is Valid IF Current Bar High is greater than or equal to Previous Bar BuyStop Trade Triggered (entered the trade) Draw Buy Stop and Sell Stop Lines (Green & red) else Current Bar High is less than Previous Bar BuyStop Draw Buy Stop and Sell Stop Lines (blue & pink) BuyStop is Current Bar High SellStop is Current Bar Low else BuyStop trigger Invalid
Show daily study on any timeframe chart October 06, 2015 04:57PM |
Registered: 8 years ago Posts: 2 |
Re: Show daily study on any timeframe chart October 07, 2015 02:19AM |
Registered: 8 years ago Posts: 3 |
declare lower; #------------------------- INPUTS ------------------------------------------------ input RSIPeriod = 21; input StochPeriod = 13; input KSlow = 8; input DFast = 8; input UpperLevel = 75; input LowerLevel = 25; def agPeriod = GetAggregationPeriod();#AggregationPeriod.DAY; def na = Double.NaN; #regular DTOSC Calculations def factor = 1; def priceC = ExpAverage(close(Period = agPeriod), factor); input rsiavgtype = AverageType.WILDERS; def reg_rsiPrice = reference RSI(price = priceC, length = RSIPeriod * factor, averagetype = rsiavgtype); def reg_rsiPriceLL = Lowest( reg_rsiPrice , StochPeriod * factor); def reg_rsiPriceHH = Highest( reg_rsiPrice , StochPeriod * factor ); def reg_StocRSI = 100 * (( reg_rsiPrice - reg_rsiPriceLL ) / ( (reg_rsiPriceHH ) - reg_rsiPriceLL )); input movavgtype = AverageType.SIMPLE; def LTF_sk = MovingAverage(movavgtype, reg_StocRSI, KSlow * factor); def LTF_sd = MovingAverage(movavgtype, LTF_sk, DFast * factor); #Highertimeframe DTOSC Calculations def htf_timeframe = if agPeriod == aggregationPeriod.MIN then AggregationPeriod.FIVE_MIN else if agPeriod == aggregationPeriod.Two_MIN then aggregationPeriod.TEN_MIN else if agperiod == aggregationPeriod.THREE_MIN then aggregationPeriod.FIFTEEN_MIN else if agPeriod == aggregationPeriod.FOUR_MIN then aggregationPeriod.TWENTY_MIN else if agperiod == aggregationPeriod.FIVE_MIN then aggregationPeriod.THIRTY_MIN else if agperiod >= aggregationPeriod.TEN_MIN and agperiod <= aggregationPeriod.TWENTY_MIN then aggregationPeriod.HOUR else if agperiod == aggregationPeriod.THIRTY_MIN then aggregationPeriod.TWO_HOURS else if agperiod == aggregationPeriod.HOUR then aggregationPeriod.FOUR_HOURS else if agperiod == aggregationPeriod.TWO_HOURS then aggregationPeriod.FOUR_HOURS else if agperiod == aggregationPeriod.FOUR_HOURS then aggregationPeriod.DAY else if agperiod >= aggregationPeriod.DAY and agPeriod <= aggregationPeriod.FOUR_DAYS then aggregationPeriod.WEEK else if agPeriod == aggregationPeriod.WEEK then aggregationPeriod.MONTH else if agPeriod == aggregationPeriod.MONTH then aggregationPeriod.MONTH else aggregationPeriod.WEEK; input htf_factor = 1; def htf_priceC = ExpAverage(close(Period = htf_timeframe), htf_factor); def NetChgAvg = MovingAverage(rsiavgtype, htf_priceC - htf_priceC[1], RSIPeriod * htf_factor); def TotChgAvg = MovingAverage(rsiavgtype, AbsValue(htf_priceC - htf_priceC[1]), RSIPeriod * htf_factor); def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0; def htf_rsiPrice = 50 * (ChgRatio + 1); def htf_rsiPriceLL = Lowest( htf_rsiPrice , StochPeriod * htf_factor); def htf_rsiPriceHH = Highest( htf_rsiPrice , StochPeriod * htf_factor ); def htf_StocRSI = 100 * (( htf_rsiPrice - htf_rsiPriceLL ) / ( (htf_rsiPriceHH ) - htf_rsiPriceLL )); def HTF_sk = MovingAverage(movavgtype, htf_StocRSI, KSlow * htf_factor); def HTF_sd = MovingAverage(movavgtype, HTF_sk, DFast * htf_factor); # PLOTS plot zero = 50; zero.SetPaintingStrategy(PaintingStrategy.DASHES); zero.SetDefaultColor(Color.LIGHT_GRAY); plot UpperL = UpperLevel; UpperL.SetDefaultColor(Color.RED); plot LowerL = LowerLevel; LowerL.SetDefaultColor(Color.GREEN); # LTF PLOTs plot LTF_MA1 =LTF_sk; LTF_MA1.SetDefaultColor(Color.BLUE); plot LTF_MA2 =LTF_sd; LTF_MA2.SetDefaultColor(color.GrAY); # HTF PLOTs plot HTF_MA1 =HTF_sk; HTF_MA1.SetDefaultColor(Color.DARK_GREEN); plot HTF_MA2 =HTF_sd; HTF_MA2.SetDefaultColor(color.DARK_RED);
Re: Show daily study on any timeframe chart October 07, 2015 02:54PM |
Registered: 10 years ago Posts: 465 |
Re: Show daily study on any timeframe chart October 07, 2015 09:00PM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript October 08, 2015 06:05AM |
Registered: 9 years ago Posts: 60 |
Re: Fun with ThinkScript October 08, 2015 06:09AM |
Registered: 9 years ago Posts: 60 |
thinkorswim custom scan study with variable October 08, 2015 09:21AM |
Registered: 8 years ago Posts: 5 |
Re: Fun with ThinkScript October 08, 2015 10:08AM |
Registered: 8 years ago Posts: 161 |
declare lower; input overbought1 = 80; input oversold1 = 20; plot MFI = MoneyFlowIndex(); plot OverBought = overbought1; plot OverSold = oversold1; MFI.DefineColor("OverBought", Color.MAGENTA); MFI.DefineColor("OverSold", Color.PLUM); OverBought.SetDefaultColor(Color.MAGENTA); OverSold.SetDefaultColor(Color.PLUM); AssignPriceColor(if MFI >= OverBought then MFI.color("OverBought" ) else if MFI <= OverSold then MFI.color("OverSold" ) else Color.CURRENT); #Had to add a space (where you see blue type) between last quote mark and parenthesis to prevent Smilies.
Re: thinkorswim custom scan study with variable October 08, 2015 10:50AM |
Registered: 8 years ago Posts: 161 |