AsGoodAsItGets

csricksdds

New member
VIP
Oh boy! Here goes

I have named this indicator AsGoodAsItGets: I would like to get an alert to notify me when it hits the chart, such as a chime. Here is the code:

# AsGoodAsItGets Indicator
#CSR Buy/Sell Arrows with Short/Long Bubbles
#Developed 4-9-22 First Edition

declare upper;

input atrreversal = 2.0;

def priceh = MovingAverage(AverageType.EXPONENTIAL, high, 5);
def pricel = MovingAverage(AverageType.EXPONENTIAL, low, 5);

def EIL = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastL;
def EIH = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastH;

def tenkan_period = 9;
def kijun_period = 26;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
def avgPerc = ((Kijun - close) / Kijun) * 100;

plot signal = !isNaN(EIL) within 15 bars and low < Kijun and avgPerc < 15 and avgPerc > 0 and avgPerc[1] < avgPerc;
signal.setDefaultColor(color.white);

plot KijunCross = signal within 10 bars and Crosses(close, kijun, CrossingDirection.ABOVE);
kijuncross.setDefaultColor(color.white);

def overKijun = (kijunCross within 10 bars or overKijun[1] == 1) and low > kijun;
plot overKijun1 = overKijun;
overKijun1.setDefaultcolor(color.white);

plot signaldown = !isNAN(EIH);
signaldown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down); AddLabel(!isNAN(EIH),"Short",color.white);

AddChartBubble(SignalDown, high, "Short", Color.white, yes);

plot signalrevBot = !isNaN(EIL);
signalrevBot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_up);

AddChartBubble(Signalrevbot, low, "Long", Color.white, no);

Thanks- some of my friends up North told me about a TradingView Indicator developed by Harry Wang group but I don't want to join both him and TradinView and so I put this one together which my friends up north say follows the one on TradingView very closely. I use it mostly for day trading the SPY and QQQ on 2 min and 5 min charts ands try to set the SD at the tops/bottoms for these.
 
Solution
Rats...that's no giving me signals...maybe I'm doing something wrong?? I added the code and set it for repeatedly play sound but don't seem to be getting??

You should not have to change any part of the alert. I have tested it on a 1min and 5min chart of stocks in ONDemand and it works. If it still does not work, please provide the chart symbol and chart timeframes

Here is the full code with the alerts

Ruby:
# AsGoodAsItGets Indicator
#CSR Buy/Sell Arrows with Short/Long Bubbles
#Developed 4-9-22 First Edition

declare upper;

input atrreversal = 2.0;

def priceh = MovingAverage(AverageType.EXPONENTIAL, high, 5);
def pricel = MovingAverage(AverageType.EXPONENTIAL, low, 5);

def EIL = ZigZagHighLow("price h" = priceh, "price...

csricksdds

New member
VIP
csricksdds: This looks good but can you tell me how it triggers a signal and has this been back tested? The signals on any timeframe look too good:) Thanks for sharing
Go back several days and look at the bubbles to see if they would have made money for you. If I buy aPut at the short bubble and the bubble disappears I will usually close that position...right now on the SPY you had a long at 11:06 and it is still in play on the 2 min chart?
 

csricksdds

New member
VIP
That's very true although I usually find like the short generated just now on the 2 min SPY will usually fall until it generates a new long...do you see that long intraday wick the SPY generated to the downside...the question is: Will it be covered before end of day?? Have you found a better day trading indicator? I haven't to this point for myself?
 

tenacity11

Active member
2019 Donor
I trade a 5m SSO and have been following the indicator for a few days. I put the 5m VIX with it and again adding the indicator. Very interesting...

It's an ETF for S&P....It's 2x and good for day trading
It triggered L at 12:10 while VIX triggered short
 
Last edited by a moderator:

Snorg

New member
Oh boy! Here goes

I have named this indicator AsGoodAsItGets: I would like to get an alert to notify me when it hits the chart, such as a chime. Here is the code:

# AsGoodAsItGets Indicator
#CSR Buy/Sell Arrows with Short/Long Bubbles
#Developed 4-9-22 First Edition

declare upper;

input atrreversal = 2.0;

def priceh = MovingAverage(AverageType.EXPONENTIAL, high, 5);
def pricel = MovingAverage(AverageType.EXPONENTIAL, low, 5);

def EIL = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastL;
def EIH = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastH;

def tenkan_period = 9;
def kijun_period = 26;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
def avgPerc = ((Kijun - close) / Kijun) * 100;

plot signal = !isNaN(EIL) within 15 bars and low < Kijun and avgPerc < 15 and avgPerc > 0 and avgPerc[1] < avgPerc;
signal.setDefaultColor(color.white);

plot KijunCross = signal within 10 bars and Crosses(close, kijun, CrossingDirection.ABOVE);
kijuncross.setDefaultColor(color.white);

