Author: Andrey N. Bolkonsky
The Candlestick Index (CSI), developed by William Blau, is a powerful tool for traders looking to analyze market momentum. If you’re familiar with the Candlestick Momentum Indicator, you’ll appreciate how the CSI builds on that foundation. Blau discusses this in detail in his book "Momentum, Direction, and Divergence: Applying the Latest Momentum Indicators for Technical Analysis".
The Candlestick Index values are normalized to fit within the range of [–100,+100]. Positive CSI values indicate overbought conditions, while negative values suggest oversold scenarios in the market.
- Place WilliamBlau.mqh in terminal_data_folder\MQL5\Include\
- Place Blau_CSI.mq5 in terminal_data_folder\MQL5\Indicators\

Candlestick Index by William Blau
How It’s Calculated:
The CSI is calculated using the following formula:
100 * EMA(EMA(EMA( cmtm(price1,price2,q) ,r),s),u) 100 * CMtm(price1,price2,q,r,s,u)
CSI(price1,price2,q,r,s,u) = –––––––––––––––––––––––––––––––––––––––––––– = ––––––––––––––––––––––––––––––––––
EMA(EMA(EMA( HH(q)-LL(q) ,r),s),u) EMA(EMA(EMA( HH(q)-LL(q) ,r),s),u)
if EMA(EMA(EMA(HH(q)-LL(q),r),s),u)=0, then CSI(price1,price2,q,r,s,u)=0
Where:
- q - number of bars used for the Candlestick Momentum calculation;
- price1 - the close price;
- price2 - the open price from q bars ago;
- cmtm(price1,price2,q) - calculates the q-period Candlestick Momentum;
- LL(q) - the lowest price over q bars;
- HH(q) - the highest price over q bars;
- HH(q) - LL(q) - the price range for the q bars;
- CMtm(price1,price2,q,r,s,u) - the triple smoothed Candlestick Momentum;
- EMA(...,r) - first smoothing using EMA(r), applied to:
- Candlestick Momentum (q bars);
- Price Range (q bars);
- EMA(EMA(...,r),s) - second smoothing using EMA(s), applied to the result of the first smoothing;
- EMA(EMA(EMA(...,r),s),u) - third smoothing using EMA(u), applied to the result of the second smoothing.
- q - number of bars for Candlestick Momentum (default q=1);
- r - period of the first EMA(r) for Candlestick Momentum (default r=20);
- s - period of the second EMA(s) for the first smoothing (default s=5);
- u - period of the third EMA(u) for the second smoothing (default u=3);
- AppliedPrice1 - price type (default AppliedPrice1=PRICE_CLOSE);
- AppliedPrice2 - price type (default AppliedPrice2=PRICE_OPEN).
- Ensure q>0;
- Make sure r>0, s>0, u>0. If r, s, or u equal 1, smoothing won’t be applied;
- Minimum rates = (q-1+r+s+u-3+1).

Comments 0