Skip to content
All library documents

Calculating Stochastic RSI and Its Smoothed K and D Lines

Article Strategy library · Author: 发明者量化-小小梦

Summary

This document presents an implementation framework for calculating Stochastic RSI from price records. It first obtains RSI, then compares each value with the rolling RSI high and low over a selected lookback window. Moving averages smooth the resulting numerator and range, producing a fast line; a further moving average of that line yields the slower signal line. The example uses a 14 period RSI and lookback with three period smoothing settings.

The rest of the material shows how the indicator values can be refreshed alongside market records, account information, and order book data in a recurring spot-market process. It includes chart display and position and profit tracking, but does not specify entry or exit rules based on the indicator, so it is not a complete trading strategy. No backtest or performance evidence is provided. The implementation also contains explicit handling for insufficient history and missing values, while alignment of rolling arrays and edge cases such as a zero RSI range would need attention before relying on the calculated series.

Key ideas

  • Stochastic RSI normalizes RSI within its recent rolling range.
  • A moving average smooths the normalized values into a fast line, and another average produces a slower line.
  • The example uses RSI and Stochastic lookbacks of 14 with three period smoothing settings.
  • The framework displays indicator and account data but leaves trading signals unspecified.
  • No backtest evidence is given, and array alignment and zero-range cases merit review.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.