Skip to main content

MesoSim v2.8: VIX and Reg-T Margin beta

· 3 min read
MesoSim 2.8 Announcement Banner

We are pleased to announce that MesoSim-2.8 has been released on May 27, 2023, effectively expanding our offerings to include new Market Data and Reg-T Margin Calculation capabilities.


List of improvements​

VIX Options​

In response to your feedback received through the Data Survey, we are expanding our offering to include VIX Options. This new data set allows us to cover better the broad-based indices utilized by both retail and institutional traders.

Please note that VIX is currently in the beta phase, as certain tasks such as Settlement to VIX Futures and IV calculation are yet to be finalized. For the latest information, please visit our Service Status page.

If you are interested in VIX trading strategies, we recommend exploring Russell Rhoads' presentations and books as valuable resources.

Reg-T Margin Calculation​

MesoSim Reg-T Margin Screenshot

In response to a common user request, we have incorporated Reg-T Margin calculation into the simulator, based on the CBOE's Margin Manual. 

Calculating Reg-T margin is a complex task that requires the system to effectively analyze and deconstruct a set of contracts into known structures to accurately determine the associated margin. Although the calculation rules are clearly defined, the combinations of structures can vary significantly. Furthermore, brokers have the discretion to include additional margin requirements based on their own house margin rules, which are frequently implemented.

While Options Backtesting Software, such as OptionNet Explorer, perform its own Reg-T Margin calculations, we have observed occasional deviations from the standard. In order to ensure accuracy, we have validated our implementation with all the tests described in the margin manual. Moreover, validations were also conducted with real brokerages, such as TD Ameritrade and TastyTrade.

Overall, we have added over 3500 lines of new code to our code base, making it the most extensive change implemented for the service thus far.

You can find a Margin Enabled run in this link.


MesoSim meets Academia​

In order to support Options Education, we are initiating a program that offers complimentary access to MesoSim for classes focusing on Derivatives and Options at Universities.

If you are a lecturer interested in incorporating our service into your curriculum, please contact us at [email protected]


Roadmap​

Once we address the remaining tasks related to VIX and Reg-T, we will proceed with implementing measures to support Forward Testing. Certain features, such as enhanced visualization, will first be provided via the backtesting offering.

The complete list of work items is collected here.


Upcoming Pro plan​

As previously indicated, we are planning to introduce a Pro plan for MesoSim. The Basic Plan will allow users to backtest SPX and Crypto Options, while the Pro Plan will include additional features such as RUT & VIX Data Sets and Reg-T Margin Calculation. The Pro Plan will be available as soon as we transition VIX and Reg-T from beta to stable (sometime in the summer of 2023).

Customers with an ongoing subscription will enjoy all the benefits offered by the Pro plan at their original subscription price.

MesoSim v2.7: Russell-2000, Adjustment Improvements

· 3 min read
MesoSim 2.7 Russell Index or Terrier Banner

We are pleased to announce the release of MesoSim version 2.7, which comes with exciting new features that enhance the options backtesting capabilities for our users.


List of improvements​

Russell-2000 Index​

One of the key features of this release is the addition of the Russell 2000 index (RUT), which enables users to validate their strategies on RUT with a single line of change. This allows for a better assessment of robustness by having a correlated instrument to run fully out-of-sample tests.

Litmus test for Boxcar-NG and NetZero​

We were excited to run both Boxcar-NG and NetZero on Russell, expecting a slight performance degradation (as the backtests are slightly optimistic by nature) compared to SPX.

The results speak for themselves:

AddLegsAdjustment: Road to Black Swan Hedge and A14 Strategies​

The new version also introduces the Add Legs Adjustment feature, which allows users to add single or multiple legs as adjustments to their strategies. This capability is required to simulate more dynamic strategies such as Ron Bertino’s Black Swan Hedge or Amy Meissner’s A14 Strategy. 

The Add Legs Adjustment feature's usage is demonstrated via two built-in templates:

