Re: Fun with ThinkScript August 22, 2015 10:19PM |
Registered: 8 years ago Posts: 59 |
Re: Fun with ThinkScript August 22, 2015 10:37PM |
Registered: 8 years ago Posts: 59 |
Re: Fun with ThinkScript August 24, 2015 06:33PM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript August 24, 2015 08:15PM |
Registered: 8 years ago Posts: 59 |
Re: Fun with ThinkScript August 25, 2015 09:26AM |
Registered: 10 years ago Posts: 615 |
Quote
Palmer
Remember the decal idea? How's this? They would be about 8 inches long and 4 inches high. Viny decals. You could put it on your laptop cover, filing cabinet, car window...center of your wife's make-up mirror...spinning smiley sticking its tongue out
Let me know about any adjustments or idea.
Will send you a few of them.
Re: Fun with ThinkScript August 26, 2015 09:45AM |
Registered: 9 years ago Posts: 3 |
Re: Fun with ThinkScript August 26, 2015 05:53PM |
Registered: 10 years ago Posts: 615 |
Quote
jburrowsiv
Robert,
Have you been able to get the OR script to work on TOS Mobile? It seems the time based functions do not work on the mobile version.
Re: Fun with ThinkScript August 28, 2015 07:37PM |
Registered: 10 years ago Posts: 464 |
Re: Fun with ThinkScript August 28, 2015 09:50PM |
Registered: 12 years ago Posts: 321 |
Re: Fun with ThinkScript August 28, 2015 10:10PM |
Registered: 10 years ago Posts: 464 |
Re: Fun with ThinkScript August 28, 2015 10:43PM |
Registered: 8 years ago Posts: 59 |
## START CODE ## ZigZagSign TOMO modification, v0.2 written by Linus @Thinkscripter Lounge adapted from Thinkorswim ZigZagSign Script input price = close; input priceH = high; # swing high input priceL = low; # swing low input ATRreversalfactor = 3.2; def ATR = reference ATR(length = 5); def reversalAmount = ATRreversalfactor * ATR; input showlines = yes; input displace = 1; input showBubbleschange = yes; def barNumber = BarNumber(); def barCount = HighestAll(If(IsNaN(price), 0, barNumber)); rec state = {default init, undefined, uptrend, downtrend}; rec minMaxPrice; if (GetValue(state, 1) == GetValue(state.init, 0)) { minMaxPrice = price; state = state.undefined; } else if (GetValue(state, 1) == GetValue(state.undefined, 0)) { if (price <= GetValue(minMaxPrice, 1) - reversalAmount) { state = state.downtrend; minMaxPrice = priceL; } else if (price >= GetValue(minMaxPrice, 1) + reversalAmount) { state = state.uptrend; minMaxPrice = priceH; } else { state = state.undefined; minMaxPrice = GetValue(minMaxPrice, 1); } } else if (GetValue(state, 1) == GetValue(state.uptrend, 0)) { if (price <= GetValue(minMaxPrice, 1) - reversalAmount) { state = state.downtrend; minMaxPrice = priceL; } else { state = state.uptrend; minMaxPrice = Max(priceH, GetValue(minMaxPrice, 1)); } } else { if (price >= GetValue(minMaxPrice, 1) + reversalAmount) { state = state.uptrend; minMaxPrice = priceH; } else { state = state.downtrend; minMaxPrice = Min(priceL, GetValue(minMaxPrice, 1)); } } def isCalculated = GetValue(state, 0) != GetValue(state, 1) and barNumber >= 1; def futureDepth = barCount - barNumber; def tmpLastPeriodBar; if (isCalculated) { if (futureDepth >= 1 and GetValue(state, 0) == GetValue(state, -1)) { tmpLastPeriodBar = fold lastPeriodBarI = 2 to futureDepth + 1 with lastPeriodBarAcc = 1 while lastPeriodBarAcc > 0 do if (GetValue(state, 0) != GetValue(state, -lastPeriodBarI)) then -lastPeriodBarAcc else lastPeriodBarAcc + 1; } else { tmpLastPeriodBar = 0; } } else { tmpLastPeriodBar = Double.NaN; } def lastPeriodBar = if (!IsNaN(tmpLastPeriodBar)) then -AbsValue(tmpLastPeriodBar) else -futureDepth; rec currentPriceLevel; rec currentPoints; if (state == state.uptrend and isCalculated) { currentPriceLevel = fold barWithMaxOnPeriodI = lastPeriodBar to 1 with barWithMaxOnPeriodAcc = minMaxPrice do Max(barWithMaxOnPeriodAcc, GetValue(minMaxPrice, barWithMaxOnPeriodI)); currentPoints = fold maxPointOnPeriodI = lastPeriodBar to 1 with maxPointOnPeriodAcc = Double.NaN while IsNaN(maxPointOnPeriodAcc) do if (GetValue(priceH, maxPointOnPeriodI) == currentPriceLevel) then maxPointOnPeriodI else maxPointOnPeriodAcc; } else if (state == state.downtrend and isCalculated) { currentPriceLevel = fold barWithMinOnPeriodI = lastPeriodBar to 1 with barWithMinOnPeriodAcc = minMaxPrice do Min(barWithMinOnPeriodAcc, GetValue(minMaxPrice, barWithMinOnPeriodI)); currentPoints = fold minPointOnPeriodI = lastPeriodBar to 1 with minPointOnPeriodAcc = Double.NaN while IsNaN(minPointOnPeriodAcc) do if (GetValue(priceL, minPointOnPeriodI) == currentPriceLevel) then minPointOnPeriodI else minPointOnPeriodAcc; } else if (!isCalculated and (state == state.uptrend or state == state.downtrend)) { currentPriceLevel = GetValue(currentPriceLevel, 1); currentPoints = GetValue(currentPoints, 1) + 1; } else { currentPoints = 1; currentPriceLevel = GetValue(price, currentPoints); } plot "ZZ$" = if (barNumber == barCount or barNumber == 1) then if state == state.uptrend then priceH else priceL else if (currentPoints == 0) then currentPriceLevel else Double.NaN; rec zzSave = if !IsNaN("ZZ$" ) then if (barNumber == barCount or barNumber == 1) then if IsNaN(barNumber[-1]) and state == state.uptrend then priceH else priceL else currentPriceLevel else GetValue(zzSave, 1); def chg = (if barNumber == barCount and currentPoints < 0 then priceH else if barNumber == barCount and currentPoints > 0 then priceL else currentPriceLevel) - GetValue(zzSave, 1); def isUp = chg >= 0; #Higher/Lower/Equal High, Higher/Lower/Equal Low def xxhigh = if zzSave == priceH then Round(high, 2) else Round(xxhigh[1], 2); def chghigh = Round(Round(high, 2) - Round(xxhigh[1], 2), 2); def xxlow = if zzSave == priceL then Round(low, 2) else Round(xxlow[1], 2); def chglow = Round(Round(low, 2) - Round(xxlow[1], 2), 2); rec isConf = AbsValue(chg) >= reversalAmount or (IsNaN(GetValue("ZZ$", 1)) and GetValue(isConf, 1)); "ZZ$".EnableApproximation(); "ZZ$".DefineColor("Up Trend", Color.UPTICK); "ZZ$".DefineColor("Down Trend", Color.DOWNTICK); "ZZ$".DefineColor("Undefined", Color.WHITE); "ZZ$".AssignValueColor(if !isConf then "ZZ$".Color("Undefined" ) else if isUp then "ZZ$".Color("Up Trend" ) else "ZZ$".Color("Down Trend" )); DefineGlobalColor("Unconfirmed", Color.WHITE); DefineGlobalColor("Up", Color.UPTICK); DefineGlobalColor("Down", Color.DOWNTICK); AddChartBubble(showBubbleschange and !IsNaN("ZZ$" ) and barNumber != 1, if isUp then high else low , Round(chg, 2) , if barCount == barNumber or !isConf then GlobalColor("Unconfirmed" ) else if isUp then GlobalColor("Up" ) else GlobalColor("Down" ), isUp); ## END CODE
Re: Fun with ThinkScript August 28, 2015 11:01PM |
Registered: 10 years ago Posts: 615 |
Quote
Ralph53
This is a great script from an earlier page. Does anyone know how to alter it so that the AddChartBubbles (just the red and green ones) will show the actual price value of the highs and lows instead of the rise or decline from the previous bubble (while leaving the white bubble alone)?
AddChartBubble(showBubbleschange and !IsNaN("ZZ$" ) and barNumber != 1, if isUp then high else low , Round(if isUp then high else low, 2) , if barCount == barNumber or !isConf then GlobalColor("Unconfirmed" ) else if isUp then GlobalColor("Up" ) else GlobalColor("Down" ), isUp);
Re: Fun with ThinkScript August 29, 2015 09:49PM |
Registered: 8 years ago Posts: 59 |
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, " ", Color.Yellow, 0);
Re: Fun with ThinkScript August 31, 2015 11:39AM |
Registered: 9 years ago Posts: 67 |
input signalOffsetFactor = 0.20; def signalOffset = Average(TrueRange(high, close, low), 9) * signalOffsetFactor; def triggerSell = If(If(close[-1] < high, 1, 0) and (hlc3[-2] < close[-1] or hlc3[-3] < close[-1]), 1, 0); def triggerBuy = If(If(close[-1] > low, 1, 0) and (hlc3[-2] > close[-1] or hlc3[-3] > close[-1]), 1, 0); rec buySellSwitch = If(triggerSell, 1, If(triggerBuy, 0, buySellSwitch[1])); def thirdBarClosed = If(IsNaN(hlc3[-3]), 0, 1); plot BS_Long = If(triggerBuy and thirdBarClosed and buySellSwitch[1], low - signalOffset, Double.NaN); BS_Long.SetStyle(Curve.FIRM); BS_Long.SetPaintingStrategy(PaintingStrategy.POINTS); BS_Long.SetLineWeight(5); BS_Long.AssignValueColor(CreateColor(153, 255, 153));Thanks in advance for any assistance/guidance in this endeavor. It is certainly appreciated
Re: Fun with ThinkScript September 04, 2015 02:11PM |
Registered: 10 years ago Posts: 464 |
Re: Fun with ThinkScript September 06, 2015 04:41AM |
Registered: 8 years ago Posts: 7 |
Re: Fun with ThinkScript September 06, 2015 02:45PM |
Registered: 8 years ago Posts: 7 |
Re: Fun with ThinkScript September 06, 2015 04:26PM |
Registered: 10 years ago Posts: 615 |
Quote
gblinc2
Robert, coffee is on me. You truly have a servant heart to help people, maybe form years of service in the military. Cheers mate.
Re: Fun with ThinkScript September 06, 2015 06:10PM |
Registered: 8 years ago Posts: 7 |
Re: Fun with ThinkScript September 06, 2015 06:25PM |
Registered: 8 years ago Posts: 7 |
Re: Fun with ThinkScript September 06, 2015 07:38PM |
Registered: 9 years ago Posts: 67 |
Re: Fun with ThinkScript September 08, 2015 09:14PM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript September 09, 2015 12:02AM |
Registered: 8 years ago Posts: 7 |
Re: Fun with ThinkScript September 09, 2015 01:31PM |
Registered: 8 years ago Posts: 161 |
-------------------------------------------------------Quote
gblinc2
> I went back to look at the thinkscript for the chart and I am thinking the input portion of the
script regarding the price being used , which is the closed price and the length of -50 and width
of 60 will be part of that algorithm for the scan.
input length1 = 1; input length2 = 1; def upperlim = ((high[1]+low[1]+close[1])/3)*1.001618; def lowerlim = ((high[1]+low[1]+close[1])/3)-((high[1]+low[1]+close[1])/3)*0.001618; plot upperlimmax = average(upperlim,length1); plot lowerlimmax = average(lowerlim,length2);
Re: Fun with ThinkScript September 09, 2015 10:31PM |
Registered: 8 years ago Posts: 7 |
Re: Fun with ThinkScript September 10, 2015 12:43PM |
Registered: 8 years ago Posts: 2 |
ATR Breakout Scan September 10, 2015 12:26PM |
Registered: 8 years ago Posts: 2 |
Re: Fun with ThinkScript September 11, 2015 04:01PM |
Registered: 8 years ago Posts: 161 |
input length1 = 1; input length2 = 1; input goldmean1 = 1.00809; input goldmean2 = 0.004854; input midmaxminorval = 2.007; def upperlim = ((high[1]+low[1]+close[1])/3)*goldmean1; def lowerlim = ((high[1]+low[1]+close[1])/3)-((high[1]+low[1]+close[1])/3)*goldmean2; def upperlimmax = average(upperlim,length1); def lowerlimmax = average(lowerlim,length2); plot midmax = (upperlimmax+lowerlimmax)/2; plot midmaxminor = (upperlimmax+lowerlimmax)/midmaxminorval; AddCloud(midmax,midmaxminor,color.plum,color.plum);
Re: Fun with ThinkScript September 14, 2015 06:38AM |
Registered: 8 years ago Posts: 7 |
Intraday bull flag in Watchlist in ThinkorSwim September 14, 2015 03:58PM |
Registered: 8 years ago Posts: 1 |