Skip to content
All library documents

Position Sizing from Recent Lows with Indicator-Based Signals

Article Strategy library · Author: AlphaFox-Traders

Summary

This script calculates a long trade’s stop from the lowest low over a configurable lookback and sets a profit target using a chosen reward-to-risk multiple. It estimates quantity by dividing a percentage of updated capital by the distance between price and the stop, then rounds the amount to a permitted share increment. The capital estimate includes closed-trade profit and the first open trade’s profit.

The script also computes optional RSI, MACD, EMA, Bollinger Band, and Supertrend signals, with thresholds that classify each indicator as buy, sell, neutral, or off. The supplied excerpt ends before the complete signal-combination and order-entry logic, so the actual trade rules cannot be fully assessed. No backtest results or asset context are provided. The stop and target calculations shown are oriented around a long position, and the sizing rule can become problematic when the stop distance is zero or when gaps make realized losses exceed the planned amount.

Key ideas

  • The shown sizing rule allocates a percentage of estimated capital to risk and divides it by the entry-to-stop distance.
  • The stop uses the recent lookback low, while the target scales that distance by a reward-to-risk input.
  • Quantity is rounded according to a configurable minimum share increment.
  • Several common indicators are calculated and classified into directional signals, but the excerpt omits the final trading logic.
  • The document provides no performance results or asset-specific testing context.

Tags

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