Re: Using levels from EOD charts in intraday charts November 19, 2015 04:57AM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript November 19, 2015 07:45AM |
Registered: 10 years ago Posts: 464 |
Re: Fun with ThinkScript November 20, 2015 05:04PM |
Registered: 9 years ago Posts: 53 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 04:56PM |
Registered: 8 years ago Posts: 61 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 05:50PM |
Registered: 8 years ago Posts: 161 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 06:13PM |
Registered: 8 years ago Posts: 161 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 07:09PM |
Registered: 8 years ago Posts: 61 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 07:19PM |
Registered: 8 years ago Posts: 161 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 07:24PM |
Registered: 8 years ago Posts: 61 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 07:31PM |
Registered: 8 years ago Posts: 161 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 07:31PM |
Registered: 8 years ago Posts: 61 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 08:06PM |
Registered: 8 years ago Posts: 161 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 08:11PM |
Registered: 8 years ago Posts: 61 |
Re: Using levels from EOD charts in intraday charts November 22, 2015 08:18PM |
Registered: 8 years ago Posts: 161 |
Re: Using levels from EOD charts in intraday charts November 25, 2015 04:20PM |
Registered: 8 years ago Posts: 161 |
Re: Using levels from EOD charts in intraday charts November 25, 2015 04:37PM |
Registered: 8 years ago Posts: 161 |
Re: MA_DEV indicator November 26, 2015 06:12PM |
Registered: 8 years ago Posts: 161 |
input price = hlc3; input myavgrange = 9; input myavgrange2 = 9; input devrange = 20; def myavg = average(price,myavgrange); def myavg2 = average(price,myavgrange2); plot dev1 = myavg-price; plot dev2 = myavg2-price; plot dev1top = highest(dev1,devrange); plot dev1bot = lowest(dev1,devrange); plot topbotavg = (dev1top+dev1bot)/2; AddCloud(dev1top,topbotavg,color.yellow); AddCloud(topbotavg,dev1bot,color.blue);
Re: Using levels from EOD charts in intraday charts November 27, 2015 07:57AM |
Registered: 8 years ago Posts: 61 |
Re: Using levels from EOD charts in intraday charts November 27, 2015 04:04PM |
Registered: 8 years ago Posts: 161 |
declare lower; plot nysetrin = hlc3("$TRIN" );(arrgghhh- hadda keep Editing to get rid of smiley, so is extra space after $TRIN above)
Re: Using levels from EOD charts in intraday charts November 29, 2015 10:39AM |
Registered: 8 years ago Posts: 61 |
Re: Using levels from EOD charts in intraday charts November 29, 2015 06:13PM |
Registered: 8 years ago Posts: 161 |
Re: Using levels from EOD charts in intraday charts November 29, 2015 08:57PM |
Admin Registered: 13 years ago Posts: 131 |
Re: Fun with ThinkScript December 06, 2015 07:24PM |
Registered: 8 years ago Posts: 1 |
Re: Fun with ThinkScript December 10, 2015 03:04PM |
Registered: 8 years ago Posts: 7 |
# 3 moving averages crossover signals input SMA_short = 5; input SMA_medium = 20; input SMA_long = 50; def AvgS = Average(close, SMA_short); def AvgM = Average(close, SMA_medium); def AvgL = Average(close, SMA_long); def Candle_White = close > open; def Candle_Red = close < open; def Eup = (AvgS > AvgM and AvgM > AvgL); def Edn = (AvgS < AvgM and AvgM < AvgL); def CrossUp = Eup and !Eup[1] and close > AvgM; def CrossDn = Edn and !Edn[1] and close < AvgM; def BuySignalUp = if (Eup and Candle_White and CrossUp[0] and close > (if Candle_White[1] then close[1] else open[1])) then 1 else if (Eup and Candle_White and CrossUp[1] and close[1] < (if Candle_White[2] then close[2] else open[2]) and close > (if Candle_White[2] then close[2] else open[2])) then 1 else Double.NaN; def BuySignalDn = if (Edn and Candle_Red and CrossDn[0] and close < (if Candle_Red[1] then close[1] else open[1])) then 1 else if (Edn and Candle_Red and CrossDn[1] and close[1] > (if Candle_Red[2] then close[2] else open[2]) and close < (if Candle_Red[2] then close[2] else open[2])) then 1 else Double.NaN; def strongEup = Eup and close > AvgS; def strongEdn = Edn and close < AvgS; #VOLUME SPIKE input AverageLength = 10; input VolumeMultiplier = 3; input MinutesAfterOpen = 1; def AvgVol = average(volume, AverageLength); def VolX = (volume > AvgVol * VolumeMultiplier) and (secondsfromtime(0930) >= 60 * MinutesAfterOpen); #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 = if close > UpperBand then 1 else Double.NaN; def CloseBelow = if close < LowerBand then 1 else Double.NaN; Alert(CloseAbove and VolX and strongEup , Concat(GetSymbolPart(), " Above Upper Band." ), Alert.BAR, Sound.Bell); Alert(CloseBelow and Volx and strongEdn , Concat(GetSymbolPart(), " Below Lower Band" ), Alert.BAR, Sound.Bell);
Re: Fun with ThinkScript December 11, 2015 12:25PM |
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 = no; 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(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); ## END CODE
Re: Fun with ThinkScript December 12, 2015 10:29PM |
Registered: 8 years ago Posts: 1 |
Re: Fun with ThinkScript December 13, 2015 10:34PM |
Registered: 10 years ago Posts: 464 |
Re: Fun with ThinkScript December 16, 2015 11:04AM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript December 16, 2015 04:39PM |
Registered: 8 years ago Posts: 4 |
Re: Fun with ThinkScript December 16, 2015 06:21PM |
Registered: 8 years ago Posts: 4 |