Candlestick Power / candlestick strength

hi, iam a newbie in amibroker.
iam trying to code an afl to detemine the strength of a candlestick.
A candlestick that close as same value as high would return value 100.

This is my code :
spread_high = High - Open;
spread_close = Close - Open;
CandlePower = (spread_close/spread_high)*100;

The problem is if the candlestick has a lower shadow or low, but close same as high.
should the candlepower return the value 100 ?

is this logic right ?

Aron has shared a volume chart AFL which may help you get started: http://www.amibroker.com/members/library/detail.php?id=1433

Also, these links are a good read:

  1. Modify The CandleWidth of Candle Stick Bar like Candle Volume? - #11 by C_M
  2. CandleVolume [ChartSchool]

thank you

will read and study the code

@t3nsai ,

The Logic is what you make it.

Your code so far has the potential to be a Negative number if Close is lower than Open. If that is what you want, then fine. If not you have to work on your Logic.

If you want the result to be based on where the Close is RELATIVE to the size of the candle, you will need a different calculation.

range = H-L;
finish = C-L;
CandleStrength = finish/range * 100;

Hope this helps.

It really helps, this is want ia hv been trying to achieve
Tq so much

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.