You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: rename equity_path to trade_path and fix strategy statistics
Breaking changes:
- Rename equity_path parameter to trade_path in ScriptRunner and CLI
- Change CLI flags from --equity/-ep to --trade/-tp
- Update default filename from _equity.csv to _trade.csv
- Fix strategy statistics CSV export with proper headers and numeric values
- Add comprehensive TradingView-compatible statistics calculation
- Version bump to 6.1.0 for breaking API changes
-`--plot`, `-pp`: Path to save the plot data (CSV format). If not specified, it will be saved as `<script_name>.csv` in the `workdir/output/` directory.
75
75
-`--strat`, `-sp`: Path to save the strategy statistics (CSV format). If not specified, it will be saved as `<script_name>_strat.csv` in the `workdir/output/` directory.
76
-
-`--equity`, `-ep`: Path to save the equity curve (CSV format). If not specified, it will be saved as `<script_name>_equity.csv` in the `workdir/output/` directory.
76
+
-`--trade`, `-tp`: Path to save the trade data (CSV format). If not specified, it will be saved as `<script_name>_trade.csv` in the `workdir/output/` directory.
77
77
78
78
Example:
79
79
```bash
80
80
# Specify custom output paths
81
-
pyne run my_strategy.py eurusd_data.ohlcv --plot custom_plot.csv --strat custom_stats.csv
81
+
pyne run my_strategy.py eurusd_data.ohlcv --plot custom_plot.csv --strat custom_stats.csv --trade custom_trades.csv
82
82
```
83
83
84
84
## Symbol Information
@@ -120,18 +120,34 @@ After the script execution completes, several output files are created:
120
120
121
121
Contains the values plotted by the script for each bar. This includes all values passed to `plot()` functions in your script.
122
122
123
+
**Default filename**: `<script_name>.csv`
124
+
123
125
### Strategy Statistics (CSV)
124
126
125
-
If your script is a strategy, this file contains detailed statistics about the trading performance, including:
126
-
- Total profit/loss
127
-
- Win rate
128
-
- Maximum drawdown
129
-
- Sharpe ratio
130
-
- Trade details
127
+
If your script is a strategy, this file contains comprehensive TradingView-compatible statistics about the trading performance, including:
128
+
-**Overview metrics**: Net profit, gross profit/loss, max equity runup/drawdown, buy & hold return
-**Trade statistics**: Total/winning/losing trades, percent profitable, average trade metrics
131
+
-**Position analysis**: Largest winning/losing trades, average bars in trades
132
+
-**Long/Short breakdown**: Separate statistics for long and short positions
133
+
-**Risk metrics**: Max contracts held, commission paid, margin calls
134
+
135
+
**Default filename**: `<script_name>_strat.csv`
136
+
137
+
### Trade Data (CSV)
138
+
139
+
If your script is a strategy, this file contains detailed trade-by-trade data with entry and exit records:
140
+
-**Trade information**: Trade number, bar index, entry/exit type, signal ID
141
+
-**Timing data**: Date/time of entry and exit
142
+
-**Price data**: Entry/exit prices in the symbol's currency
143
+
-**Position data**: Number of contracts traded
144
+
-**Performance metrics**: Profit/loss in currency and percentage
145
+
-**Cumulative tracking**: Running totals of profit and profit percentage
146
+
-**Risk analysis**: Maximum run-up and drawdown for each trade
131
147
132
-
### Equity Curve (CSV)
148
+
**Default filename**: `<script_name>_trade.csv`
133
149
134
-
If your script is a strategy, this file contains the equity curve data showing how the account balance changed over time.
150
+
**Note**: This file exports individual trade records (entry/exit pairs), not the equity curve. The equity curve is tracked internally for statistics calculation.
0 commit comments