feat: increase risk per trade from 1% to 5%
This commit is contained in:
@@ -21,7 +21,7 @@ This project implements the "Touch & Turn" scalping strategy for the Trading212
|
|||||||
## Risk & Capital Management
|
## Risk & Capital Management
|
||||||
|
|
||||||
* **Virtual Balance Simulation:** In demo mode, subtracts £4,750 from total equity to simulate a realistic £250 starting point.
|
* **Virtual Balance Simulation:** In demo mode, subtracts £4,750 from total equity to simulate a realistic £250 starting point.
|
||||||
* **1% Risk Rule:** Risks exactly 1% of the Virtual Balance per trade.
|
* **5% Risk Rule:** Risks exactly 5% of the Virtual Balance per trade.
|
||||||
* **Capital Partitioning:** Divides total available capital (£250) and risk budget equally among all active ticker threads for the day (max 3).
|
* **Capital Partitioning:** Divides total available capital (£250) and risk budget equally among all active ticker threads for the day (max 3).
|
||||||
* **Precision & Minimums:** Automatically detects "precision-mismatch" or "min-quantity-exceeded" errors from T212 and retries with corrected values.
|
* **Precision & Minimums:** Automatically detects "precision-mismatch" or "min-quantity-exceeded" errors from T212 and retries with corrected values.
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ The strategy capitalizes on the initial liquidity and volatility of the US marke
|
|||||||
|
|
||||||
The bot uses dynamic **Risk-Based Position Sizing** to ensure consistent exposure.
|
The bot uses dynamic **Risk-Based Position Sizing** to ensure consistent exposure.
|
||||||
|
|
||||||
- **1% Risk Rule:** By default, the bot risks **1% of your account balance** per trade.
|
- **5% Risk Rule:** By default, the bot risks **5% of your account balance** per trade.
|
||||||
- **Virtual Balance simulation:** If you are testing on a demo account with a large balance (e.g., £5,000) but plan to trade live with £250, the bot can maintain perspective. It automatically calculates a "Virtual Balance" by subtracting £4,750 from your actual total, ensuring your risk amount is exactly what it will be in the real world.
|
- **Virtual Balance simulation:** If you are testing on a demo account with a large balance (e.g., £5,000) but plan to trade live with £250, the bot can maintain perspective. It automatically calculates a "Virtual Balance" by subtracting £4,750 from your actual total, ensuring your risk amount is exactly what it will be in the real world. (e.g. £12.50 risk on a £250 virtual balance).
|
||||||
- **Leverage Adjusted:** For Inverse ETPs (3x leverage), the bot adjusts the quantity and bracket percentages to ensure the monetary risk remains identical to a standard 1x stock trade.
|
- **Leverage Adjusted:** For Inverse ETPs (3x leverage), the bot adjusts the quantity and bracket percentages to ensure the monetary risk remains identical to a standard 1x stock trade.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ def run_ticker_lifecycle(client, yf_ticker, t212_ticker, tz, num_tickers):
|
|||||||
logger.info(f"Bot thread started for {yf_ticker} ({t212_ticker}).")
|
logger.info(f"Bot thread started for {yf_ticker} ({t212_ticker}).")
|
||||||
|
|
||||||
# Initialize variables outside the retry loop to prevent UnboundLocalError
|
# Initialize variables outside the retry loop to prevent UnboundLocalError
|
||||||
risk_share = 2.50 / num_tickers
|
risk_share = 12.50 / num_tickers
|
||||||
capital_share = 250.0 / num_tickers
|
capital_share = 250.0 / num_tickers
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -127,7 +127,8 @@ def run_ticker_lifecycle(client, yf_ticker, t212_ticker, tz, num_tickers):
|
|||||||
actual_balance = float(account_info.get('totalValue', 5000.0))
|
actual_balance = float(account_info.get('totalValue', 5000.0))
|
||||||
virtual_balance = max(0, actual_balance - 4750.0)
|
virtual_balance = max(0, actual_balance - 4750.0)
|
||||||
|
|
||||||
risk_share = (virtual_balance * 0.01) / num_tickers
|
# Risk 5% of this adjusted virtual balance
|
||||||
|
risk_share = (virtual_balance * 0.05) / num_tickers
|
||||||
capital_share = virtual_balance / num_tickers
|
capital_share = virtual_balance / num_tickers
|
||||||
|
|
||||||
logger.info(f"Account: {actual_balance:.2f} | Virtual: {virtual_balance:.2f} | Share: {capital_share:.2f}")
|
logger.info(f"Account: {actual_balance:.2f} | Virtual: {virtual_balance:.2f} | Share: {capital_share:.2f}")
|
||||||
|
|||||||
Reference in New Issue
Block a user