Skip to content
All library documents

RSI Threshold Trading with Fractional Balance Orders

Article Strategy library · Author: 3028165668

Summary

This short programming exercise demonstrates an RSI-based trading loop. It reads the latest market quote, account balances, and four-hour records, then calculates a 14-period RSI. When RSI is above 70 and the account holds the asset, it submits a sell order sized at one percent of the holdings. When RSI is below 30 and there is available cash, it submits a buy order sized at one percent of the cash-equivalent quantity. After either signal, the loop pauses briefly, and it periodically logs balances.

The example provides executable decision logic but little strategy evaluation. It does not describe a backtest, report performance, define an exit plan beyond the opposite threshold, or discuss transaction costs and order handling. Its variable names for buy and sell flags are inconsistent with the actions they mark, and the commented alternatives show different thresholds and sizing fractions without explaining their rationale. The snippet therefore illustrates basic RSI-triggered orders and account-based sizing, but offers limited evidence for whether the rules are profitable or suitable for live trading.

Key ideas

  • The example calculates RSI over four-hour records using a 14-period setting.
  • It sells a small fraction of holdings above the upper RSI threshold and buys using a fraction of available cash below the lower threshold.
  • A delay follows triggered orders, and balances are logged periodically.
  • The snippet supplies no backtest evidence, cost model, or developed risk-management plan.

Tags

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