Rolling legs horizontally: Requirement for the Anchor Trade​

MoveLegAdjustment now supports moving the leg to new expiration, which is required for backtesting Steady Options' Anchor Trade.

Stepping on Strikes​

With Version-2.6, we allowed backtests to re-use legs across positions. To further enhance the flexibility of the platform, we have introduced a non-constrained leg selection ("LegSelectionConstraint": "None"), which allows strikes to be re-used for legs even within positions.


Convenience features and fixes​

We have also addressed the annoyance of missing fields appearing as warnings (in yellow) by automatically upgrading jobs during Cloning and providing users the possibility to upgrade templates with a click of a button.

The new version also comes with minor fixes for OptionNet Explorer compatibility, UI, and missing data handling categories.


Roadmap​

Looking ahead, we remain committed to improving MesoSim’s capabilities by adding new features and additional data to push the boundaries of Options Backtesting Software.

We plan to add VIX, more scripting capabilities, and calculating Reg-T margin before tackling Forward Testing. The current roadmap is available here.


Upcoming Pro plan​

Some of the new features and datasets will go into the Pro plan of the options backtesting offering in the future, and customers with ongoing subscriptions will enjoy grandfathered pricing for the (yet to be announced) new Pro plan.Overall, MesoSim version 2.7 is a significant step forward in our mission to provide our users with the best possible options backtesting experience.

We look forward to hearing your feedback on these new features.

MesoSim v2.6: External CSV Data and Stepping on Strikes

· One min read

We are happy to share that two of our most requested features were added to MesoSim:

External Data from CSV:

Users can now bring their own indicators / signals / pricing data via the External Data interface. Just upload the data to Github Gist or Google Sheets and specify the URL in your backtest run. From that point, all your variables can be used in all Lua Statements as variables. 

Stepping on booked Strikes:

Prior to MesoSim 2.6, the options contracts usable for new entries and adjustments were excluding contracts that were taken by any leg in any position. This behaviour was a useful simplification in our SimBroker and also represented how we personally trade options strategies. Some of our users, however, don't mind re-using options contracts. To support their use-case we implemented a mode of operation which enables sharing contracts across positions. 

Please head to our official documentation to read more about the mechanics of this two new features.

Upcoming features:

  • We are actively working on adding Russell-2000 (RUT) and VIX data
  • Add Leg Adjustments are the next key feature we are delivering soon

MesoSim v2.5: Full Crypto Support, Improved adjustments, Historical Volatility

· 2 min read
mesosim-v2.5-banner-pic

We are pleased to announce version 2.5 of MesoSim which includes the following improvements:

  • Crypto graduates to Stable:
    Simulation of Crypto Options (BTCUSD and ETHUSD) traded in Deribit is now fully supported. The documentation has full coverage of Crypto extensions.
    See the BTCUSD-Straddle-2022 featured run to get started, or browse our strategy library for other ideas.

  • Remove Leg Adjustment:
    It is now possible to conditionally remove a leg and adjust the structure afterward. Please check out the docs and the built-in template [SPX-RemoveLegAdjustment] for reference.

  • Multiple Adjustments:
    You can do multiple adjustments in one simulation cycle, allowing moving complete structures leg-by-leg. For reference, see the [SPX-MultiLegAdjustment] template.

  • Historical volatility for the underlying:
    underlying_hv variable is now available, representing the 30-day historical (or realized) volatility.

  • Education material:
    We also started to put together training material to get you started easier.
    You can find the Work in Progress version of the presentation here.

Data Survey result

Thanks to everyone filling out our Data Survey.Based on your responses, we will add Russel-2000 (RUT) Index Options shortly, and later in the year, we'll add VIX as well.

Next work items

In the next cycle, we'll further improve our flexibility related to Adjustments, External Data (CSV) and will keep addressing the rough edges reported by our users. 

NetZero Trade

· 7 min read

Overview​

