Hi, Is there a way to count back the amount of candles when there is a GoldenCross or DeathCross and add it to the Chart Label in the following code? In any Timeframe.
Currently I have the chart label as 10<50 DC or 10>50 GC. I would like one space then the number of candles back. So it would look like 10>50 GC 3.
My thinking is if I see 10>50 GC 50 it's too late to trade, but, if I see 10>50 GC 2 now I found my Breakout in time
*OPTIONAL: To be more convenient the user should be able to change the EMA's into SMA and the length in the study panel.
- THANKS
AddLabel(yes, if bullishStart then “10>50 GC” else if bearishStart then “10<50 DC” Else “WAIT”, if bullishStart then color.light_green else if bearishStart then color.dark_orange else color.LIGHT_GRAY);
*FYI: In doing some research I found that the Death Cross and Golden Cross is based off the 50 ma crossing the 200 ma. So if I REALLY want exactly that I would have to use those parameters. However this can still work for any length one uses. Thanks
Hi, Is there a way to count back the amount of candles when there is a GoldenCross or DeathCross and add it to the Chart Label in the following code? In any Timeframe.
Currently I have the chart label as 10<50 DC or 10>50 GC. I would like one space then the number of candles back. So it would look like 10>50 GC 3.
My thinking is if I see 10>50 GC 50 it's too late to trade, but, if I see 10>50 GC 2 now I found my Breakout in time
*OPTIONAL: To be more convenient the user should be able to change the EMA's into SMA and the length in the study panel.
- THANKS
Hi, Is there a way to count back the amount of candles when there is a GoldenCross or DeathCross and add it to the Chart Label in the following code? In any Timeframe.
Currently I have the chart label as 10<50 DC or 10>50 GC. I would like one space then the number of candles back. So it would look like 10>50 GC 3.
My thinking is if I see 10>50 GC 50 it's too late to trade, but, if I see 10>50 GC 2 now I found my Breakout in time
*OPTIONAL: To be more convenient the user should be able to change the EMA's into SMA and the length in the study panel.
- THANKS
AddLabel(yes, if bullishStart then “10>50 GC” else if bearishStart then “10<50 DC” Else “WAIT”, if bullishStart then color.light_green else if bearishStart then color.dark_orange else color.LIGHT_GRAY);
*FYI: In doing some research I found that the Death Cross and Golden Cross is based off the 50 ma crossing the 200 ma. So if I REALLY want exactly that I would have to use those parameters. However this can still work for any length one uses. Thanks
Thank you so much halcyonguy. As I was checking out what you wrote it became apparent to me that I didn't think of the best way to use this. So I am wondering is it possible to add the count number to the candle top or bottom (and I guess in it's appropriate color to represent a bullish/bearish move) and still leave the chart label as is? It would make it SO Much faster to find it.
FYI: I reinstated the 200 MA so that I have a correct Golden Cross 50ema > 200 and a Death Cross 50ema < 200.
Also I need this to be accurate regardless of the TimeFrame.
I use the Trendline tool to read the bars.
SCREEECCCCHHH.... I thought everything was perfect, and then I was on a 1y 1D and found some discrepancies (AAPL 6/30/23) then worse on a 1d 1m, the count seems to be off.
def n = 1000;
def bullcnt = fold i1 = 0 to n
with p1
while !getvalue(bullishStart, i1)
do p1 + 1;
def bearcnt = fold i2 = 0 to n
with p2
while !getvalue(bearishStart, i2)
do p2 + 1;
#I added
def bullcntGC = fold i3 = 0 to n
with p3
while !getvalue(GC, i3)
do p3 + 1;
def bearcntDC = fold i4 = 0 to n
with p4
while !getvalue(DC, i4)
do p4 + 1;
#I added
def bullcnt10 = fold i5 = 0 to n
with p5
while !getvalue(GC, i5)
do p5 + 1;
def bearcnt10 = fold i6 = 0 to n
with p6
while !getvalue(DC, i6)
do p6 + 1;
addlabel(1, " ", color.black);
#AddLabel(1, if bullcnt then “10>50” else if bearcnt then “10<50” Else “WAIT”, if bullcnt then color.light_green else if bearcnt then color.dark_orange else color.LIGHT_GRAY);
#AddLabel(1, if bullcnt then “50>200 GC” else if bearcnt then “50<200 DC” Else “WAIT”, if bullcnt then color.light_green else if bearcnt then color.dark_orange else color.LIGHT_GRAY);
Looks great so far. Thank YOU! I am looking at it afterhours, so I don't know if that is why I don't see the count number on top of the candles feature.
"...the count number to the candle top or bottom (and I guess in it's appropriate color to represent a bullish/bearish move) and still leave the chart label as is? It would make it SO Much faster to find it."
Please advise and again thanks for your help
UPDATE:
I found something you did another time that looks very promising for putting the count number in bubbles on top of the candles, I tried to see if I could put it together, but it's way over my head. I hope this helps make it easy. Thanks...https://usethinkscript.com/threads/difficulty-coding-coloring-inside-candle-formations.15820/post-127558
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.
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.