Login Page - Create Account

Support Board


Date/Time: Fri, 22 Nov 2024 21:25:26 +0000



Programmatically distinguishing a wick vs a Body on a current candle

View Count: 188

[2024-09-19 16:08:41]
User130696 - Posts: 88
Hello,

Is there a way to Programmatically distinguish between a wick and a Body on a current candle ?

Thanks,
[2024-09-19 16:25:41]
John - SC Support - Posts: 36237
What do you mean by "Programmatically"? Is this something you are coding using ACSIL, or are you looking for a way to do an Alert or using a Spreadsheet? or something else?

In general, to determine if a price is within the wick or the body, you would need to check if it was within the range of the Open to Close in which case it is in the body, otherwise it would be in the wick.

What is it that you want to accomplish? We can give you more help if we know what you are wanting to do.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-09-21 01:09:30]
User130696 - Posts: 88
I am trying to use Trading Alert or a trading Spreadsheet formula. I am trying to generate a indicator signal (no buy /sell, just an graphics plotted such as a triangle to the right of the current bar, when following conditions are met. Its a specific candlestick pattern recognition signal.
1. Two bars ago, the bar had a long wick to the upside.
2. One bar ago, the bar had an engulfing candle in the opposite direction with about less than 2 to 3% wick on both side, if no wicks better. Opposite direction means, if two bars ago it was down candle, then one bar ago should be up candle and vice versa.
3. Current candle is retracing towards the wick of the candle two bars ago.

Hope this is described well.
[2024-09-21 16:27:04]
User254520 - Posts: 16
There is a candlestick pattern finder study.
[2024-09-22 17:45:37]
John - SC Support - Posts: 36237
The following is using the Alert syntax.

1. To alert if the bar two bars back had a wick of a certain minimum length on the upside, you would use a formula like the following:
=IF(O[-2] > C[-2], (H[-2] - O[-2]) > 5, (H[-2] - C[-2]) > 5)

Where 5 is the wick size in points. If you want to test in ticks, change 5 to "5 * TICKSIZE".

2. To check if the bar 1 bar back is engulfing the bar 2 bars back, you would use the following:
=AND(H[-1] > H[-2], L[-1] < L[-2],

To check if the bar 1 bar back is in the opposite direction of the bar 2 bars back you would use a formula like the following:
=OR(AND(O[-2] > C[-2], O[-1] < C[-1]), AND(O[-2] < C[-2], O[-1] > C[-1]))

To check if the bar 1 bar back has no wick either up or down, you would use a formula like the following:
OR(AND(O[-1] > C[-1], H[-1] = O[-1], L[-1] = C[-1]), AND(O[-1] < C[-1], H[-1] = C[-1], L[-1] = O[-1]))

3. We would need more information on exactly what you are looking for regarding this. We do not have enough information to know how to put this together.

You would then need to put all of these items together using AND() and/or OR() functions.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account