Техническое задание
Grid Trading Bot - Corrected Summary with Price Movement %
Basic Bot Logic
The bot creates a grid of limit orders within a specified price range with equal lot sizes and progressively increasing upward price movement requirements for profit.
Initial Setup
Parameters you set:
- Stop Loss price (e.g., 1900) - where the loss will occur
- Maximum loss (e.g., €1000) - how much money you're willing to lose
- Price range for positions (e.g., 1950-1999) - where limit orders are placed
- Number of positions (e.g., 50 positions)
- Initial Price Movement % (e.g., 0.01%) - by what % the price must rise for the first TP
How the Bot Calculates and Places Orders
Step 1: Price Distribution
- Bot divides the range 1950-1999 into 50 equal parts
- First position at 1950, last at 1999
- Each position is spaced approximately 1% price difference apart
Step 2: Lot Size Calculation (Equal for All)
Bot calculates:
- Maximum loss per position: €1000 ÷ 50 positions = €20 per position
- Worst case scenario: Position closest to SL (at 1950 = 50 points to SL 1900)
- Lot size: Based on €20 loss over 50 points, determines lot size
- Result: All positions have equal lot size
Step 3: Progressively Increasing Price Movement % for Take Profit
Bot calculates the increase:
- IMPORTANT: Lower positions need HIGHER % movement for TP
- Price Movement increase: For each lower position, required price movement increases by 0.01%
Take Profit distribution:
- Position 1 (entry 1950): TP when price rises by +0.50% = 1959.75 (highest)
- Position 25 (entry 1975): TP when price rises by +0.25% = 1979.938
- Position 50 (entry 1999): TP when price rises by +0.01% = 1999.1999 (lowest)
Operation During Trading
When price moves down (1950-1999):
- Price hits position at 1999 → limit order executed (needs only +0.01% movement for TP)
- If price goes lower → hits position at 1975 (needs +0.25% movement for TP)
- If goes even lower → hits position at 1950 (needs +0.50% movement for TP)
Scenario 1: Price reverses upward
- Position at 1999 reaches TP with small movement (+0.01% = 1999.1999)
- Position at 1975 needs larger movement (+0.25% = 1979.938)
- Position at 1950 needs largest movement (+0.50% = 1959.75)
- Result: Higher positions close faster with profit
Scenario 2: Price goes to Stop Loss (1900)
- All open positions close with loss
- Total loss = maximum €1000
- Each position loses maximum €20
Practical Operation Example
Your settings:
- 50 positions between 1950-1999 (Gold)
- Stop loss at 1900
- Maximum loss €1000
- Initial price movement 0.01%
Bot places:
- Position 1: Limit at 1950, lot 0.X, TP at 1959.75 (+0.50%), SL at 1900
- Position 25: Limit at 1975, lot 0.X, TP at 1979.938 (+0.25%), SL at 1900
- Position 50: Limit at 1999, lot 0.X, TP at 1999.1999 (+0.01%), SL at 1900
System Logic:
- Lower positions (bought cheap) need higher % movement for profit
- Higher positions (bought expensive) need smaller % movement for profit
- This creates a system where positions bought closer to current price close faster
Important Addition: Order Management
The bot calculates all positions but doesn't open all limit orders simultaneously. Instead, it opens only 10 limit orders at a time and monitors price movement to avoid having too many orders in the market. As orders get filled or price moves, the bot dynamically places additional orders according to the predetermined grid strategy.