def overKijun = (kijunCross within 10 bars or overKijun[1] == 1) and low > kijun;
plot overKijun1 = overKijun;
overKijun1.setDefaultcolor(color.white);

plot signaldown = !isNAN(EIH);
signaldown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down); AddLabel(!isNAN(EIH),"Short",color.white);

AddChartBubble(SignalDown, high, "Short", Color.white, yes);

plot signalrevBot = !isNaN(EIL);
signalrevBot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_up);

AddChartBubble(Signalrevbot, low, "Long", Color.white, no);

Thanks- some of my friends up North told me about a TradingView Indicator developed by Harry Wang group but I don't want to join both him and TradinView and so I put this one together which my friends up north say follows the one on TradingView very closely. I use it mostly for day trading the SPY and QQQ on 2 min and 5 min charts ands try to set the SD at the tops/bottoms for these.
Do you have a link to this original TradingView script?
 

csricksdds

New member
VIP
That's why I named it that way...I also use CCI_LowerWithArrows...usually makes a good trade when both concur...AGAIG does repaint so be careful trading up in a downtrend or vice versa?? It has produced a few dollars today!!
 

3AMBH

Member
2019 Donor
VIP
Try Fishertransform. It looks to be a good add on to verify CCI or even be better.

declare lower;

input price = hl2;
input length = 10;

def maxHigh = Highest(price, length);
def minLow = Lowest(price, length);
def range = maxHigh - minLow;
def value = if IsNaN(price)
then Double.NaN
else if IsNaN(range)
then value[1]
else if range == 0
then 0
else 0.66 * ((price - minLow) / range - 0.5) + 0.67 * value[1];
def truncValue = if value > 0.99 then 0.999 else if value < -0.99 then -0.999 else value;
def fish = 0.5 * (log((1 + truncValue) / (1 - truncValue)) + fish[1]);

plot FTOneBarBack = fish[1];
plot FT = fish;
plot ZeroLine = 0;

FTOneBarBack.SetDefaultColor(GetColor(1));
FT.SetDefaultColor(GetColor(8));
ZeroLine.SetDefaultColor(GetColor(5));
 

3AMBH

Member
2019 Donor
VIP
I've settled on Fishertransform with arrows & RSI Extreme. I have a 3 minute chart open and a 5 minute. The 3 minute "sometimes" throws an early signal and trade the 5 minute.


Fishertransform with arrows

declare lower;

input price = hl2;
input length = 10;

def maxHigh = Highest(price, length);
def minLow = Lowest(price, length);
def range = maxHigh - minLow;
def value = if IsNaN(price)
then Double.NaN
else if IsNaN(range)
then value[1]
else if range == 0
then 0
else 0.66 * ((price - minLow) / range - 0.5) + 0.67 * value[1];
def truncValue = if value > 0.99 then 0.999 else if value < -0.99 then -0.999 else value;
def fish = 0.5 * (log((1 + truncValue) / (1 - truncValue)) + fish[1]);

plot FTOneBarBack = fish[1];
plot FT = fish;
plot ZeroLine = 0;

FTOneBarBack.SetDefaultColor(GetColor(1));
FT.SetDefaultColor(GetColor(8));
ZeroLine.SetDefaultColor(GetColor(5));

def bull_cross = FT crosses above FTOneBarBack;
def bear_cross = FT crosses below FTOneBarBack;


plot arrow = if FT crosses above FTOneBarBack then fish else Double.NaN;
arrow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
arrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
arrow.SetDefaultColor(Color.GREEN);

plot arrowD = if FT crosses below FTOneBarBack then fish else Double.NaN;
arrowD.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
arrowD.SetPaintingStrategy(PaintingStrategy.ARROW_Down);
arrowD.SetDefaultColor(Color.RED);
# Alerts
Alert(bull_cross, " ", Alert.Bar, Sound.Chimes);
Alert(bear_cross, " ", Alert.Bar, Sound.Bell);



and RSI Extreme


# RSI_Extreme
# Based on TOS standard RSI
# By: rad14733 on usethinkscript.com
# Can be used as either an upper or lower indicator. Drag into upper chart panel for on-chart display.
# v1.0 : 2020-09-01 : Original code with midlines
# v1.1 : 2020-09-15 : Modified settings for personal preference
# v1.2 : 2021-01-22 : Added option to plot vertical lines at Start and End times
# v1.3 : 2021-03-15 : Added option to plot horizontal rsiLine across chart at current RSI level
# v1.4 : 2021-03-29 : Added option to plot trending color average line
# v1.5 : 2021-03-29 : Added code to eliminate vertical lines for AggregationPeriods above Four_Hours
# v1.6 : 2021-03-29 : Added option to adjust RSI chart label decimal rounding

declare lower;

