Re: Fun with ThinkScript March 18, 2014 08:09AM |
Registered: 10 years ago Posts: 615 |
Quote
Tan
Wow, the code works great! Thank you so much. You're the best
Quote
Tan
Can you help me with a few other things? Is it possible also for the entry price to be displayed in the alert message?
#Trigger alerts Alert(AboveYhigh and !AboveYhigh[1], Concat(GetSymbolPart(), Concat(" above yesterday's high. Entry Price: ", Round(Yhigh + ATR, 2))), Alert.BAR, Sound.Chimes); Alert(AbovePivot and !AbovePivot[1], Concat(GetSymbolPart(), Concat(" above pivot point. Entry Price: ", Round(Pivot + ATR, 2))), Alert.BAR, Sound.Chimes); Alert(AboveORHigh and !AboveORHigh[1], Concat(GetSymbolPart(), Concat(" above opening range high. Entry Price: ", Round(ORHigh + ATR, 2))), Alert.BAR, Sound.Chimes); Alert(BelowYlow and !BelowYlow[1], Concat(GetSymbolPart(), Concat(" below yesterday's low. Entry Price: ", Round(Ylow - ATR, 2))), Alert.BAR, Sound.Chimes); Alert(BelowPivot and !BelowPivot[1], Concat(GetSymbolPart(), Concat(" below pivot point. Entry Price: ", Round(Pivot - ATR, 2))), Alert.BAR, Sound.Chimes); Alert(BelowORLow and !BelowORLow[1], Concat(GetSymbolPart(), Concat(" below opening range low. Entry Price: ", Round(ORLow - ATR, 2))), Alert.BAR, Sound.Chimes);
Quote
Tan
I want to add a label which displays current 2 minute ATR on upper chart next to the ADX label. The lower studies get cut off when I open 2 charts horizontally and I cannot see the ATR.
AddLabel(ADXred, Concat("SPY ADX: ", Round(AltSymbolADX,2)), Color.PINK); AddLabel(ADXgreen, Concat("SPY ADX: ", Round(AltSymbolADX,2)), Color.UPTICK); AddLabel(yes, Concat("ATR: ", Round(ATR, 2)), Color.LIME); AddCloud(OpenRangeHigh, OpenRangeLow, Color.LIGHT_GRAY);
def h = high(symbol, Period="Day" ); def l = low(symbol, Period="Day" ); def c = close(symbol, Period="Day" );
Quote
Tan
Is it possible to build custom watch list columns for previous day range, open range, and pivot point which show green or red color in front of the symbol when long or short entries are triggered?
plot HL = if close > high[1] then 1 else if close < low[1] then -1 else 0; AssignBackgroundColor(if HL > 0 then Color.UPTICK else if HL < 0 then Color.DOWNTICK else Color.DARK_GRAY); HL.AssignValueColor(if HL > 0 then Color.UPTICK else if HL < 0 then Color.DOWNTICK else Color.DARK_GRAY);
def pivot = (high[1] + low[1] + close[1]) / 3; plot pp = if open > pivot and close < pivot then -1 else if open < pivot and close > pivot then 1 else 0; AssignBackgroundColor(if pp > 0 then Color.UPTICK else if pp < 0 then Color.DOWNTICK else Color.DARK_GRAY); pp.AssignValueColor(if pp > 0 then Color.UPTICK else if pp < 0 then Color.DOWNTICK else Color.DARK_GRAY);
def mybarcount = RoundUp(SecondsFromTime(0930) / 300, 0); def orHigh = GetValue(high, mybarcount); def orLow = GetValue(low, mybarcount); plot signal = if close > orHigh then 1 else if close < orLow then -1 else 0; AssignBackgroundColor(if signal == 1 then Color.Uptick else if signal == -1 then Color.Downtick else Color.DARK_GRAY); signal.AssignValueColor(if signal == 1 then Color.Uptick else if signal == -1 then Color.Downtick else Color.DARK_GRAY);
Re: Fun with ThinkScript March 18, 2014 04:46PM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript March 18, 2014 05:09PM |
Registered: 10 years ago Posts: 615 |
Quote
Tan
One minor issue: Before market open, while I'm looking at the pre market chart, the open range high and low alerts keep getting triggered very frequently even though there is no 5 minute open range formed yet!
#Trigger alerts Alert(SecondsFromTime(0930) > 0 and AboveYhigh and !AboveYhigh[1], Concat(GetSymbolPart(), Concat(" above yesterday's high. Entry Price: ", Round(Yhigh + ATR, 2))), Alert.BAR, Sound.Chimes); Alert(SecondsFromTime(0930) > 0 and AbovePivot and !AbovePivot[1], Concat(GetSymbolPart(), Concat(" above pivot point. Entry Price: ", Round(Pivot + ATR, 2))), Alert.BAR, Sound.Chimes); Alert(SecondsFromTime(0930) > 0 and AboveORHigh and !AboveORHigh[1], Concat(GetSymbolPart(), Concat(" above opening range high. Entry Price: ", Round(ORHigh + ATR, 2))), Alert.BAR, Sound.Chimes); Alert(SecondsFromTime(0930) > 0 and BelowYlow and !BelowYlow[1], Concat(GetSymbolPart(), Concat(" below yesterday's low. Entry Price: ", Round(Ylow - ATR, 2))), Alert.BAR, Sound.Chimes); Alert(SecondsFromTime(0930) > 0 and BelowPivot and !BelowPivot[1], Concat(GetSymbolPart(), Concat(" below pivot point. Entry Price: ", Round(Pivot - ATR, 2))), Alert.BAR, Sound.Chimes); Alert(SecondsFromTime(0930) > 0 and BelowORLow and !BelowORLow[1], Concat(GetSymbolPart(), Concat(" below opening range low. Entry Price: ", Round(ORLow - ATR, 2))), Alert.BAR, Sound.Chimes);
Re: Fun with ThinkScript March 18, 2014 05:23PM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 18, 2014 06:43PM |
Registered: 10 years ago Posts: 615 |
input lineLength = 4; def barNumber = BarNumber(); def barCount = HighestAll(If(IsNaN(close), 0, barNumber)); def closeLine = if barNumber == 1 then Double.NaN else if barNumber == barCount - lineLength then close[-lineLength] else if barNumber == barCount then Double.NaN else closeLine[1]; plot data = closeLine; data.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Re: Fun with ThinkScript March 18, 2014 07:45PM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript March 18, 2014 08:19PM |
Registered: 10 years ago Posts: 615 |
Quote
GameOver
How hard would it be to add an alarm, say ring for a green bubble and a bell for a red bubble on the autowave script.
Alert(!IsNaN("ZZ$" ) and barNumber != 1 and isUp, Concat(GetSymbolPart(), " at new swing high." ), Alert.BAR, Sound.Ring); Alert(!IsNaN("ZZ$" ) and barNumber != 1 and !isUp, Concat(GetSymbolPart(), " at new swing low." ), Alert.BAR, Sound.Bell);
Re: Fun with ThinkScript March 18, 2014 09:01PM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 20, 2014 11:46AM |
Registered: 10 years ago Posts: 17 |
Re: Fun with ThinkScript March 20, 2014 02:55PM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript March 20, 2014 03:21PM |
Registered: 10 years ago Posts: 17 |
Re: Fun with ThinkScript March 20, 2014 07:27PM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 20, 2014 08:16PM |
Registered: 10 years ago Posts: 615 |
Quote
GameOver
Hello Robert,
How do you get the baby blue square that is posted with the edge squares that has the time frame in it?
again thanks, this is good stuff
#Display Chart Time Frame DefineGlobalColor("time", CreateColor(148, 214, 232)); 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(Weekly, "Weekly", GlobalColor("time" )); AddLabel(Daily, "Daily", GlobalColor("time" )); AddLabel(Intraday, concat(nMinutes, " Minute" ), GlobalColor("time" ));
Re: Fun with ThinkScript March 20, 2014 09:26PM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 02:23AM |
Registered: 10 years ago Posts: 615 |
Quote
GameOver
your the bomb. as Gary would say this is like breathing to you. or putting on socks
Re: Fun with ThinkScript March 21, 2014 09:22AM |
Registered: 10 years ago Posts: 17 |
Re: Fun with ThinkScript March 21, 2014 10:30AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 10:53AM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript March 21, 2014 11:01AM |
Registered: 10 years ago Posts: 615 |
Quote
GameOver
I am trying to make zones in the upper chart that just turn from red to green using the StochRSI using just one line ,,,,but all I can get is a ribbon cloud which smashes the chart
Re: Fun with ThinkScript March 21, 2014 11:18AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 11:20AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 11:24AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 11:28AM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript March 21, 2014 11:36AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 11:38AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 11:55AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 11:58AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript March 21, 2014 12:33PM |
Registered: 10 years ago Posts: 615 |
Quote
GameOver
just trying to use the fullD line of StochRSI to create the colored zones
..... puts a new meaning to it's a art thing
def RSI = RSIWilder(length = 13).RSI; def highestRSI = Highest(RSI, 21); def lowestRSI = Lowest(RSI, 21); def RSIS = 100 * (RSI - lowestRSI) / (highestRSI - lowestRSI); def "%K" = Average(rsis, 3); def "%D" = Average("%K", 5); def value1 = highestall(high); def value2 = lowestall(low); def neg = if "%D" < "%D"[1] then lowestall(low) else double.nan; addcloud(value1,value2,color.light_green); addcloud(value1,neg,color.pink);
Re: Fun with ThinkScript March 21, 2014 01:05PM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript April 11, 2014 09:25AM |
Registered: 10 years ago Posts: 27 |