Detect hammer and shooting star with high volume


Category:
0
0

Hello,

I’d appreciate if anyone could help me with a little code. I’m trying to have a couple of candlesticks identified on my charts. Basically I’d like to be able to see the following:

  • Hammer and Shooting Star candles if;
  • Volume is at least 30% higher than previous candles
  • Have display points plotted at the high/low of the candles
Attachments:
Marked as spam
Posted by (Questions: 5, Answers: 6)
Asked on September 13, 2018 3:56 pm
3352 views
0

The title question is too vague. I will need to update the question title so that is clearly defines the context of your question. This will make it easier for other visitors to search for and find this solution. When I make those changes it will break the original URL of this post.

( at September 13, 2018 7:38 pm)
0
Private answer

We can build this entirely from the condition wizard. With one small adjustment to the statement generated from the condition wizard. So most of this solution is contained within the screenshots below.

To keep this short, I am only showing how to build the hammer. You can replicate this process to build the shooting star, or any other candle pattern available in the condition wizard.

Step One

There are two conditions you need to create. One to detect the candle pattern (which is listed as a study in condition wizard). The second to detect higher volume than previous bar. This is shown in the first two screenshots.

Step Two

The next screenshot shows how to take the statement it generates and apply a multiplier to ensure we have 30% higher volume than previous bar.

Step Three

The fourth screenshot shows how to adjust the plot parameters so that it shows up as an arrow on the chart.

Step Five

The final screenshot shows the end result. You will see two hammers detected by the Patterns tool. (upper right button on the chart). Those are plotted as yellow wedges at the high of two candles. You will see only one of the two has 30% higher volume, this is the one marked by our custom study, via the blue arrow.

Once you get the hang of this, the danger is you may end up spending an entire afternoon building really cool and useful stuff. Without knowing how to write a single line of code.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on September 14, 2018 10:09 am
0

Hi Pete,

Many thanks for your previous response it worked as you said, however, I noticed that by doing that I’d be relying 100% on TOS pattern recognition and it missed many of my expected results. I’d appreciate if you could shed some light on the code for the below scenario:

-Wick of candle is at least 50% greater than body
-Volume is greater than previous volume bar
-Plot boolean_points @ high/low of candle when statement is true

Hopefully the image below can give you an ideas of what I’m looking for. Thank you in advance.

G.

( at September 15, 2018 3:22 pm)
0

I suggest you experiment with the settings already provided by the built-in pattern. You have four parameters you can adjust:
length
trend setup
body factor
shadow factor

( at September 15, 2018 4:49 pm)
0
Pete, thank you for your replies as always. I’ve had a stab at hard-coding (still in my baby steps at thinkscript coding) it but I really got stuck as I don’t know how to plot it on charts. My ultimate goal would be to see little dots (points) at the high of each candle instead of the arrows as they seem very distracting to me. Any chance you could help out on that again. Thanks Criteria: Wick of candle is at least 50% greater than body -Volume is 30% greater than previous volume bar -Plot boolean_points @ high/low of candle when statement is true Code: plot data = (close (volume [-1]*1.3));
( at September 18, 2018 10:52 am)
0

There is no “boolean_points @ high/low”. That is not an option in the settings. There is an option for “Point @ Close”. Perhaps you are trying to solve something using code when there is a much simpler method. Such as adjusting the settings? If the Arrow is to distracting and the Point @ Close is not preferred, you can also try the wedges. All of this available through settings.

( at September 18, 2018 11:11 am)