Algo Trading Strategy Document
1. Overview
• Objective: Automate trading using a 15-minute Supertrend (10,3)
indicator, with optional adjustments for 75-minute and Daily
timeframes.
• Watchlist:
• Supports up to 75 stocks per watchlist.
• Maintain separate watchlists for 15-minute, 75-minute, and Daily
timeframes.
• Algo’s Role: Monitor stocks in the watchlist and execute trades based
on the predefined strategy.
2. Responsibilities
Our Role:
1. Add stocks to the watchlist and define the maximum loss amount per
stock.
2. Provide the option to manually adjust the loss amount as needed.
3. Select the timeframe (default: 15-minute Supertrend).
Algo’s Role:
1. Continuously monitor the watchlist and apply trading conditions.
2. Automatically place orders, manage stop-loss (SL), and execute reentry logic.
3. Provide real-time notifications and maintain logs for performance
tracking.
3. Trading Strategy
Condition 1: Price Below 15M Supertrend but Above 75M Supertrend
A. Initial Buy Order (50% of Total Loss Amount):
1. Place a Stop Buy order at 1.0025 × 15M Supertrend Value.
2. Dynamically trail this order every 15 minutes until executed.
Example:
• At 1:00 PM: 15M Supertrend = ₹100.
• At 1:07 PM: Price crosses ₹100.25 → Execute a 50% loss amount
quantity buy.
3. Stop Loss for Initial Order:
• Set SL at 95% of the Stop Buy price, as the lower-side Supertrend
value is not known initially.
• Trail the SL dynamically based on updated Supertrend values after each
bar closure.
Example:
• Stop Buy Order = ₹100.25 (15M Supertrend × 1.0025).
• SL = ₹95.24 (95% of ₹100.25).
Quantity = 10000 Rs / 5.01 Stop Loss = 2000 Shares
4. Exit:
• Exit this above position at either:
• 1:2 risk/reward ratio, or
• Trailing Stop Loss of the 15M Supertrend, whichever occurs earlier.
B. Remaining 50% Buy Order:
1. When the 15M Supertrend turns positive, place a Stop Buy order at
1.004 × 15M Supertrend Value.
2. Calculate the quantity:
(50% Total Loss Amount) ÷ (Entry Price - Stop Loss).
3. Set SL at 0.996 × 15M Supertrend Value.
4. Exit this position at either:
• 1:4 risk/reward ratio, or
• Trailing Stop Loss, whichever occurs earlier.
Condition 2: Re-Entry for Risk-Reward Exits
1. If a position exits based on a Risk-Reward Ratio, re-enter the same
quantity at:
15M Supertrend Value × 1.004.
2. Place SL at 15M Supertrend Value × 0.996.
Note :- When the share is added in Watchlist and both Supertrend of
15 Minute as well as 75 Minute are positive then only B Quantity for
50 % of Loss amount is purchased .... and rest same logics
4. Algo Enhancements
1. Notifications:
• Provide real-time alerts for:
• Order placements, modifications, or executions.
• SL updates or breaches.
• Significant deviations from Supertrend values.
• Integration: Notify via Telegram/WhatsApp.
2. Error Handling:
• Retry failed orders up to 3 times.
• Log errors for review and debugging.
3. Dashboard:
• Display the following metrics:
• Current positions.
• Real-time Supertrend values.
• Stop-loss levels.
• Cumulative profit/loss.
4. Failsafe Mechanisms:
• Halt operations during:
• Broker connectivity issues.
• High market volatility or unexpected events.
5. Execution Example
Scenario:
• Stock: Included in the watchlist.
• Total Loss Amount: ₹20,000.
Step 1: At 1:00 PM
• 15M Supertrend = ₹100.
• Price = ₹98.
• Place a Stop Buy order at ₹100.25.
• Quantity:
(₹10,000 ÷ ₹5) = 2000 shares.
Step 2: At 1:07 PM
• Price = ₹100.25.
• Order executed: 2000 shares.
• Updated 15M Supertrend = ₹95.
• SL = ₹94.62.
Step 3: At 1:15 PM
• 15M Supertrend turns positive.
• Place Stop Buy for the remaining 50%:
* Supertrend 15 Minute Value Rs. 95
• Buy price: ₹95.38 (₹95 × 1.004).
• Quantity:
(₹10,000 ÷ ₹0.76) = 13,200 shares.
• SL = ₹94.62 (₹95 × 0.996).
6. Notes
1. Customizable Timeframes:
• Default: 15 minutes, with optional 75 minutes and Daily.
2. Customizable Loss Amount:
• Adjustable manually for each stock.
3. Audit Logs:
• Maintain comprehensive records of:
• Trades executed.
• Performance metrics.
• Alerts and notifications.