How code-aarush/swingtradingalgorithm works
Purpose and Entry Point
This is a standalone Python trading-strategy analysis repository, centered on swingtrend_strategy.py. It appears to run a SwingTrend-style strategy against NSE market-data CSV inputs and produce trade and equity-curve outputs.
Strategy Execution
swingtrend_strategy.py is the primary control point: it likely loads price data, applies signal/position rules, simulates trades, and calculates strategy performance. There is no visible package structure, service layer, API, or separate runtime entry point.
Paths:
• swingtrend_strategy.py
Market-Data Inputs
CSV files provide local, file-based datasets rather than an external market-data service. Multiple datasets suggest alternative sample sizes or scenarios can be selected when running the strategy.
Paths:
• sample_nse_data.csv
• large_sample_nse_data.csv
• profitable_sample_data.csv
Backtest / Trade Simulation Boundary
The key architectural boundary is between historical input data and generated simulation results. The strategy script should treat input CSVs as immutable historical observations and emit derived trade records and portfolio performance artifacts.
Paths:
• swingtrend_strategy.py
• trades.csv
• equity_curve.csv
Performance Outputs
trades.csv represents the transaction-level result set from strategy execution, while equity_curve.csv represents the time-series portfolio/value trajectory. These files are the primary integration surface for downstream analysis, reporting, or graph planning.
Paths:
• trades.csv
• equity_curve.csv
Runtime and Infrastructure
The repository is designed for a local Python runtime with filesystem access. No deployment infrastructure, database, message broker, web application, or external service integration is visible in the supplied tree. The operational workflow is therefore: choose/load a local NSE CSV, execute swingtrend_strategy.py, then consume the generated CSV outputs.
Main entry points: swingtrend_strategy.py SwingTrend strategy · sample_nse_data.csv Sample NSE data · large_sample_nse_data.csv Large NSE data · profitable_sample_data.csv Profitable sample data
Components 9
Historical Market Data
Selectable local NSE CSV datasets.
- Sample NSE data
sample_nse_data.csv - Large NSE data
large_sample_nse_data.csv - Profitable sample data
profitable_sample_data.csv
Strategy Execution
Local Python backtest workflow.
- SwingTrend strategy · Selects and loads a local historical dataset.
swingtrend_strategy.py - Signal and position rules
swingtrend_strategy.py - Trade simulation · Applies positions to historical prices and records trades.
swingtrend_strategy.py - Performance calculation · Builds the portfolio-value trajectory from simulated trades.
swingtrend_strategy.py
Simulation Results
Generated CSV artifacts for downstream analysis.
- Trade records · Transaction-level simulation output.
trades.csv - Equity curve · Time-series portfolio value output.
equity_curve.csv
Connections 8
- Sample NSE data → SwingTrend strategy: selected input
- Large NSE data → SwingTrend strategy: selected input
- Profitable sample data → SwingTrend strategy: selected input
- SwingTrend strategy → Signal and position rules: historical prices
- Signal and position rules → Trade simulation: signals and positions
- Trade simulation → Trade records: writes trades
- Trade simulation → Performance calculation: executed positions
- Performance calculation → Equity curve: writes equity values