Re: Fun with ThinkScript May 02, 2018 06:38PM |
Registered: 6 years ago Posts: 33 |
Re: Fun with ThinkScript May 03, 2018 06:52AM |
Registered: 7 years ago Posts: 126 |
Re: Fun with ThinkScript May 03, 2018 07:43AM |
Registered: 6 years ago Posts: 33 |
chop indicator May 03, 2018 08:05AM |
Registered: 5 years ago Posts: 23 |
Re: Fun with ThinkScript May 03, 2018 11:48AM |
Registered: 5 years ago Posts: 1 |
Re: Leavitt convolution May 03, 2018 01:05PM |
Registered: 5 years ago Posts: 1 |
script LeavittProjection { input y = close; input n = 25; def x = x[1] + 1; def a = (n * sum(x * y, n) - sum(x, n) * sum(y, n) ) / ( n *sum(Sqr(x), n) - Sqr(sum(x, n))); def b = (sum(Sqr(x), n) * sum(y, n) - sum(x, n) * sum(x *y, n) ) / ( n * sum(Sqr(x), n) - Sqr(sum(x, n))); plot LP = a * (x - 1) + b; } # Example call to script plot LP = LevittProjection(closs, 25) # Is this the Leavitt Convolution? plot LC = inertia(LP, 5)
Re: chop indicator May 03, 2018 01:27PM |
Registered: 7 years ago Posts: 126 |
Quote
Is there a way to make a indicator for chop that
would show up as candle colors
Re: chop indicator May 03, 2018 02:03PM |
Registered: 6 years ago Posts: 33 |
Re: Fun with ThinkScript May 03, 2018 02:49PM |
Registered: 7 years ago Posts: 126 |
####################### plot Dots = (HighestAll(high) + LowestAll(low)) / 2; Dots.SetStyle(Curve.POINTS); Dots.SetLineWeight(5); Dots.AssignValueColor(if !BullishTrend then color.green else color.red); #######################
Re: Fun with ThinkScript May 03, 2018 02:53PM |
Registered: 6 years ago Posts: 33 |
Re: Fun with ThinkScript May 03, 2018 03:38PM |
Registered: 6 years ago Posts: 33 |
Re: chop indicator May 03, 2018 04:39PM |
Registered: 5 years ago Posts: 23 |
Re: Fun with ThinkScript May 03, 2018 05:26PM |
Registered: 6 years ago Posts: 33 |
Re: chop indicator May 04, 2018 05:00AM |
Registered: 7 years ago Posts: 126 |
AssignPriceColor(if CPSqueeze < SqueezeRatio or Crosses(CPSqueeze,SqueezeRatio,CrossingDirection.ANY) then if Crosses (CPSqueeze,SqueezeRatio,CrossingDirection.ANY) then Color.yellow else Chop.Color("InChop" ) else color.CURRENT);
Re: Fun with ThinkScript May 04, 2018 06:40AM |
Registered: 7 years ago Posts: 126 |
Re: Fun with ThinkScript May 04, 2018 08:28AM |
Registered: 6 years ago Posts: 33 |
Re: Fun with ThinkScript May 04, 2018 12:24PM |
Registered: 6 years ago Posts: 33 |
Re: Fun with ThinkScript May 04, 2018 01:31PM |
Registered: 7 years ago Posts: 126 |
Quote
I am looking for code that will tell me whether or
not the 50 day Simple Moving Average is sloped
positive or negative, or pointing up or down.
plot ma=average(close,50); ma.AssignValueColor(if ma>ma[1] then Color.GREEN else Color.RED);
Re: Fun with ThinkScript May 04, 2018 02:23PM |
Registered: 7 years ago Posts: 126 |
input cutoffLength = 20; def whiteNoise = (close - close[2]) / 2; def filter = reference EhlersSuperSmootherFilter(price = whiteNoise, "cutoff length" = cutoffLength); def peak = if IsNaN(filter) then peak[1] * 0.991 else Max(AbsValue(filter), peak[1] * 0.991); plot scan = filter / peak; AssignBackgroundColor(if scan==-1 then color.red else color.current); scan.assignValueColor(if scan==-1 then color.white else color.current);
Re: Fun with ThinkScript May 04, 2018 02:46PM |
Registered: 7 years ago Posts: 126 |
Quote
ok, i checked and what is needed is to be able to
plot a 5min ADX on a one min time frame, is that
possible?
declare lower; input length = 14; input averageType = AverageType.WILDERS; def agg= aggregationperiod.fIVE_MIN; def hiDiff = high(period=agg) - high(period=agg)[1]; def loDiff = low(period=agg)[1] - low(period=agg); def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0; def minusDM = if loDiff > hiDiff and loDiff > 0 then loDiff else 0; def ATR = MovingAverage(averageType, TrueRange(high(period=agg), close(period=agg), low(period=agg)), length); plot "DI+" = 100 * MovingAverage(averageType, plusDM, length) / ATR; plot "DI-" = 100 * MovingAverage(averageType, minusDM, length) / ATR; def DX = if ("DI+" + "DI-" > 0) then 100 * AbsValue("DI+" - "DI-" ) / ("DI+" + "DI-" ) else 0; plot ADX = MovingAverage(averageType, DX, length); "DI+".SetDefaultColor(GetColor(1)); "DI-".SetDefaultColor(GetColor(8)); ADX.SetDefaultColor(GetColor(5));
Re: chop indicator May 04, 2018 03:06PM |
Registered: 5 years ago Posts: 23 |
Re: Fun with ThinkScript May 04, 2018 03:12PM |
Registered: 6 years ago Posts: 33 |
Re: Fun with ThinkScript May 04, 2018 08:44PM |
Registered: 6 years ago Posts: 33 |
Re: Fun with ThinkScript May 05, 2018 12:42AM |
Registered: 5 years ago Posts: 2 |
Inputs: Length(8), Displace(0); Variables: AvgExp(0), RelC(0), Gap(0), Accum(0); if date <> date[1] then begin Gap = Open - Close[1]; Accum = Accum + Gap; end; RelC = Close - Accum; AvgExp = XAverage(RelC, Length); Plot1[Displace](AvgExp + Accum[Displace], "AvgExp" );
input AvgType = AverageType.EXPONENTIAL; input Length = 8; def avg; def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1]; def todaysOpen = open(period = AggregationPeriod.DAY); def yesterdaysClose = close(period = AggregationPeriod.DAY)[1]; def gapCount = gapCount[1] + newDay; def gap = if newDay and gapCount > 1 then todaysOpen - yesterdaysClose else gap[1]; def accum = if newDay then accum[1] + gap else accum[1]; def relC = close - accum; avg = MovingAverage(AvgType, relC, Length); plot avg_gl = avg + accum; plot g = gap; plot a = accum; plot nd = relC; plot tdo = todaysOpen; plot ycl = yesterdaysClose;
Re: Fun with ThinkScript May 05, 2018 07:38AM |
Registered: 7 years ago Posts: 126 |
Re: Fun with ThinkScript May 05, 2018 02:43PM |
Registered: 5 years ago Posts: 2 |
Buy and Sell lines on chart of zigzag May 04, 2018 03:17PM |
Registered: 5 years ago Posts: 23 |
Re: Buy and Sell lines on chart of zigzag May 07, 2018 02:08AM |
Registered: 7 years ago Posts: 126 |
Quote
optionmaster
is there a way to have BUY CALL AND BUY PUT vertical lines on chart when zigzag forms a new trend. Color RED for BUY PUTS. Color Green for BUY CALLS.
AddVerticalLine(showBubbleschange and !IsNaN("ZZ$" ) and barNumber != 1, "Buy", if barCount == barNumber or !isConf then GlobalColor("Unconfirmed" ) else if isUp then GlobalColor("Down" ) else GlobalColor("Up" ),curve.FIRM);
Re: Buy and Sell lines on chart of zigzag May 07, 2018 02:05PM |
Registered: 5 years ago Posts: 23 |
Re: Buy and Sell lines on chart of zigzag May 07, 2018 03:25PM |
Registered: 7 years ago Posts: 126 |