T29 ATR Bot
Entry Logic
When a signal fires, the following happens:
- Using the ATR and the current price, the stop distance is calculated
- Using the stop distance and the $ Risk value, the entry quantity is calculated
- For each target we need to calculate the quantity and the offset.Â
- The quantities are distributed using an even distribution (see below)
- The offset is a multiplier of the ATR
- With these values, the bot now submits a market order with a stop and the targets
- User can now manage the trade manually
Distributing Quantities to Targets
Even Distribution
The bot will spread the contracts across the targets evenly.
Taking the example of 7 with 3 targets enabled. The contracts would be distributed like this:
2 would allocated to each target for a total of 6. We then have a remainder of 1. The remainder is allocated starting from Target1 working our way up.
Another example is 8. Again, 2 would be allocated to each target for a total of 6 and remainder of 2. The remainder would be allocated to targets 1 and 2 giving a final distribution of 3,3,2
Automated Entry vs. Manual (Enter Now)
There are two ways in which trades can be entered:
Automated - User sets an "Entry Signal Reference". When the signal fires, orders will be placed. The bot must be enabled
Manual - At any time, users can press the Long or Short buttons. This will cause a market entry order with the stop/targets calculated using the current ATR
Notes
- The Enable button - this button is used to switch automated entries on/off. when green and reads "Enabled", automated entries are turned on. When gray and reads "Disabled", automated entries are disabled and signals will be ignored
Inputs
- Long Entry Signal Reference, Short Entry Signal Reference - set a reference to a signal. only used with automated trading mode
- ATR Reference - reference to a the ATR study subgraph. Used to calculate stop and target locations as multiples of the ATR
- Trading Window Start Time, Trading Window End Time - set trading times. In automated mode, the bot will only enter trades during these times
- Trade $ Risk - the max amount of risk to take per trade
- Target Settings
- Target 1 Enabled, Target 1 Multiplier
- Target 2 Enabled, Target 2 Multiplier
- Target 3 Enabled, Target 3 Multiplier
- Stop Multiplier
- Strategy Name
- Widget Initial Location on the Chart - when a chart is loaded, sets the initial location of the trade panel
- Trailing Stop Enabled
- Trailing Stop Trigger
- Trailing Stop Trigger ATR Multiplier
- Trailing Stop Offset (in Ticks)
- Move to Breakeven Enabled
- Move to Breakeven Trigger
- Move to Breakeven ATR Multiplier
- Move to Breakeven Offset
Stop Logic
The bot supports a stop with optional move to breakeven and trail.
The initial stop price is based on the stop multiplier.
If a trailing stop is enabled, it will start to trail once the trigger happens.
If a move to breakeven is enabled, the stop will move when the trigger happens.
The stop only moves in the direction of the trade.
There are a few options for the trigger:
- Start Trailing Immediately On Entry
- When Target 1 is Filled
- When Target 2 is Filled
- When ATR Multiplier is Touched