AiM.TradeSize
This indicator study for TradeStation is designed to help traders determine an optimal position size for their trades based on risk management principles and market volatility. It uses a dynamic approach that adapts to changing market conditions.

This study calculates a suggested position size based on your total bankroll, risk tolerance, and the realized volatility of the asset.
Key Features
- Calculates position size based on your total bankroll and risk tolerance
- Incorporates realized volatility to adjust position size as market conditions change
- Uses a rolling window to compute weighted realized volatility, giving more importance to recent price movements
- Provides a daily position size recommendation for consistent risk management
The study takes into account your specified risk fraction and calculates a position size that aims to keep your risk per trade consistent, even as market volatility fluctuates. This can help in maintaining a balanced risk profile across different market conditions.
Ideal for traders who want to implement systematic risk management in their trading strategy, this indicator can be a valuable tool in your decision-making process.
How to Apply
- Open a daily chart for your desired asset in TradeStation.
- From the EasyLanguage shortcut bar, select "Indicators" and choose "Position Size Calculator" (or the name you've given this study).
- Apply the study to your chart.
Inputs to Adjust
- Bankroll: Your total trading capital (default: 100000)
- RiskFraction: The percentage of your bankroll you're willing to risk per trade (default: 0.02 or 2%)
- Window: The number of days used to calculate realized volatility (default: 21)
Adjust these inputs based on your personal risk tolerance and trading strategy.
Interpreting the Results
- The study will plot a line on your chart representing the suggested position size for each day.
- The position size indicates how many shares or contracts you should trade based on your risk parameters and the asset's volatility.
- A higher position size suggests lower volatility or risk, while a lower position size indicates higher volatility or risk.
Additional Information
- The study requires at least [Window + 1] days of data to start producing results.
- You can view detailed calculations in the EasyLanguage Output Bar's Print Log.
- Always combine this study with other analysis tools and your own judgment before making trading decisions.
Note: This study is designed for educational and informational purposes only. It should not be considered financial advice. Always conduct your own research and consider consulting with a financial advisor before making investment decisions.