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 ?
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.