Determine the size of a candle vs average candle size?

L

lee-I-O=coke-A

New member
Is there a way to determine the size of a candle, example the candle might be 10x the size of majority candles

I don't know if there is additional info needed.

Your help would be deeply appreciated
 
Last edited by a moderator:
M

mashume

Well-known member
VIP
Code for ya:

Code:
declare upper;

input ThresholdMult = 3;
input LookbackLength = 10;

def AverageOverRange = SImpleMovingAvg(price = (high[1] - low[1]), length = lookbackLength);

def CurrentRange = high - low;

plot tallCandle = if CurrentRange >= (AverageOverRange * ThresholdMult) then 1 else double.nan;

AssignPriceColor(if tallCandle then COLOR.MAGENTA else Color.CURRENT);

Hope that gets you close to what you were looking for.

-mashume
 
Last edited:
L

lee-I-O=coke-A

New member
3 questions please. what does thresholdmult do?
2nd what does lookbacklength do?
3rd Is there a way to scan for a candle say 5x the average candle size.
thank you, i appreciate it.
 
M

mashume

Well-known member
VIP
3 questions please. what does thresholdmult do?
2nd what does lookbacklength do?
3rd Is there a way to scan for a candle say 5x the average candle size.
thank you, i appreciate it.
thresholdMult is the relative size of the candle you're looking for. The default setting is 3, so that would be 3x the size of the average candle... which brings us to:
LookbackLength, which is the period of time over which the candle sizes are averaged for comparison. I set a default at 10, so that the script will tell you, at default settings, whether the current candle is 3x larger (high to low) than the average of the proceeding 10 candles.
I modified the code above slightly from yesterday, as I thought that perhaps the most recent candle should NOT be included in the average.
I also threw in a plot so that a scan could be done.

Code:
TallCandles("threshold mult" = 5, "lookback length" = 30)
This returned 249 stocks this morning

The study, of course, must be named TallCandles for that to work. ;-)
 
L

lee-I-O=coke-A

New member
declare upper; input ThresholdMult = 3; input LookbackLength = 10; def AverageOverRange = SImpleMovingAvg(price = (high[1] - low[1]), length = lookbackLength); def CurrentRange = high - low; plot tallCandle = if CurrentRange >= (AverageOverRange * ThresholdMult) then 1 else double.nan; AssignPriceColor(if tallCandle then COLOR.MAGENTA else Color.CURRENT);
 
L

lee-I-O=coke-A

New member
Mashume, thank you very much I appreciate it. To tell you the truth, I fairly new at this, the doctors say that this helps my memory, and keeps my mind active. I truly lost my memory 15 years. It took 6 weeks for me to learn a sentence. Till this day the doctors have said I only have 70%I use of what I was capable of. You are my savior.

What you supplied to me was great.

But can I ask you for some additional help.
Is it possible add to the scan to include:
1st - to have 2 large RED candles back to back.
2nd - the 2 large RED candles are within the last 10 current candles
 
M

mashume

Well-known member
VIP
Mashume, thank you very much I appreciate it. To tell you the truth, I fairly new at this, the doctors say that this helps my memory, and keeps my mind active. I truly lost my memory 15 years. It took 6 weeks for me to learn a sentence. Till this day the doctors have said I only have 70%I use of what I was capable of. You are my savior.

What you supplied to me was great.

But can I ask you for some additional help.
Is it possible add to the scan to include:
1st - to have 2 large RED candles back to back.
2nd - the 2 large RED candles are within the last 10 current candles

2 large red candles back to back. 2 red candles back to back is relatively simple:
Code:
BigCandles("threshold mult" = 5, "lookback length" = 30)
and
close < close[1] < close[2] within 10 bars

I'm not sure quite what your definition of large is here. But this may help a bit.

-mashume
 
H

HighBredCloud

Well-known member
VIP
2 large red candles back to back. 2 red candles back to back is relatively simple:
Code:
BigCandles("threshold mult" = 5, "lookback length" = 30)
and
close < close[1] < close[2] within 10 bars

I'm not sure quite what your definition of large is here. But this may help a bit.

-mashume

@mashume I'm trying to figure the scanner portion of this and I can't...is this a complete scan code or does anything else goes after or before this? I get an error...

 
H

HighBredCloud

Well-known member
VIP
The code is up in post # 2. Copy / paste into a new indicator, or use the link below, but...

Name the indicator "BigCandles" and all should be well with the world. :)

https://tos.mx/oh4MmUG

-mashume
LOL...all is not well in my world...I saved the code from post #2 as a study. It does plot the Magenta Candles...on stocks that were pulled up by my other scanners.

What I don't understand is post #4 and post #7 conditions for the scanner. The link you shared is for the study...which the study plots with no issues...But how do I apply the conditions from post #4 and #7 to the actuals scanner?

The link is essentially this what is found in post #2:

Code:
declare upper;


input ThresholdMult = 3;

input LookbackLength = 10;


def AverageOverRange = SImpleMovingAvg(price = (high[1] - low[1]), length = lookbackLength);


def CurrentRange = high - low;


plot tallCandle = if CurrentRange >= (AverageOverRange * ThresholdMult) then 1 else double.nan;


AssignPriceColor(if tallCandle then COLOR.MAGENTA else Color.CURRENT);

But where does this go?

Code:
BigCandles("threshold mult" = 5, "lookback length" = 30)
and
close < close[1] < close[2] within 10 bars

When I just scanned using the link...and essentially the code from post #2 only 1 result came up. The only other conditions that I set was LAST $15 and average daily volume of 500k...you had over 240 results...
 
M

mashume

Well-known member
VIP
LOL...all is not well in my world...I saved the code from post #2 as a study. It does plot the Magenta Candles...on stocks that were pulled up by my other scanners.

What I don't understand is post #4 and post #7 conditions for the scanner. The link you shared is for the study...which the study plots with no issues...But how do I apply the conditions from post #4 and #7 to the actuals scanner?


When I just scanned using the link...and essentially the code from post #2 only 1 result came up. The only other conditions that I set was LAST $15 and average daily volume of 500k...you had over 240 results...
Don't worry.

I was probably trolling OTC penny equities before running that scan. Or I had set something else...

 
Last edited by a moderator:
L

lee-I-O=coke-A

New member
mashume. Thanks for everything. Is there anything I can do for you?
 
MerryDay

MerryDay

Active member
VIP
Just what I was looking for. @lee-I-O=coke-A, thank you for asking. @mashume thank you for answering.
 

Similar threads

Top