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...

SleepyZ

Well-known member
VIP
Lifetime
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.

The following appears to sound alerts whenever the zigzag bubbles appear. Please note that the zigzag is a repainting indicator, where signals appear and then disappear. Therefore, you will sometimes hear an alert, but when you look at the chart, it may have disappeared. You can open the messages as a watchlist so that you can see what type of alert sounded.

Add this to the bottom of your code

Code:
input usealerts = yes;
alert(usealerts and signaldown[1] == 1, "Short", alert.bar, sound.chimes);
alert(usealerts and signalrevbot[1] == 1, "Long", alert.bar, sound.chimes);
 

csricksdds

New member
VIP
The following appears to sound alerts whenever the zigzag bubbles appear. Please note that the zigzag is a repainting indicator, where signals appear and then disappear. Therefore, you will sometimes hear an alert, but when you look at the chart, it may have disappeared. You can open the messages as a watchlist so that you can see what type of alert sounded.

Add this to the bottom of your code
Thanks I will give that a try!!
 

SleepyZ

Well-known member
VIP
Lifetime
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 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);

input usealerts = yes;
alert(usealerts and signaldown[1] == 1, "Short", alert.bar, sound.chimes);
alert(usealerts and signalrevbot[1] == 1, "Long", alert.bar, sound.chimes);
 
Solution

csricksdds

New member
VIP
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
Thank you very much...will give it a try tomorrow!
 

SleepyZ

Well-known member
VIP
Lifetime
Why when i post the code, chart gets sneezed from zero to the current price?
Am I I doing something wrong?
Uncheck any of those that are checked in the cyan circled area below
Capture.jpg
 

csricksdds

New member
VIP
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
Thank you very much....I had been spending several days trying to use this format modifying it multiple ways with no success::

Alert(!isNaN(EIL), signalrevbot , Alert.Bar, Sound.Chimes);

Alert(!isNaN (EIH), (signaldown), Alert.Bar, Sound.Chimes);
 

jhey

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
 
Last edited by a moderator:

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