Selling put options is akin to operating an insurance business:
the option seller is rewarded with the premium (option price) in exchange for taking the risk of assignment if the market moves below the strike price at expiration.
This simple strategy can be highly profitable in bull markets, but it can result in significant losses
during bear markets and sudden down moves.
MesoSim was created to study options trading strategies. It offers numerous built-in templates demonstrating key features as well as ready-to-use strategies.
For simulating Option Writing, we will utilize the [SPX-ShortPut] built-in template.
The above screenshots capture the overview of two runs for different time periods:
Trailing Stops are well known to equity, futures and options traders alike. The idea is simple: As the profit increases we store the highest profit achieved (high watermark) and create a stop order relative to the high watermark. This way, our stop loss will not be fixed, but it will continuously move higher as the strategy gains.
Programatically it can be described as:
At entry:
Set pnl_high_watermark to 0.
Whencurrent_pnl > pnl_high_watermark:
Set pnl_high_watermark to current_pnl.
Whencurrent_pnl < pnl_high_watermark * x%:
Exit the position.
To explore how a trailing stop could enhance a trading strategy - such as option writing- in different market conditions, we will implement it in MesoSim. The above logic can be translated into a Strategy Definition as follows:
At entry initialize pnl_high_watermark variable to 0:
"Entry": {
...
"VarDefines": {
"pnl_high_watermark": "0"
}
},
Increase pnl_high_watermark when we reach a new high of pnl:
"Adjustment": {
...
"ConditionalAdjustments": {
"pos_pnl > pnl_high_watermark -- record new high watermark": {
"UpdateVarsAdjustment": {
"VarDefines": {
"pnl_high_watermark": "pos_pnl"
}
}
}
}
},
Exit when the current pnl falls below the 75% of the high watermark:
"Exit": {
...
"Conditions": [
"pos_pnl < (pnl_high_watermark * 0.75) -- Exit if pnl drops 25pct from high water mark"
When comparing the original Short Put runs with the Trailing Stop version, we can conclude that the trailing stop signifficantly improved the strategy performance in Bear market. In contrast, the results in bull market became more modest, although it remains fairly good (with a sharpe ratio around 2).
Trailing stop is a dynamic approach to increase strategy performance. It has proven to be beneficial for the simple SPX Put Writing strategy by locking in gains without sacrificing much upside potential.
Someone interested in this approach should try different relative ranges from the high watermark to see how it affects her strategy performance.
MesoSim v3 Migration Note
This article was originally written for MesoSim v2. The examples and terminology have been updated to match the MesoSim v3 Strategy Definition format. For details, see the MesoSim v3.0 release announcement and the v2→v3 migration guide. The performance metrics, described behavior, and referenced run results reflect the original v2 behavior. If you rerun the referenced strategies on MesoSim v3, results may differ slightly due to behavioral changes in the simulator.
While we continually add and release features to the MesoSim backtesting service, it's beneficial to mark milestones. We firmly believe that MesoSim v2.10 represents an important advancement for the options trading community, offering unparalleled flexibility in the low-code backtesting universe.
By adding VarDefines to Entry, Exit, and all Adjustment types you are now empowered to capture or change state throughout the execution steps. Additionally, we have introduced a new Adjustment Type (called UpdateVarsAdjustment) built to alter variable states.
Lastly, we have converted all the numeric fields to Statements, enabling you to utilize Lua for calculating simulation parameters during execution.
info
We are showcasing the enhanced flexibility with the SPX-TrailingStop built-in template. The trailing stop results, in itself, are particularly noteworthy:
Data Voyager (and Vega) is a data exploration tool that has been integrated into our Portal.Click on the Analytics tab to study how Greeks and other variables are impact your Strategy's Performance. You can also visualize the variables you created during backtest.
The concept here is to identify a contract at a specific moment and wait
until favorable conditions arise. Once your conditions are met you can use AddLegsAdjustment to create a real Leg at the pre-defined contract.
The simulation performance has been significantly enhanced in this release!
The intraday strategies now run 1.5 to 2 times faster than before.The daily strategies' performance has also improved, with a margin of 15-30%.
These performance improvements now enable us to introduce concurrency in intraday runs. You can now simulate Multiple Entry Iron Condors [MEIC] (and others), where positions are taken multiple times per day.
The maximum concurrent positions in flight have also been increased from 10 to 12, allowing intraday strategies to enter positions every 30 minutes.
While the Simulator has become more flexible, we have also made progress in the areas of Live Trading and Forward Testing. Internal testing of a Position Monitor has commenced, and active work is underway for Order Creation (IBKR).
Once we are satisfied with the quality of the live offering, we will open up for a private beta. If you would like to participate, please send us an email at: [email protected]
John Locke (@Locke4Success) is a reputable source when it comes to Options Trading Strategies. You can find many of his trading strategies on YouTube, for free.
His strategies and their variants are often simulated with MesoSim.We are now adding his Super Bull strategy as a featured trade to our strategy library.
The rules were constructed as discussed in his youtube videos.
The strikes are selected in a manner where the long legs are positioned 20 points above the current price of the underlying asset and the shorts are chosen to achieve a Risk/Reward ratio that is close to 1.0
The strike closest to 20 points above the underlying price can be determined by setting the Complex StrikeSelector’s Target to underlying_price + 20 and specifying the constraint to ensure that the chosen leg’s strike will be always above the underlying price. This constraint is necessary because the Selector selects the nearest contract to our target, which - in some cases - may be below the underlying price.
The Statement field of the selector is evaluated for each contract and represents the strike. According to the SuperBull rules, our target will be 20 points above the current underlying price.
While John suggests aiming for a 1:1 Risk/Reward ratio, he shows multiple examples where the trade is initiated with a ratio lower than that. He explains that this is due to the unusual volatility skew observed on those particular days. In such trades, the risk/reward ratio was around 1.5 at the initiation.
John suggests that the trade should be sized so that it risks a maximum of 10% of the account size. This rule was implemented in our run using Entry.AbortConditions: We abort the entry if the Entry Debit would be greater than 10% of our NAV.
In our initial attempts, we used one contract for each leg. This turned out to be inadequate: Most of the time we under-sized the position (Maximum Risk was around 1% of NAV). To alleviate this problem we introduced Entry.QtyMultiplier to MesoSim, which is capable of scaling all the legs, once they are identified. We leverage this feature to target a maximum loss of 10% (in terms of account size) for our trades.
The exit rules for the strategy can be summarized as follows:
When the next monthly expiration becomes 65 days away, we enter a second trade. From that point onwards, we monitor the progress of the first trade. If the first generates a positive return, we exit the trade. However, if the first trade is at a loss we wait until it becomes profitable or reaches expiration.
These rules in MesoSim can be expressed as:
"Exit": {
"Schedule": {
"BeforeMarketCloseMinutes": 30,
"Every": "day"
},
"Conditions": [
"(pos_in_flight > 1) and (days_in_trade > 28) and (pos_pnl > 0)"
OptionNet Explorer is frequently utilized by options traders for modeling and manually simulating trades. It is essential to comprehend the accuracy and limitations of its simulation and real trading accuracy before engaging in trading activities. This section provides concise insights into these limitations, allowing the reader to better understand the comparison between MesoSim and OptionNet simulated results.
OptionNet Explorer can be utilized for initiating and monitoring live trades. However, there is one potential accuracy issue to be aware of. When entering complex (multi-legged) trades using the compounded Option Price, the individual leg prices in OptionNet often differ from the actual fills. Therefore, it is necessary to manually adjust the prices of the individual legs after entering the trade. This adjustment can be performed using the Trade Log window.
In contrast, MesoSim’s performance reporting tracks daily NAV values and computes quantitative performance metrics for both the strategy and the benchmark, such as Sharpe, Sortino, Omega, and more.
This information provides a more precise representation of the strategy’s performance, allowing the user to better understand its expected performance.
info
Please note that we do not mean to suggest that MesoSim is better than OptionNet. Instead, we state that OptionNet's functionality can be extended by MesoSim's automated backtesting and performance reporting capabilities.
In other words: MesoSim is a companion service to OptionNet Explorer.
Our win rate of 85.2% (81/95) confirms that we are close to what John achieves (86%) with this trade.
Both the Log Return and yearly breakdown charts show that the trade performs well during Bull Markets, such as 2013-2014, 2019, and 2021. However, it exhibits higher volatility during sideways markets.
If we compare SuperBull with the S&P-500 Buy and Hold strategy we can conclude that it performs better in the validation period:
Higher CAGR: 16.7% vs 10.11%
Slightly lower max drawdown: -34.06% vs -34.83%
Improved Sharpe ratio 0.89 vs 0.67
It has low margin requirements
Surprisingly, this strategy didn't exhibit a large drawdown during COVID as the Maximum Loss based Entry Filter prevented it from entering during market turmoil.
Rafael Munhoz, a key contributor to our community has thoroughly analyzed this trade and developed his own variant. Based on his experience, it proved challenging to find optimal trades that offered a 1:1 risk/reward ratio. He made adjustments to the trade to address these challenges and generously shared his results with us.
His results are improving the original trade by having higher CAGR, reduced Drawdown, (and therefore) improved Sharpe:
CAGR: 19.4% vs 16.7%
Max Drawdown: 30.55% vs 34.06%
Sharpe: 1.06 vs 0.89
Similar to the original trade, the Relaxed SuperBull also excels in bull markets andit has outstanding performance in the 2013-2014 period.
Due to its more dynamic exit criteria and re-entry rules, it responds fairly well to crashes, such as COVID.
However, unlike the other trade, this variant demands more attention from the trader as the entries and exits are more frequent and dynamic compared to the original strategy.
Both Rafael and ourselves believe that John's trade is worth studying. None of us is affiliated with John in any way.
We would like to thank John Locke and Rafael Munhoz for sharing the SuperBull and the SuperBull-Relaxed trades with the options trading community!
MesoSim v3 Migration Note
This article was originally written for MesoSim v2. The examples and terminology have been updated to match the MesoSim v3 Strategy Definition format. For details, see the MesoSim v3.0 release announcement and the v2→v3 migration guide. The performance metrics, described behavior, and referenced run results reflect the original v2 behavior. If you rerun the referenced strategies on MesoSim v3, results may differ slightly due to behavioral changes in the simulator.
We released MesoSim v2.9 today, which further extends the simulator's flexibility with a new strike selector. Additionally, we are expanding our built-in strategy library to showcase the new feature.
To enhance the simulation capabilities we have added the Complex StrikeSelector. This feature allows users to find a leg based on complex criteria, such as the delta-to-theta ratio. The Complex StrikeSelect is particularly useful for building spreads and optimizing multi-legged structures. Similar to other Strike Selectors, it can be used during Entry, MoveLeg and AddLeg Adjustments.Please check out the documentation or take a look at the two built-in templates that utilize this feature:
Initially, we used closing and opening prices to account for settlements (PM and AM, respectively). While this approach provides a close approximation for PM settlements, AM-settled options may exhibit larger differences (more details here).
As part of the VIX stabilization effort, we have begun utilizing the official settlement prices for all the instruments we support.
Behavioral change warning
If you re-run previous backtests in which trades reached settlements you will now observe a different, more accurate simulation now.
We have addressed a remaining bug and included the missing structures in the Reg-T margin calculation. This makes Reg-T complete and fully supported under the Advanced plan.
To better support intraday strategies we are adding two variables for tracking the time of the day: minutes_before_open and minutes_after_close These variables be used in intraday entry, exit or adjustment conditions.
To ensure an accurate simulation of VIX Options' Settlement we have switched to using the official settlement prices. This is crucial
because all VIX options are AM settled and approximation using open didn't was not sufficiently accurate.
We are currently awaiting the resolution of the data issues we reported to our data vendor. Once that is resolved we will promote VIX to Stable. Please stay tuned for further updates.
We have previously covered David Sun’s (@thetradebusters) Theta Engine in one of our blog posts. The power of Theta Engine comes
from David’s unique method for determining the size of short put positions. For more details on his approach, please refer to our blog post and his website.
Claudio Valerio, a valued member of our community has created and shared a variant of the Theta Engine strategy. His modification includes a dynamically added long put hedge during periods of elevated Implied Volatility (IVRank > 50). He selects the contract closest to Delta=4 with the same expiration as the short put. The number of purchased contracts is three times the number of shorts sold. Additionally, Claudio has adjusted how the parallel positions are spread out and increased the planned capital of the trade.
When the ATM Implied Volatility for SPX Options is below the mid point of its 52 week high-low range (IVRank < 50), we go with naked shorts as the original trade did.
When IVRank reaches (or goes beyond) 50, then 3x as many longs are added as shorts, creating a 3:1 Put Ratio Backspread. With the added hedge he is substantially reducing the downside risk and capping the upside profit potential.
While ThetaEngine originally does not contain a hedging component, David has shared his hedging strategies (Vibranium Shield and Bomb Shelter) in great detail. Hedging is a must when it comes to selling options, therefore we suggest that you study David’s original hedges or Claudio’s variant with the built-in hedge. It shall be noted that while reactive hedging (as presented here) is a cost-efficient way, it will likely not provide good coverage for scenarios where the market is closed and crashing, such as during the 9/11 events.
To study the characteristics of the trade we'll be using OptionNet Explorer. The following two screenshots are showing the Risk Graph when the position is naked short and when the hedge is added.
info
About sizing:
MesoSim’s built-in ThetaEngine template is more aggressive (details in the ThetaEngine post) than David’s original trade plan. Claudio has taken our built-in template with 25% credit target and created his variant allocating $50k for the trade.
We would like to thank Claudio for sharing the Volatility Hedged Theta Engine and David for creating the original trade plan!
MesoSim v3 Migration Note
This article was originally written for MesoSim v2. The examples and terminology have been updated to match the MesoSim v3 Strategy Definition format. For details, see the MesoSim v3.0 release announcement and the v2→v3 migration guide. The performance metrics, described behavior, and referenced run results reflect the original v2 behavior. If you rerun the referenced strategies on MesoSim v3, results may differ slightly due to behavioral changes in the simulator.