What is Trailing Stop Loss?
A dynamic way of managing risk is to capture every move in your direction. The trailing stop loss commonly referred to as TSL does just that. Trailing stop loss helps you capture the upside when your trade is in your favour and adjust the downside when it's not.
While we are all familiar with practically using a 'trailing stop loss order' on various broker platforms, the trailing stop loss feature on Tradetron is an extremely powerful tool to let your winners run and exit the losers. This also means that it is one of the most misunderstood tools of Tradetron. This blog post will try to demystify some of the common misconceptions around the usage of the TSL
TSL Vs TSL order
What we traders colloquially call trailing stop loss is in reality a trailing stop loss order. A TSL in an algo setup is not achieved through individual orders but through a calculation based on the overall PNL of your strategy. It is important to note that when the trailing stop loss in an algorithm is achieved, it simply closes all open positions through a Universal exit. This is quite different as compared to a broker's TSL order where the broker is continuously modifying the order that was sent to the exchange based on your trailing inputs.
How to activate the trailing stop loss?
The trailing stop loss can be found in the advanced settings of the strategy creation page of Tradetron.
You will notice that the values are set as zero by default. This means that the trailing stop loss is not currently activated. In order to activate this feature, simply add values in all three boxes. What values to add? Let us explain.
Once you have entered into your strategy, every time your strategies conditions are checked, the Tradetron server will lock a value based on your PNL. Activate at is the PNL after which your trailing stoploss mechanism gets activated. Let's assume you set 'activate at' as 1000. Your trailing stoploss will now be activated only after your strategy has an overall profit of 1000 rupees. Once activate at is set, your TSL is now set at a PNL of 0 rupees.
When profit increased by:
After your ‘activate at’ price has been breached and the TSL mechanism has been activated, whenever the profit increases by the number inserted here, the TSL will be shifted up. This gives you the flexibility to trail your profit in any ratio you like. A 1:1 trail can be achieved by keeping the ‘profit increased by’ and ‘increase TSL by’ values the same number.
Increase TSL by:
Once the overall profit is greater than the ‘activate at’ price and the ‘profit increased by’ price, the TSL will now shift from zero to the number you set here.
We understand that this might sound a bit complicated to understand, but it gets fairly straightforward once we break it down in the form of an example. Let's assume we have the following TSL parameters set in a strategy.
Based on the values shown let's consider what will happen in each case shown below:
At this point it is important to note that the TSL works on a strategy level and not on a set level. Thus the overall PNL calculation for TSL happens on the realised as well as the unrealised profit or loss of your strategy. The TSL will only reset if your run counter changes.
Moreover the TSL feature has been configured to be automatically adjusted as per the multiplier of your deployment. For example if you have selected a 2X multiplier on the ‘deployed’ page for your strategy, the TSL values will also be doubled.
Checking trailing stop loss metrics from runtime data:
While setting a couple of values in some boxes may be easy, it's always a good practice to check how and where the trailing stop losses trigger in order to optimise a strategy. Every time a strategy is executed, there are some variables that are created. Since the trailing stop loss conditions may not always come true, whenever TSL is activated, a runtime variable will be generated. In order to open the runtime data, Go to the deployed page and find your strategy. Look for the three dots next to the same, click on it and scroll down, you will see 'runtime data'. The runtime data is only visible to the creator of the strategy.
How to find out if the trailing stop loss feature was activated?
If you see ‘tsl_flag’ in the column under the ‘key’ column, and an attribute of '1' next to it, your TSL feature has been activated. Going forward the system will keep checking for the ‘profit increased by’ value set.
How to find the max profit achieved in a run counter?
Within the runtime data dialogue box you will see 'tsl_profit' with a value next to it. This is the maximum recorded profit figure achieved by your strategy. This includes the realized and unrealized profit and loss of all the positions.
What was the stop loss set as?
In the same runtime dialog box, you will see tsl. The value next to the same TSL shall be the trailing stop loss for consideration. If your strategy has not already been executed, your TSL may keep updating depending on the maximum profit achieved by your strategy.
We hope this blog helps you understand and optimise your strategies. If you feel there is something else you would like us to cover here, please feel free to share your views with us at [email protected]