Posted 58 Days Ago Job ID: 2094608 16 quotes received

Cloud-based stock trading bot

Fixed Price$500-$1k
Quotes (16)  ·  Premium Quotes (0)  ·  Invited (0)  ·  Hired (0)

  Send before: November 23, 2024

Send a Quote

Programming & Development Programming & Software

Project: Single Strategy trading bot integrating two Trading Accounts 


Scope of Work:

The project involves creating a cloud-based trading bot with a user-friendly UI that integrates my two trading accounts and implements one trading strategy. The goal is to sync and manage trades across both accounts and execute the trading strategy through an automated, rule-based system.


Part 1: Account Integration


1. Zerodha and Shoonya Integration

  • The system must integrate Zerodha and Shoonya using their respective APIs to allow:

    • Order Execution: Place trades seamlessly across both accounts.

    • Position Tracking: View open positions, active trades, and executed orders in real time.

    • Trade Monitoring: Real-time updates on market prices, P&L, and performance.

    • Notifications: Alerts on trade executions, profit/loss levels, and specific events within the strategy.


Part 2: Trading Strategy Implementation


A. Single Trade Mode (with Averaging Down)

This mode focuses on adding positions as the trade moves, both in profit and loss scenarios:

  1. Trade Initiation: The bot initiates a trade (buy/sell) at a specified time or price, setting this as the base price for subsequent moves.

  2. Profit Booking: If the price moves above the base, the system books partial profits (using a formula) and adds more positions at the next level.

  3. Loss Booking: If the price returns to a previous level, partial losses are booked (based on table values).

  4. Averaging Down: If the price falls below the base level, the system automatically averages down based on pre-set rules.

  5. Square Off: All trades are closed at the end of the trading day (based on time or manual control).


B. Flip Trade Mode (with Averaging Down)

This mode flips trades and continues trading in the opposite direction after targets are hit:

  1. Trade Initiation: Trade is initiated as per user settings (price/time).

  2. Close at Target: Once the target is hit, close the trade.

  3. Reverse Trade: Immediately reverse the trade (buy -> sell, sell -> buy).

  4. Repeat Process: Continue this process throughout the day, managing quantities and hedging as required.


C. If the Trade Moves Against the Direction

  • Quantity Adjustment: The system should automatically adjust quantities at pre-defined intervals if the trade moves against the user’s direction.

  • Hedging: If enabled, initiate hedging trades following the same rules as in Single Trade Mode.

  • Profit Booking and Reversal: Once a target is hit, reverse the trade and continue trading until a user-defined stop time.


Strategy Matrix Overview

The strategy will be configured to operate in a fully-automated mode. However, if the market conditions deteriorate, the strategy may need to be managed manually through a matrix which will be designed to be flexible with various trade levels and execution rules:


1. Quantity vs. Capital Allocation

  • The user can choose to:

    • Specify a fixed number of quantities for trades, or 

    • Deploy a specified amount of capital per trade, applicable to all levels in the RTS matrix.


2. Quantity/Capital Levels

  • Quantities can be based on a pre-set table or entered manually at each level.

  • The system manages trades at different levels as the price moves, either up or down.


3. Target Setting

  • The user can input target values for individual levels or apply a global target for all trades.

  • Editable targets allow the user to modify levels dynamically.


4. Previous Trades Management

  • The system allows for trade management at previous levels by providing controls (drop-down or input boxes) for closing or keeping levels open.


5. Hedging

  • A checkbox will enable hedging, triggering opposite trades to mitigate potential losses.

  • The hedging leg follows the same rules but may have different quantities and levels.

  • Profits are managed separately, and new trades are initiated based on hedging performance.


6. Averaging Down

  • Users can choose to average down trades based on preset rules or manually input levels and quantities.

  • The system auto-populates option types (ATM, ITM, OTM), but users can override this.


7. Flip Trade Quantity Levels

  • The system should support flip trade quantities as follows (editable by the user):

    • Level 1: 2

    • Level 2: 3

    • Levels 3-5: 3

    • Levels 6-9: 2


8. Trade Closure & Unexecuted Orders

  • When a trade is closed, all related unexecuted orders must be withdrawn automatically.


9. Excluding Levels

  • Unchecked levels will not execute trades at those levels.


10. Notifications

  • The system will alert the user when a trade reaches critical quantity levels (e.g., Level 5), prompting them to review further averaging down.


11. Profit Booking & Stop-Loss

  • Users can set profit-taking and stop-loss levels for each level or sub-level, with optional or mandatory implementation.


12. Base Price for Matrix Calculation

  • The initial market order price is the base level for the strategy matrix, guiding subsequent trades.


13. Option Types

  • Option types are selected based on a predefined table but can be manually adjusted by the user.


Controls and Buttons

  1. Global Controls:

    • Kill/Pause/Cancel/Skip All/Calls/Puts

  2. Local Controls:

    • Kill/Pause/Cancel All/Calls/Puts at specific levels.

  3. Level Controls:

    • Skip or Kill buttons for each level.

  4. Chart Integration:

    • Display the chart of the instrument being traded within the matrix.

  5. Multiple Instruments:

    • Each instrument will open its own strategy matrix.


System Rules

  • Fetch ask/bid prices, not the Last Traded Price (LTP).

  • No new trades within a user-specified time (e.g., 15 seconds).

  • Adjust gaps for averaging down based on the velocity of price changes.

  • Shoot orders at 5-paisa intervals to complete fills.

  • Allow options to be chosen as ATM/ITM/OTM.

  • Include Normal/Dark Mode for the UI.

  • Define start and stop times for trading (e.g., open at 0920 hrs, alerts post 1330 hrs).

  • The system should remember user-defined settings unless edited.


This system will provide automated, rule-based execution of a Strategy across two accounts, with flexibility for customization and integration of key controls to manage trades effectively.

... Show more
Arvinder D Switzerland