strateva.

Articles

Following the slope of TEMA on Tesla

What happened when a strategy followed the direction of Tesla's moving average? The notebook uses a triple exponential moving average, or TEMA, with a 20-session setting. When it rises from the previous day, the strategy goes long. When it falls, the strategy goes short. It computes the signal at the close and changes its position at the following open. Original notebook

The cost of switching positions

The Docker replay covered 1,509 open-to-open returns from January 2013 to December 2018. The position changed 255 times. The notebook charges 0.15% for each adjustment equivalent to the full portfolio. Moving from 100% long to 100% short turns over twice the portfolio and costs 0.30%.

The strategy lost 40.79% before costs and 72.45% after costs. URTH, the global equity fund used as the benchmark, gained 37.21% over the same dates. The strategy's largest decline from a peak was 90.19%.

How much the costs weigh

Costs turn a loss into near ruinCumulative return from 2013 to 2018. The rule was already losing before costs. Every change of side moves twice the portfolio: turnover added up to about 509 times its value, and at 0.15% per unit that is about 76 points of accumulated cost.
−100%−50%0%50%Before costsAfter costsURTH−40.79%−72.45%37.21%
  • Strategy before costs
  • Strategy after costs
  • Reference: URTH

Source: technical report of the test, linked below, and figures from the article itself. Prices exclude dividends.

The sum can be done by hand. Every change of side moves twice the portfolio, and over six years turnover added up to about 509 times its value. At 0.15% per unit, that is about 76 points of accumulated cost, almost 13 a year. A rule that changes position 255 times has to earn that before it starts earning anything.

Here it did not: the rule was already losing before costs. Costs do not explain the sign of the result, but they do explain its size. How to do this sum for any strategy is in execution costs.

How to read the test

The prices exclude dividends. The notebook models commissions and slippage and leaves out financing and stock-borrow charges. Its final row charges for a position change with the following open missing from the sample. The evidence in the report ends at the last observed open.

What the engine measured

The difference from the reference cannot be told apart from zeroWhat the Strateva engine measured on 1,509 daily returns. The bars are what was observed; the vertical stroke on the strategy is the range the central 90% fell in when those same returns were resampled in blocks of 11 sessions (1,000 times). The information ratio measures the lead over URTH per unit of risk: its 95% interval runs from −1.10 to 0.55.

Cumulative return

−100%−50%0%50%100%150%200%StrategyURTH−72.5%37.2%

Worst drawdown from a peak

0%−20%−40%−60%−80%−100%StrategyURTH−90.2%−21.2%

Ratios, with their 95% interval

−2−101SharpeInformation ratio−0.16−0.27
  • Strategy
  • Reference: URTH
  • Resampling range or 95% interval

Source: technical report of the test, linked below. Prices exclude dividends; the resampling uses the same historical series.

The technical report adds the margin of error to these figures. The Sharpe of the strategy was −0.16, with a 95% interval of −1.01 to 0.70. Against URTH, the average annual difference was −14.88%, with a t-statistic of −0.67: it cannot be told apart from zero.

When the same returns were resampled in blocks, the cumulative return fell between −96.92% and 170.39% in the central 90%, and the worst drawdown between 62.95% and 98.08%. What that resampling measures is explained in Block bootstrap and permutation Monte Carlo.

It may seem odd that losing 72.45% while the reference rises 37.21% "cannot be told apart from zero". The reason is noise. The strategy had an annual volatility of 51.84%, almost three times the reference's, and with six years of data the margin of error is so wide that almost any result fits. Not being able to claim the rule is worse does not make it good: it spent 98.3% of sessions below its previous peak.

Test reports

The first page of the executive summary
First page of the executive summary of the test. Header "Draft · unsigned evidence". Conclusion: the difference from the reference cannot be told apart from zero with this data; 95% information ratio interval, −1.10 to 0.55. Cumulative return of −72.45% against 37.21% for URTH. Sharpe of −0.16 and worst drawdown of −90.19%.

How to read this document is explained in the guide to the technical report.

How to read both documents is in the guide to the technical report.

See Strateva's services if you want to evaluate a rule with your own data.

All articlesAll the engine reports

CONTACT

Tell me about your strategy. I will say whether it fits within 48 business hours.

Tell me what you want checked, the asset, the frequency and what you have: rules, a report or code. I will tell you whether it fits and which plan it would be.

What to include in your email

  • Market, instruments and frequency (Spot only).
  • What you want checked, and the period.
  • Language and approximate code size, without pasting the code.
  • What data you have, and whether you need an NDA.

Do not send private code, keys or passwords.

stan@strateva.ai

Reply within 48 h (business days). No private material in the first message. No obligation to commission work.

Who replies

I am Filip Stanciu. I have an MSc in Quantitative Finance from the University of Alcalá, a degree in Finance from the Complutense University of Madrid, and a MiFID II certificate. I have worked in quantitative research for an asset manager, validating stock and ETF strategies. I read and reply to every email myself.

I am not a certification body and I am not a large team. I am one person, and I say so.

Nicolae Filip Stanciu