input length = 13;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = yes;
input showRSI = yes;
input showMidLines = yes;
input showRsiChartLabel = yes;
input rsiLabelDecimals = 4;
input showStartTimeLine = yes;
input showEndTimeLine = yes;
input startTime = 0930;
input endTime = 1600;
input showHorRsiLine = yes;
input showAvgRsi = yes;
input avgRsiLength = 3;
input avgRsiAverageType = AverageType.WILDERS;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

plot RSI = 50 * (ChgRatio + 1);

plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot UpSignal = if RSI <= OverSold then OverSold else Double.NaN;

plot DownSignal = if RSI >= OverBought then OverBought else Double.NaN;

plot forty = if showMidLines then 40 else Double.NaN;
forty.SetDefaultColor(Color.LIGHT_GRAY);
forty.SetPaintingStrategy(PaintingStrategy.DASHES);
forty.SetLineWeight(1);

plot fifty = if showMidLines then 50 else Double.NaN;
fifty.SetDefaultColor(Color.ORANGE);
fifty.SetPaintingStrategy(PaintingStrategy.DASHES);
fifty.SetLineWeight(1);

plot sixty = if showMidLines then 60 else Double.NaN;
sixty.SetDefaultColor(Color.LIGHT_GRAY);
sixty.SetPaintingStrategy(PaintingStrategy.DASHES);
sixty.SetLineWeight(1);

RSI.DefineColor("OverBought", GetColor(5));
RSI.DefineColor("Normal", GetColor(7));
RSI.DefineColor("OverSold", GetColor(1));
RSI.AssignValueColor(if RSI > over_Bought then RSI.color("OverBought") else if RSI < over_Sold then RSI.color("OverSold") else RSI.color("Normal"));
RSI.SetHiding(!showRSI);

OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));

UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
UpSignal.SetLineWeight(5);
UpSignal.SetHiding(!showBreakoutSignals);

DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
DownSignal.SetLineWeight(5);
DownSignal.SetHiding(!showBreakoutSignals);

#Place vertical lines at start and end times
def startTimeValue = SecondsFromTime(StartTime) == 0;
def endTimeValue = SecondsFromTime(endTime) == 0;
def aggOk = if GetAggregationPeriod() < AggregationPeriod.DAY then 1 else Double.NaN;
AddVerticalLine(aggOk and showStartTimeLine and startTimeValue,"Start",Color.GREEN,Curve.SHORT_DASH);
AddVerticalLine(aggOk and showEndTimeLine and endTimeValue,"End",Color.RED,Curve.SHORT_DASH);

#Display RSI Chart Label
AddLabel(showRsiChartLabel, "RSI: " + Round(rsi, rsiLabelDecimals), if rsi < over_Sold then RSI.color("OverSold") else if rsi > over_Bought then RSI.color("OverBought") else RSI.color("Normal"));

#Plot moving rsiLine across chart at current RSI level
plot rsiLine = if showHorRsiLine then HighestAll(if !IsNaN(RSI) and IsNaN(RSI[-1]) then RSI else Double.NaN) else Double.NaN;
rsiLine.SetDefaultColor(Color.BLACK);
rsiLine.AssignValueColor(if RSI > over_Bought then RSI.color("OverBought") else if RSI < over_Sold then RSI.color("OverSold") else RSI.color("Normal"));
rsiLine.SetPaintingStrategy(PaintingStrategy.LINE_VS_TRIANGLES);
rsiLine.SetLineWeight(1);

#Trending Color Average Line
plot avgRsi = if showAvgRsi then MovingAverage(avgRsiAverageType, RSI, avgRsiLength) else Double.NaN;
avgRsi.DefineColor("UpTrend", Color.GREEN);
avgRsi.DefineColor("DownTrend", Color.RED);
avgRsi.SetLineWeight(2);
avgRsi.SetPaintingStrategy(PaintingStrategy.LINE);
avgRsi.SetStyle(Curve.FIRM);
avgRsi.AssignValueColor(if avgRsi > avgRsi[1] then avgRsi.Color("UpTrend") else avgRsi.Color("DownTrend"));

Today was a unique day in that a trader BTO about 23 MILLION Puts at about 9:15 am and that tanked the market. Will need to see how GoodAsItGets works over a longer period of time.

 

dwitenhafer

New member
I'm trying to figure out how to leave all of the signals the AsGoodAsItGets indicator generates on the chart - in other words stop the re-painting part. As soon as a bubble appears (or maybe at least on the close of that bar) the bubble remains. I've learned a good bit about Thinkscript but this one is stumping me a little. I'm still really a newbie. Thanks!
 

3AMBH

Member
2019 Donor
VIP
Will appreciate any input concerning this indicator. I have modified my charts and indicators as follows:

Candles: Heikin Ashi
As Good As It Gets
RSI Extreme
200 SMA


qTzacpj.png
 

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Top