What is the Re-Entry / Re-Cost / Re-Execute feature?
These are trade adjustments functionalities that enable the re-entering of positions which have exited upon hitting the Target and/or Stoploss.
Re-entry, Re-Cost & Re-execute, can work on Target based exit and Stoploss based exits, both, at an individual leg level and at the combined premium (MTM) level of a particular strategy.
I. Settings:
- Re-entry checkbox: This is a checkbox under the legs configuration table that allows you to activate or deactivate the Re-entry feature for a particular algo.
- Re-entry type drop down: Select from different re-entry methods from this drop down menu displayed in the legs configuration table. Here are some of the re-entry types:
- RE-ENTRY
- W&T RE-ENTRY
- RE-COST
- W&T RE-COST
- RE EXECUTE
- W&T RE EXECUTE
- RE-ENTRY REVERSE
- W&T RE-ENTRY REVERSE
- RE-COST REVERSE
- W&T RE-COST REVERSE
- RE EXECUTE REVERSE
- W&T RE EXECUTE REVERSE
- RE EXECUTE with SQUARE OFF ALL LEGS
- Max no. of re-entries input
- MTM Re-entry drop down:
- Square off & re-enter
- Square off, reverse positions & re-enter
- Max no. of re-entries input.
- Re-Execute method: This setting can be found under the Advanced Settings section on the algo configuration page. This setting is applicable only for the Re-Execute type of adjustment functionality. Re-Execute method has 2 types:
- LTP
- Candle Close
II. Understanding the 3 types of re-entries:
1. RE-ENTRY:
In the Re-Entry type of re-entry, once a position has exited after hitting the stoploss or target, a new position will be taken in the same symbol if the price at the end of the minute closes at or below (incase of sell) or above (in case of buy), the previous entry price, meaning the same trade is re-entering at or around the previous entry price or cost price.
So, in the case of Re-entry the new position will be taken ie. Re-entry will happen only at the beginning of the next minute if the re-entry condition is fulfilled.
Re-Entry with Trailing Stoploss:
In the case where Trailing Stoploss is configured on individual legs along with Re-Entry, even if the stoploss has trailed even once, and then the leg has exited later, the re-entry will happen only if the price touches the original stoploss price (ie. the stoploss price before trailing started), and then the end of the minute price closes at or below (incase of sell) or above (in case of buy) the previous entry price. In other words, future re-entry can get get activated only if the price has gone an touched the original stoploss price.
If the exit has happened after the stoploss is trailed even once, but the price doesn’t go back and touch the original stoploss price after the exit, then the re-entry will not happen even if the price at the end of the minute closes at or below (incase of sell) or above (in case of buy) the previous entry price.
Wait & Trade along with Re-Entry:
In the case where a Wait & Trade setting is configured, and re-entry type selected is W&T RE ENTRY, once the Re-Entry condition is activated and fulfilled (ie. At the end of the minute the price is below (incase of sell) or above (in case of buy) the previous entry price, the Wait & Trade setting is applied to the closing price of the minute, and a new entry price is derived. As soon as this new entry price is reached at any time in the following minutes, the leg will re-enter again immediately without waiting for the price to close below (incase of sell) or above (in case of buy) at the end of the following minutes.
2. RE COST:
In the Re-Cost type of re-entry, once a position has exited after hitting stoploss or target, a new position will be taken in the same symbol if the price comes back to the entry price of the first initial entry. Re-Cost doesn’t wait for the price to be at or below (incase of sell) or above (in case of buy) at the end of the minute. It simply re-enters the same symbol as soon as the price reaches entry price of the first entry of the strategy.
Unlike Re-Entry which considers the previous entry price ie. the entry price of the previous entry, Re-Cost considers the entry price of the first initial entry only
Re-Cost with Trailing Stoploss:
In the case where Trailing Stoploss is configured on individual legs along with Re-Cost, even if the stoploss has trailed even once, and then the leg has exited later, the Re-Cost type entry will happen as soon as the initial entry price has reached, ie. In the case of Re-Cost it doesn’t wait for the price to touch the original stoploss price, it simply re-enters as soon as the initial entry price is reached.
Wait & Trade along with Re-Cost:
In the case where a Wait & Trade setting is configured, and re-entry type selected is W&T RE COST the Wait & Trade setting is applied to the entry price of the previous entry, to derive the entry price for the re-entry. As soon as this new derived entry price is reached at any time in the following minutes, the leg will re-enter again immediately.
3. RE EXECUTE:
In the Re-Execute type of re-entry, once a position has exited after hitting the stoploss or target, the initial entry logic will be run again immediately and a new position is taken immediately. In the case of Re-Execute, the re-entry can happen in a different symbol unlike Re-Entry and Re-Cost. In other words, once a position exits, the entry logic is immediately ‘re-executed’ or ‘re-run’ for a re-entry to happen.
Re-Execute Method setting:
There is an additional setting called the ‘Re-Execute Method’ under the Advanced Settings which is applicable only for RE-EXECUTE type of re-entry. This setting defines 'when' the Re-Execute entry will get triggered.
Setting option 1: LTP
In this method, the Re-Execute logic is run immediately upon the exit of the previous position.
Setting option 2: Candle Close
In this method, the Re-Execute logic is run at the end of the minute in which the exit has happened. Select this setting to follow Stockmock based trading logic.
Wait & Trade along with Re-Execute:
1. W&T + Re-Execute with Re-Execute Method setting: LTP
When the target or stoploss based exit event occurs, the Re-Execute logic with Wait & Trade is initiated. That means, that when the exit event occurs the strike is selected and wait and trade is applied to the price captured at the time the strike is selected and an entry price is derived. As soon as the entry price comes the entry is triggered.
2. W&T + Re-Execute with Re-Execute Method setting: Candle Close
When the target or stoploss based exit event occurs, the Re-Execute logic with Wait & Trade is initiated at the end of the minute. The last price tick at the end of the minute is used. Once the Re-Execute entry condition is run, ie. symbol is selected, the price is captured, the W&T condition is applied to the price and an entry price is derived. As soon as the entry price comes in the following seconds or minutes the entry is initiated in the symbol that was selected.
RE EXECUTE with SQUARE OFF ALL LEGS
Re-Execute with Square of all legs settingIn this case, when any one leg hits the stoploss, all open positions are squared off, and the entry logic is re-executed again immediately and all configure legs re-enter. The same stoplosses and targets are applied to all the legs again, as per the settings. As this is the Re-Execute type of re-entry, the strikes selected for re-entries may change.
When Wait & Trade + RE EXECUTE + Square off all legs is configured together, note that the Wait & Trade condition will get applied to the re-entry orders as well. Which means, that after the SL is hit, the whole entry logic is re-executed, which is - strike selection, calculating entry price after applying wait & trade condition to the reference price.
Note, that this re-entry type setting ie. RE EXECUTE gets replicated for all legs when square off all legs is selected for any 1 leg.
RE EXECUTE REVERSE with SQUARE OFF ALL LEGS
In this case, when any one leg hits the stoploss, all open positions are squared off, and the entry logic is re-executed again immediately and all configure legs re-enter but the side changes. So, if the first entry was a Sell, then the Re-Execute re-entry would be Buy. For every re-entry the side will alternate. The same stoplosses and targets are applied to all the legs again, as per the settings. As this is the Re-Execute type of re-entry, the strikes selected for re-entries may change.
When Wait & Trade + RE EXECUTE REVERSE + Square off all legs is configured together, note that the Wait & Trade condition will get applied to the re-entry orders as well. Which means, that after the SL is hit, the whole entry logic is re-executed, which is - strike selection, calculating entry price after applying wait & trade condition to the reference price, and changing of the side.
MTM RE - ENTRY Feature
1. MTM RE-ENTRY - Square off & re-enter (Re-enter if the combined premium SL (or MTM SL) is hit:
When the MTM SL hits, the algo will immediately square off all legs and open new positions in all the legs. It is possible that the strike prices change or stay the same, based on the latest price of the underlying and the leg configuration settings.
Example:
An Iron Condor is sold with the following positions, Sell 37400 CE, Sell 37400 PE, Buy 37500 CE, Buy 37300 PE with an SL set to Rs. 2000.
If the SL hits, the algo will select the latest strikes as per the legs configured in the settings and the underlying, and immediately re-enter the Iron Condor. Based on the underlying price and legs configured, the strikes re-entered may or may not be the same.
2. MTM REVERSE RE-ENTRY - Square off, reverse positions & re-enter (Re-enter reverse positions if the combined premium SL (or MTM SL) is hit:
MTM Reverse Re-entry settingWhen the MTM SL hits, the algo will immediately square off all legs and open new positions in all the legs but in reverse. If the original positions were a Sell, then the re-entered positions would be Buy. For this type of re-entry, the legs will keep alternating between Sell & Buy, every time it re-enters. It is possible that the strike prices change or stay the same, based on the latest price of the underlying and the leg configuration settings.
How does Individual leg Re-Entry and MTM SL Re-Entry work together?
Refer to the image above.
Let’s look at an example where Individual leg re-entries and MTM SL re-entries, both, are configured in an algo, let’s see the example of CE leg which is sold, in this case, 39400 CE, which has been given a maximum number of re-entries setting of 2.
Here, upon taking positions, the 39400 CE leg hit SL at 14:34:31, and re-entered at 14:34:49. That will be considered as re-entry 1.
Later, MTM SL got hit and MTM re-entry condition was fulfilled due to which all original positions were squared off and a re-entry happened in all legs at 14:37:33. This MTM re-entry will not be considered a re-entry for the individual leg 39400 CE which has already had one re-entry ie. re-entry 1 as mentioned earlier.
A little later, 39400 CE’s individual SL is hit, and a re-entry condition is fulfilled and it re-enters. This individual re-entry of 39400 CE will be considered the re-entry 2, post which if SL were to hit, then a 3rd re-entry will not be executed for this individual leg.
But in case if MTM SL Re-entry had a maximum number of times re-entry of 2, then all the legs including 39400 CE will re-enter as an MTM re-entry along with the other legs. In short, MTM SL re-entry does not include or count an individual re-entry.
III. Other Settings:
1. Number of times re-entry setting:
With this setting, you can define the maximum number of times re-entry should happen. You can individually define max no. of re-entries for each individual leg and MTM re-entries.
If a value of ‘2’ is given for this setting, it will mean that the position will be taken a total of 3 times, ie. (1 x original entry) + (2 x re-entries).
A maximum of 20 re-entries is allowed, if a max limit were to be set. But, if “No max limit’ setting is selected, the algo will re-enter any number of times, the re-entry condition is fulfilled.
2. Re-entry time settings:
Re-entry time settings can be found under the Advanced Settings on the algo configuration page.a. Re-entry only after (time):
In the above example, re-entry will take place only after 11:15:05. Even if the Re-entry condition is fulfilled before 11:15:05, the algo will not re-enter. If SL is hit before 11:15:05, then the position will be closed for the whole day, the leg will not re-enter even after 11:15:05.
b. Re-entry only before (time):
In the above example, re-entry will take place only before 14:30:00. Even if the Re-entry condition is fulfilled after 14:30:00, the algo will not re-enter. If the SL is hit after 14:30:00, and the re-entry conditions are fulfilled, even then the leg(s) will not re-enter.
c. Re-entry between (time):
In the above example, re-entry will take place only between 11:15:05 and 14:30:00. If the SL is hit before 11:15:05 or after 14:30:00, the positions will be closed for the day. Even if the SL hits between the above set time, but the re-entry condition is fulfilled before 11:15:05 or after 14:30:00, the algo will not re-enter positions.
3. Re-Execute Method:
(This setting is applicable only for the Re-Execute type of re-entry.
Re-Execute Method settings can be found under the Advanced Settings on the algo configuration page.There is an additional setting called the ‘Re-Execute Method’ under the Advanced Settings which will define when the Re-Execute logic is initiated.
Setting Option 1: LTP
In this method, the Re-Execute logic is run immediately upon the exit of the previous position
Setting Option 2: Candle Close
In this method, the Re-Execute logic is run at the end of the minute in which the exit has happened.
Important Pointers:
- Once the trade is active re-entry type setting cannot be modified, but, maximum number of re-entries setting can be modified.
- For MTM SL, the values set in the MTM SL section will be considered as SL, if this SL is hit, then the re-entry condition will be checked. If you want your max loss in a strategy to be 6000 only, then you can set the SL value and no. of re-entries accordingly. If SL value is set to 2000 and max re-entries is set to 2, it means the (1 x original entry) + (2 x re-entries) may make up for a max loss of 6000, after which the algo will completely exit and close the entire trade.
- Re-entry orders will be fired ONLY when re-entry condition is fulfilled, even if Entry/Exit order type is Limit/SL-Limit. The algo will not place re-entry Limit/SL-Limit orders right after the original or previous SL is hit (ie. re-entry orders will not be placed in advance).
- The re-entry feature can work along with Move SL to Cost feature.
- Once the positions are taken by the algo, you can see that each leg is color coded with a color strip in the Status column. This color coding helps differentiate between unique individual open positions and the positions re-entered.