NetZero (aka 60-40-20) is an At The Money Broken Wing Butterfly trade on SPX that Andrew Falde has devised. This trade has been explained in great detail by Mark Mosley in the Raleigh Durham Open Systematic Options Trading Strategies recording.

The options structure utilized in this trade involves a delta-neutral, positive theta, and negative vega income structure. The Broken Wing Butterfly's legs are strategically placed at deltas 60, 40, and 20 on the put side.

NetZero ONE Structure

Trade Rules​

NetZero Rules Part 1

The original trade rules are described as:

  • Enter trade 60-80 days to expiration
  • Select strikes having the deltas closest to 60, 40, and 20 deltas
  • Exit trades when
    • Middle leg’s delta changes by 30%
    • Upper leg’s delta changes by 30%
    • 30 days to expiration is reached

Mark Mosley has incorporated an additional exit rule into the trading strategy inspired by the methods of John Locke, whereby an early exit is taken when the delta to theta ratio (delta divided by theta) reaches a threshold of 60%.

We will validate the two variants by simulating their historical performance using MesoSim. In all simulation runs, we will use Multiple Positions in Flight to avoid relying on one execution path.


Simulating the original trade​

As the structure definition is trivial, we will only spend time detailing the trade's exit rules.

To enable exit criteria based on delta comparison of the Upper Long and Middle Short Leg with their initial states, we will be recording the delta values of each leg at initiation and storing them in the designated variables:

"Entry": {
...,
"VarDefines": {
"initial_leg_shorts_delta": "leg_shorts_delta",
"initial_leg_upper_long_delta": "leg_upper_long_delta"
},
}

Then using the Exit.Conditions to describe the three criteria:

"Exit": {
...,
"MaxDaysInTrade": 999,
"ProfitTarget": null,
"StopLoss": null,
"Conditions": [
"(leg_shorts_delta - initial_leg_shorts_delta)/initial_leg_shorts_delta > 0.3",
"(leg_upper_long_delta - initial_leg_upper_long_delta)/initial_leg_upper_long_delta > 0.3",
"leg_shorts_dte <= 30"
]
}
info

Please note that we have set the MaxDaysInTrade parameter to an exceptionally large value to render it ineffective. This configuration is aimed at adhering to the original rules of the trading strategy, which mandate an exit from the trade when the legs approach 30 days until expiration. To implement the time based exit rule, we have chosen the leg_shorts_dte variable for the check, although the other two legs' respective variables (leg_upper_long_dte and leg_lower_long_dte) would be equally viable options.

Backtest results​

NetZero Original MesoSim Screenshot

The full run with further statistics (full tearsheet) is available in the following link: https://portal.deltaray.io/backtests/148c6282-e485-4807-8418-385c96815bb2

Upon reviewing the Log Return graph, we can observe that the trading strategy exhibits strong performance characteristics in markets that trade sideways, which is reflected by its outstanding performance during the periods of 2015 and 2022.

The trading strategy encounters its most challenging period during the interval between two black swan events, namely the Volmageddon in February 2018 and the Covid Crash in 2020.


Simulating Mark Mosley’s variant​

During the presentation, Mark Mosley introduced an additional exit rule that employs the delta-to-theta ratio as a benchmark for exiting trades early. We suspect that this additional trading rule comes from John Locke’s methodology on trading Broken Wing Butterflies.

NetZero Mosley Modification

Additional trading rule​

To integrate the additional trading rule, we have made the following modifications to the job definition:

  • Entry.AbortCondition guarantees that we only establish positions that conform to the delta to theta ratio requirement
  • Exit.Conditions are responsible for exiting the trade when the ratio becomes unfavorable

The respective rule in Job Definition:

"pos_theta ~= 0 and abs(pos_delta / pos_theta) > 0.6"
note

The ScriptEngine in MesoSim (which utilizes Lua programming language), employs the non-equality operator, denoted by ~=. Initially, we leverage this operator to verify that the pos_theta variable is non-zero, which is necessary to circumvent any division by zero issues during the computation of the delta-to-theta ratio.

