This document explains how the pyramid
and reverse_order_close
parameters in the JSON configuration control multiple open trades, and how you can configure your alerts for faster stacking.
Key Parameters for Stacking Orders #
1. pyramid
#
- Default:
false
- Function: Controls whether multiple trades in the same direction can be stacked.
- When set to
true
:- Multiple buy signals can open multiple buy orders.
- Multiple sell signals can open multiple sell orders.
- Existing same-direction trades remain open until closed by user or opposite signal.
2. reverse_order_close
#
- Default:
false
- Function: Controls whether opposite positions are automatically closed.
- When set to
true
:- A buy signal will close all open sell orders before opening new buy trades.
- A sell signal will close all open buy orders before opening new sell trades.
Tested Setup (Case Study) #
We tested stacking entries with the following JSON parameters:
{
"symbol": "MNQ1!",
"data": "buy",
"quantity": 1,
"pyramid": true,
"same_direction_ignore": false,
"reverse_order_close": true,
..}
Result: #
- Able to stack up to 11 trades in the same direction (buy or sell).
- Opposite signals automatically close existing trades before opening new ones.
- Provides clean stacking with controlled risk management.
Considerations #
- With
reverse_order_close = true
, each new order must first check and close opposite positions before executing the new trade.
How to Reduce Execution Time #
If your strategy is sensitive to execution delays:
- Send a Close Signal First – Instead of relying on reverse_order_close, design your strategy to send a close alert at the end of a stacking sequence.
- Then Send Opposite Signal – After positions are closed, send the new opposite-direction entry.
Using this adjustment, order execution can be faster, even with multiple stacked trades.
Practical Example #
- Stacking Buys:
- 5 consecutive
buy
alerts received → 5 buy orders opened. - No positions closed since all are in the same direction.
- 5 consecutive
- Closing Before Switching:
- Strategy sends a
close
alert → All 5 buy orders closes.
- Strategy sends a
- Switching to Sell:
- Next
sell
alert is received → A new sell order opens almost instantly. - More
sell
alerts stack additional sell orders without delay.
- Next
Recommendation #
If your strategy relies on stacking entries, use:
"pyramid": true,
"reverse_order_close": true
And for faster execution:
- Adjust your strategy to send a close signal before opposite direction entries.
- This ensures stacking flexibility (up to 11 trades tested) with faster execution time.