Re: Fun with ThinkScript June 27, 2014 04:11PM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript June 27, 2014 04:18PM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript June 27, 2014 04:21PM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript June 27, 2014 04:58PM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript June 27, 2014 05:05PM |
Registered: 10 years ago Posts: 615 |
Quote
eurekaaaa
Next it's not necessarily the 1st bar back that inband needs to be >= MinDaysInband , it could be one, two, three or more bars back depending on how many days the stock closed outside of the Bollinger bands.
input length = 21; input MinDaysInband = 15; def sDev = StDev(data = close, length = length); def Avg = Average(close, length); def UpperBand = Avg + 2 * sDev; def LowerBand = Avg - 2 * sDev; def inband = if close < UpperBand and close > LowerBand then inband[1] + 1 else 0; def outband = if inband then 0 else if (inband[1] >= MinDaysInband or outband[1] >= 1) then outband[1] + 1 else 0; AddLabel(inband >= MinDaysInband, "In BB: " + inband, Color.BLACK); AddLabel(outband, "Out BB: " + outband, Color.WHITE); # delete this line and the two below if NOT used as a watchlist column AddLabel(inband < MinDaysInband and !outband, " ", Color.CURRENT); AssignBackgroundColor(if inband >= MinDaysInband then Color.DARK_ORANGE else if outband then Color.PLUM else Color.CURRENT);
Re: Fun with ThinkScript June 28, 2014 01:39PM |
Registered: 10 years ago Posts: 615 |
Quote
Bryce3000
I was wondering if anyone happen to know a way to quickly seach for the following.
Scan for for stocks that have the following.
1) Look at the past earnings (Choose how many earnings you go back, minimum of three earnings.
2) Look for stocks that were always going up PRIOR to earnings for at least a 10% difference from the day before earnings.
3) Look for stocks that were always going down PRIOR to earnings for at least a 10% difference from the day before earnings.
4) Look for stocks that were always going down AFTER to earnings for at least a 10% difference from the day after earnings.
5) Look for stocks that were always going up AFTER to earnings for at least a 10% difference from the day after earnings.
The reason I mention the day before or after is because if you include the earnings date within the mathmatical equation it would be scewed due to to gap ups and downs that earnings produces.
Alternative to this search method would be some sort of color, arrow, etc.. that indicates the direction the trend is going as long as the following is true.
1) There is a 10% difference from the first candlestick to the candlestick right before earnings or after earnings.
Any ideas?
Re: Fun with ThinkScript June 28, 2014 02:23PM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript June 28, 2014 02:34PM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript June 28, 2014 02:49PM |
Registered: 9 years ago Posts: 9 |
Re: Fun with ThinkScript June 28, 2014 02:57PM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript June 28, 2014 03:00PM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript June 29, 2014 11:49AM |
Registered: 9 years ago Posts: 9 |
Re: Fun with ThinkScript June 29, 2014 02:20PM |
Registered: 9 years ago Posts: 9 |
Re: Fun with ThinkScript June 29, 2014 03:22PM |
Registered: 10 years ago Posts: 615 |
Quote
wiineedmore
Is there why to make an alert that can be made to automatically do this when a new High or low is hit? instead of having to do it manually set this every time a new high or low is hit.
Re: Fun with ThinkScript June 29, 2014 04:00PM |
Registered: 9 years ago Posts: 9 |
Re: Fun with ThinkScript June 29, 2014 04:47PM |
Registered: 10 years ago Posts: 615 |
Quote
wiidneedmore
can this shut off say after 10min (color goes back to default). For example the High on the 1day 5min charts Hit at 16:30 Est charts last time is 1700 or 1655 maybe the background can clear and reset for the next High or Low.
Re: Fun with ThinkScript June 29, 2014 08:00PM |
Registered: 9 years ago Posts: 9 |
Re: Fun with ThinkScript June 29, 2014 09:22PM |
Registered: 10 years ago Posts: 615 |
Quote
wiineedmore
the alert itself is not picking the correct high or low.
def dayHigh = if GetDay() != GetDay()[1] then high else if high > dayHigh[1] then high else dayHigh[1]; def dayLow = if GetDay() != GetDay()[1] then low else if low < dayLow[1] then low else dayLow[1]; AssignBackgroundColor(if high > dayHigh[1] then Color.BLUE else if low < dayLow[1] then Color.BLUE else Color.CURRENT); Alert(high > dayHigh[1], Concat(GetSymbolPart(), " has a new intraday high." ), Alert.BAR, Sound.Ring); Alert(low < dayLow[1], Concat(GetSymbolPart(), " has a new intraday low." ), Alert.BAR, Sound.Ring);
Quote
Can you make it turn blue for the Low and the High
Re: Fun with ThinkScript June 29, 2014 10:27PM |
Registered: 9 years ago Posts: 9 |
Re: Fun with ThinkScript June 30, 2014 12:16AM |
Registered: 9 years ago Posts: 9 |
Re: Fun with ThinkScript June 30, 2014 06:50AM |
Registered: 10 years ago Posts: 615 |
Quote
wiineedmore
Maybe the code still needs to be adjusted or may have used the wrong terminology, I am just looking for every new High of the (1 day) and low's. You know just the ones that create the white Bubbles that say Hi: ****** like right now the EUR/JPY Hi 138.492 maybe these are just called highs and lows not intraday?
AssignBackgroundColor(if high == HighestAll(high) then Color.BLUE else if low == LowestAll(low) then Color.BLUE else Color.CURRENT); Alert(high == HighestAll(high), GetSymbolPart() + " has a new intraday high.", Alert.BAR, Sound.Ring); Alert(low == LowestAll(low), GetSymbolPart() + " has a new intraday low.", Alert.BAR, Sound.Ring);
Re: Fun with ThinkScript June 30, 2014 08:13AM |
Registered: 12 years ago Posts: 373 |
Re: Fun with ThinkScript July 02, 2014 07:03PM |
Registered: 9 years ago Posts: 5 |
Re: Fun with ThinkScript July 03, 2014 03:40PM |
Registered: 9 years ago Posts: 75 |
# macd def Value = MACD(2, 5, 2, "EMA" ).Value; def Avg = MACD(2, 5, 2, "EMA" ).Avg; def MACDup = Value > Avg; def MACDdn = Value <= Avg; # stochslow def SlowD = StochasticFull(80, 30, 2, 2, hlc3, hlc3, hlc3, 3, "EMA" ).FullD; def SlowDup = SlowD crosses above 30; def SlowDdn = SlowD crosses below 80; # CCI def CCI = CCI(7); def CCIup = CCI crosses above -100; def CCIdn = CCI crosses below 100; # MFI def MFIup = MoneyFlowIndex(length = 1).MoneyFlowIndex crosses above 20; def MFIdn = MoneyFlowIndex(length = 1).MoneyFlowIndex crosses below 80; # RMI def emaInc = ExpAverage(Max(close - close[5], 0), 2); def emaDec = ExpAverage(Max(close[5] - close, 0), 3); def RMI = if emaDec == 0 then 0 else 100 - 100 / (1 + emaInc / emaDec); def RMIob = RMI >= 70; def RMIos = RMI <= 30; # Signals plot signalUP = MACDup and SlowDup and CCIup and MFIup and RMIos; signalUP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); signalUP.SetLineWeight(3); signalUP.SetDefaultColor(Color.LIGHT_GREEN); plot signalDN = MACDdn and SlowDdn and CCIdn and MFIdn and RMIob; signalDN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); signalDN.SetLineWeight(3); signalDN.SetDefaultColor(Color.PINK);
Re: Fun with ThinkScript July 05, 2014 01:17PM |
Registered: 12 years ago Posts: 321 |
Re: Fun with ThinkScript July 05, 2014 09:32PM |
Registered: 9 years ago Posts: 4 |
Re: Fun with ThinkScript July 05, 2014 10:06PM |
Registered: 11 years ago Posts: 106 |
Re: Fun with ThinkScript July 06, 2014 06:52AM |
Registered: 10 years ago Posts: 615 |
script OpenRange { input ORtime = 5; def FirstBar = secondsfromtime(0930) >= 0 and secondsfromtime(0930) < 60; def RangeTime = SecondsFromTime(0930) >= 0 and SecondsFromTime(0930) < 60 * ORtime; def Rhigh = if FirstBar then high else if RangeTime and high > Rhigh[1] then high else Rhigh[1]; def Rlow = if FirstBar then low else if RangeTime and low < Rlow[1] then low else Rlow[1]; plot h = if RangeTime or secondstilltime(0930) > 0 then Double.NaN else Rhigh; plot l = if RangeTime or secondstilltime(0930) > 0then Double.NaN else Rlow; }
Re: Fun with ThinkScript July 06, 2014 02:04PM |
Registered: 9 years ago Posts: 4 |
Re: Fun with ThinkScript July 10, 2014 04:43PM |
Registered: 9 years ago Posts: 8 |