Backtest Results​

NetZero Mosley MesoSim Screenshot

Backtest Run’s URL: https://portal.deltaray.io/backtests/3c9e63c6-d946-4d65-b736-b7d0dba4dd4f

It is apparent that the performance of the strategy is greatly improved:

  • Sharpe increased from 0.74 to 1.16
  • CAGR reaches 19.85%
  • Max Drawdown is reduced from 50% to 33%

Our variant​

This time, instead of conducting a comprehensive study on IV Rank, Underlying State, or Theta, as we did for the Boxcar trade, we will make two changes to the strategy to improve its performance.

Days in trade vs. Date till Expiry​

The original rules for this trade specify the time-based exit using the "Date until Expiry" method, whereas we prefer to set the time barrier based on Days In Trade. We believe that Days In Trade is more predictable in terms of expected performance than the Date until Expiry, which can vary trade by trade. To make this change, we can set the MaxDaysInTrade variable to 30.

Truly Net Zero​

According to the original trade rules, legs should be chosen closest to Delta 60, 40, and 20. However, this approach may not always result in delta=0 at the initiation, which adds slight directionality to the trade. To address this issue, we will dynamically select the Lower Long leg such that the overall structure ends up at 0 delta. To accomplish this modification, we will set the target delta for the leg to pos_delta:

{
"Name": "lower_long",
"Qty": "1",
"ExpirationName": "exp1",
"StrikeSelector": {
"Delta": "pos_delta",
},
"OptionType": "Put"
}

For further information on how delta hedging is performed, please refer to the documentation.

Furthermore, we will incorporate an extra exit criterion that will terminate the trade if it becomes overly directional during its lifecycle. Our selected thresholds to exit the position are Delta -10 and 10:

"abs(pos_delta) > 10"

Backtest Results​

NetZero DeltaRay MesoSim Screenshot

Backtest Run's URL: https://portal.deltaray.io/backtests/0fed4a1f-3b66-4adb-aa36-0a49b59936f0

Setting the initial delta of the structure to 0 and maintaining it at around that level resulted in noticeable improvements in Sharpe ratio, CAGR, and Max Drawdown compared to both variants:

  • Sharpe: 1.32
  • CAGR: 20.1%
  • Max Drawdown: -29.94%
NetZero DeltaRay Monthly MesoSim Screenshot
NetZero DeltaRay Worst DD MesoSim Screenshot

Although the trade experienced difficulties in the post-volmageddon period, we consider it a promising subject for further research as it demonstrated remarkable performance in sideways markets.

Future work​

Hedging​

Although the recovery rate is quick, a Max Drawdown of -29.94% is still a significant loss of investment. As this drawdown happened during a black swan event (Covid crash), it is recommended to include a hedge while trading this strategy. Such a hedge can be as straightforward as buying long puts (teenies), implementing a Black Swan Hedge according to Ron Bertino's PMTT course, incorporating Brent Pedersen's findings on hedging power, or using David Sun's Bomb Shelter or Vibranium Shield.

Volmageddon - COVID period​

We attempted to pinpoint the root cause of the structure's difficult period by examining its Risk Profile and analyzing various metrics, including:

  • Position Theta, Gamma, and Vega throughout the trade
  • Relative (to the underlying) and Absolute Prices of the structure and the individual legs

Unfortunately none of these metrics yielded significant insights into the reasons for the trade's underperformance during the mentioned period. Since we acknowledge that there is no silver bullet solution to trading, we accept the structure in its current state.

If you have any suggestions for improving the trade, please feel free to leave a comment. We welcome and value your input.


Conclusion​

We have performed a simulation of a public SPX trade using MesoSim, which has shown exceptional performance in 2022. Therefore, we consider it a promising candidate for future research. We believe this trade would complement the Boxcar-NG trade well, resulting in a well-rounded portfolio.