Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I'm trying to plot arrows on hammers/stars with wicks that are 4x bigger than bodies. Up arrow under hammer, Down arrow above star. Have this so far, but don't see what's wrong.
I'd also like it to plot while it's forming.
Also also, I'd like to add it's only plots if the (high - low) > (High - low) for x amount of bars before it.
Thanks
Casey
# Calculate the length of the candle's wicks
def UpperWick = high - Max(open, close);
def LowerWick = Min(open, close) - low;
# Calculate the length of the candle's body
def CandleBody = AbsValue(open - close);
# Compare the wicks to the body to ensure that one wick is 4x longer than the body
# also compare the other wick to ensure that it is a "small" wick
def Hammer = (lowerWick / CandleBody >= 4) and (upperWick / CandleBody <= 0.5);
def Star = (upperWick / CandleBody >= 4) and (lowerWick / CandleBody <= 0.5);
plot signal = Hammer or Star;
signal.DefineColor("Above", GetColor(7));
signal.DefineColor("Below", GetColor(8));
signal.AssignValueColor(if Hammer then signal.Color("Above") else signal.Color("Below"));
signal.SetPaintingStrategy(if Hammer
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN);
Can you help answer these questions from other members on NexusFi?
In case anyone is interested in this today, there are free thinkscript codes for hammers and shooting stars at the thinkscript_cloud OneNote site and at usethinkscript.com. I've been searching and these are the best sources I was able to find.
I changed your code a bit. I hope that now everything works exactly as you wanted.
input showArrows = yes;
input x = 5; #bars amount
# Calculate the length of the candle's wicks
def UpperWick = high - Max(open, close);
def LowerWick = Min(open, close) - low;
# Calculate the length of the candle's body
def CandleBody = bodyheight();
def range = High - low;
def cond = range == highest(range,x);
# Compare the wicks to the body to ensure that one wick is 4x longer than the body
# also compare the other wick to ensure that it is a "small" wick
def Hammer = (lowerWick / CandleBody >= 4) and (upperWick / CandleBody <= 0.5);
def Star = (upperWick / CandleBody >= 4) and (lowerWick / CandleBody <= 0.5);
#plot Arrows
plot UpArrow = Hammer and cond;
plot DnArrow = Star and cond;