Trading Strategies
Linear Grid Strategy
The Linear Grid Strategy is a sophisticated trading approach designed to capitalize on market fluctuations by placing multiple buy and sell orders at predefined intervals (grid levels) above and below the current price level. This strategy helps in capturing profits in both upward and downward market movements.
Grid Behaviors
The Linear Grid Strategy supports different grid behaviors, allowing for flexibility and optimization based on market conditions and trading preferences. Currently, the following grid behaviors are implemented:
-
Default Behavior: The standard grid trading approach where grid levels are calculated based on fixed or dynamic price ranges.
-
Infinite Grid: An adaptive grid that continuously adjusts and extends as the price moves, potentially allowing for unlimited profit potential.
-
DBSCAN-based Grid ("dbscanalgo"): An advanced grid behavior that uses the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm to determine grid levels based on market structure.
More grid behaviors may be added in future updates to further enhance the strategy's versatility.
Configuration Parameters
The Linear Grid Strategy can be fine-tuned using the following parameters in your config.json
file:
Parameter | Description |
---|---|
max_qty_percent_long |
Maximum percentage of wallet balance for long positions |
max_qty_percent_short |
Maximum percentage of wallet balance for short positions |
auto_reduce_cooldown_enabled |
Enable/disable auto-reduce cooldown feature |
auto_reduce_cooldown_start_pct |
Percentage at which auto-reduce cooldown starts |
wallet_exposure_limit_long |
Maximum exposure limit for long positions (% of wallet balance) |
wallet_exposure_limit_short |
Maximum exposure limit for short positions (% of wallet balance) |
levels |
Number of grid levels |
strength |
Grid strength (higher value = wider spacing between levels) |
outer_price_distance |
Distance from current price to outermost grid levels |
min_outer_price_distance |
Minimum distance to outermost grid levels |
max_outer_price_distance_long/short |
Maximum distance to outermost grid levels |
long_mode |
Enable/disable long positions |
short_mode |
Enable/disable short positions |
reissue_threshold |
Threshold for reissuing partially filled orders |
buffer_percentage |
Buffer percentage for the grid |
initial_entry_buffer_pct |
Buffer percentage for initial entry |
min_buffer_percentage |
Minimum buffer percentage |
max_buffer_percentage |
Maximum buffer percentage |
enforce_full_grid |
Always maintain a full grid of orders |
min_buffer_percentage_ar |
Minimum buffer percentage for auto-reduce |
max_buffer_percentage_ar |
Maximum buffer percentage for auto-reduce |
upnl_auto_reduce_threshold_long |
UPNL threshold for auto-reducing long positions |
upnl_auto_reduce_threshold_short |
UPNL threshold for auto-reducing short positions |
failsafe_enabled |
Enable/disable failsafe feature |
failsafe_start_pct |
Percentage at which failsafe starts |
long_failsafe_upnl_pct |
UPNL percentage for long failsafe |
short_failsafe_upnl_pct |
UPNL percentage for short failsafe |
Example Configurations
Long and Short Auto-Rotating Futures Configuration
This configuration is "giga safe" and has had a 100% winrate over 6month period on live
This configuration utilizes machine learning-based signals and implements a grid with proper DCA (Dollar Cost Averaging) to ensure each grid level meaningfully adjusts the position to the current market price.
{
"api": {
"filename": "quantdatav2_bybit.json",
"mode": "remote",
"url": "https://api.quantumvoid.org/volumedata/",
"data_source_exchange": "bybit"
},
"bot": {
"bot_name": "your_bot_name",
"volume_check": false,
"min_distance": 0.15,
"min_volume": 10000,
"upnl_profit_pct": 0.0024,
"max_upnl_profit_pct": 0.0040,
"auto_reduce_enabled": false,
"auto_reduce_start_pct": 0.068,
"entry_during_autoreduce": false,
"stoploss_enabled": false,
"stoploss_upnl_pct": 0.05,
"liq_stoploss_enabled": false,
"liq_price_stop_pct": 0.50,
"percentile_auto_reduce_enabled": false,
"upnl_threshold_pct": 0.50,
"max_pos_balance_pct": 0.50,
"auto_reduce_wallet_exposure_pct": 0.20,
"auto_reduce_maxloss_pct": 0.30,
"auto_reduce_marginbased_enabled": false,
"hedge_ratio": 0.10,
"hedge_price_difference_threshold": 0.10,
"test_orders_enabled": false,
"max_usd_value": 50,
"min_qty_threshold": 0,
"MaxAbsFundingRate": 0.0002,
"blacklist": ["BTCUSDT", "ETHUSDT"],
"whitelist": [],
"dashboard_enabled": false,
"shared_data_path": "data/",
"linear_grid": {
"grid_behavior": "infinite",
"drawdown_behavior": "maxqtypercent",
"target_coins_mode": false,
"auto_graceful_stop": false,
"entry_signal_type": "lorentzian",
"additional_entries_from_signal": true,
"graceful_stop_long": false,
"graceful_stop_short": false,
"max_qty_percent_long": 30,
"max_qty_percent_short": 30,
"auto_reduce_cooldown_enabled": false,
"auto_reduce_cooldown_start_pct": 0.051,
"wallet_exposure_limit_long": 0.006,
"wallet_exposure_limit_short": 0.001,
"max_outer_price_distance_long": 0.039,
"max_outer_price_distance_short": 0.049,
"levels": 4,
"strength": 1.4,
"min_outer_price_distance": 0.019,
"long_mode": true,
"short_mode": true,
"reissue_threshold": 0.001,
"buffer_percentage": 0.10,
"initial_entry_buffer_pct": 0.0001,
"min_buffer_percentage": 0.0035,
"max_buffer_percentage": 0.010,
"enforce_full_grid": true,
"min_buffer_percentage_ar": 0.002,
"max_buffer_percentage_ar": 0.004,
"upnl_auto_reduce_threshold_long": 30.0,
"upnl_auto_reduce_threshold_short": 30.0,
"failsafe_enabled": false,
"failsafe_start_pct": 0.07,
"long_failsafe_upnl_pct": 10.0,
"short_failsafe_upnl_pct": 10.0,
"stop_loss_enabled": true,
"stop_loss_long": 15.0,
"stop_loss_short": 15.0
},
"hotkeys": {
"hotkeys_enabled": false,
"enter_long": "1",
"take_profit_long": "2",
"enter_short": "3",
"take_profit_short": "4"
}
},
"exchanges": [
{
"name": "bybit",
"account_name": "account_1",
"symbols_allowed": 20
},
{
"name": "bybit_spot",
"account_name": "account_2",
"symbols_allowed": 5
},
{
"name": "bybit_unified",
"account_name": "account_3",
"symbols_allowed": 5
},
{
"name": "bitget",
"account_name": "account_4",
"symbols_allowed": 5
}
],
"logger": {
"level": "info"
},
"messengers": {
"discord": {
"active": false,
"embedded_messages": true,
"messenger_type": "discord",
"webhook_url": "https://discord.com/api/webhooks/your_webhook_id/your_webhook_token"
},
"telegram": {
"active": false,
"embedded_messages": true,
"messenger_type": "telegram",
"bot_token": "your_bot_token",
"chat_id": "your_chat_id"
}
}
}
This configuration utilizes machine learning-based signals and implements a grid with proper DCA (Dollar Cost Averaging) to ensure each grid level meaningfully adjusts the position to the current market price.
This strategy is utilizing high frequency machine learning logic (WARNING: MEDIUM-HIGH RISK)
Long and short grid targeting one symbol or more via whitelist and target_coins_mode
{
"api": {
"filename": "quantdatav2_bybit.json",
"mode": "remote",
"url": "https://api.quantumvoid.org/volumedata/",
"data_source_exchange": "bybit"
},
"bot": {
"bot_name": "your_bot_name",
"volume_check": false,
"min_distance": 0.15,
"min_volume": 10000,
"upnl_profit_pct": 0.0024,
"max_upnl_profit_pct": 0.0029,
"auto_reduce_enabled": false,
"auto_reduce_start_pct": 0.068,
"entry_during_autoreduce": false,
"stoploss_enabled": false,
"stoploss_upnl_pct": 0.05,
"liq_stoploss_enabled": false,
"liq_price_stop_pct": 0.50,
"percentile_auto_reduce_enabled": false,
"upnl_threshold_pct": 0.50,
"max_pos_balance_pct": 0.50,
"auto_reduce_wallet_exposure_pct": 0.20,
"auto_reduce_maxloss_pct": 0.30,
"auto_reduce_marginbased_enabled": false,
"hedge_ratio": 0.10,
"hedge_price_difference_threshold": 0.10,
"test_orders_enabled": false,
"max_usd_value": 1000,
"min_qty_threshold": 0,
"long_liq_pct": 0.05,
"short_liq_pct": 0.05,
"MaxAbsFundingRate": 0.0002,
"blacklist": ["BTCUSDT", "ETHUSDT"],
"whitelist": ["SUIUSDT"],
"dashboard_enabled": true,
"shared_data_path": "data/",
"linear_grid": {
"grid_behavior": "dbscanalgo",
"drawdown_behavior": "progressive_drawdown",
"target_coins_mode": true,
"auto_graceful_stop": false,
"entry_signal_type": "lorentzian",
"additional_entries_from_signal": false,
"graceful_stop_long": false,
"graceful_stop_short": false,
"max_qty_percent_long": 10000,
"max_qty_percent_short": 10000,
"auto_reduce_cooldown_enabled": false,
"auto_reduce_cooldown_start_pct": 0.051,
"wallet_exposure_limit_long": 0.10,
"wallet_exposure_limit_short": 0.001,
"levels": 3,
"strength": 1.4,
"min_outer_price_distance": 0.019,
"max_outer_price_distance_long": 0.049,
"max_outer_price_distance_short": 0.059,
"long_mode": true,
"short_mode": true,
"reissue_threshold": 0.001,
"buffer_percentage": 0.10,
"initial_entry_buffer_pct": 0.0001,
"min_buffer_percentage": 0.0035,
"max_buffer_percentage": 0.010,
"enforce_full_grid": true,
"min_buffer_percentage_ar": 0.002,
"max_buffer_percentage_ar": 0.004,
"upnl_auto_reduce_threshold_long": 10.0,
"upnl_auto_reduce_threshold_short": 10.0,
"failsafe_enabled": false,
"failsafe_start_pct": 0.05,
"long_failsafe_upnl_pct": 10.0,
"short_failsafe_upnl_pct": 10.0,
"stop_loss_enabled": true,
"stop_loss_long": 8.9,
"stop_loss_short": 15.0
},
"hotkeys": {
"hotkeys_enabled": false,
"enter_long": "1",
"take_profit_long": "2",
"enter_short": "3",
"take_profit_short": "4"
}
},
"exchanges": [
{
"name": "bybit",
"account_name": "account_1",
"symbols_allowed": 2
},
{
"name": "bybit_spot",
"account_name": "account_2",
"symbols_allowed": 5
},
{
"name": "bybit_unified",
"account_name": "account_3",
"symbols_allowed": 5
}
],
"logger": {
"level": "info"
},
"messengers": {
"discord": {
"active": false,
"embedded_messages": true,
"messenger_type": "discord",
"webhook_url": "https://discord.com/api/webhooks/your_webhook_id/your_webhook_token"
},
"telegram": {
"active": false,
"embedded_messages": true,
"messenger_type": "telegram",
"bot_token": "your_bot_token",
"chat_id": "your_chat_id"
}
}
}
This configuration utilizes machine learning-based signals and implements a grid with proper DCA (Dollar Cost Averaging) to ensure each grid level meaningfully adjusts the position to the current market price, while fully utilizing the allowed wallet exposure based amount of total_equity
based on wallet_exposure_limit_long
and wallet_exposure_limit_short