Showing posts with label Monte Carlo Simulation. Show all posts
Showing posts with label Monte Carlo Simulation. Show all posts

Sunday, July 8, 2018

Market ignores trade war end of this past week; fun with projections!

The Friday short strike (2750) was breached and didn't come back in time:


So I rolled the call spreads I had expiring on Friday to Wednesday the 11th, straight across (same strikes ... I couldn't get filled initially trying to roll to Monday the 9th), getting an additional 2.85 in credit!

So I'm visualizing trade war consciousness (and/or some other gravity pull) for the market for the first part of the week so I can get this rolled trade off for a winner.

Now, on to projections ...


First, 6 weeks ago I wanted to see if I could project out 6 weeks, and the projections came out around $60K ... but instead the $50K or so account wound up Friday worth ... just over $75K! Why? I wound up accidentally finding a super-profitable roll and otherwise taking a bit more risk exploiting this ...

Let's try extrapolating again ...

I'm trading 3 accounts, all big enough to be able to support the 30-wide wings of the SPX Iron Condor I'm running ... In these I'm up 28%, 50%, and 33% ... in the last seven weeks or so.

First, let's take the weakest one (28%) and extrapolate simply 1 year and 5 years ... For 1 year, that's 7 times (49 weeks) and 5 years 35 times. Those projections:

1 year: up 5.629X or 562.9%
5 years: up 5653.910X ... or 565391.0% ...

So starting with $50k, that's $281474.50 after 1 year ... and after 5 years:

$282,695,000 ....

This is unlikely, I'd say ... So if I went back to design a Monte Carlo simulation that captures the rolling technique and variants of that ... let's see ... 1  year assuming 87.5% wins, risking 20% of the account, earning 15% on each win, losing a varying amount over the 30-point-wide spread:

theMacintosh:butterfly mark$ ./mca.sh /tmp/30roll.out 

min: 49864.586 
mean:  867389.75 
max: 3391457.5 
stddev: 412456.66 
Assuming the same except winning only 80% of the time:
theMacintosh:butterfly mark$ ./mca.sh /tmp/roll.80.30.out 

min: 17945.24 
mean:  299413.6 
max: 1755201.6 
stddev: 178602.64 
Still 6X mean gain ... 

Let's start with this week! More details as they become available ...

Friday, May 25, 2018

A quiet, 100% profitable week! Also: short-term monte carlo simulation and "the paycheck effect"

The trading plan I'm using depends on the market staying within about an 80 point range for 4-5 days, and this week the range was about 1/2 that:

So the 3 trades I had on that expired Monday, Wednesday and Friday all expired worthless and returned full profit (about 6% average per trade.) Accounts I'm trading were up about 3% for the week (down from 4% earlier, when volatility was higher).

I've been doing monte carlo simulations for a while now and have published a few results to this blog. But all have been at least several months long ... Here's a result for 6 weeks (18 trades of SPX + 1 NDX) running the plan like this:


  • risking 20% on every trade, so totalling 60% for the few hours Monday, Wednesday and Friday when 3 trades are active simultaneously
  • Assuming 5.8% won on every winning trade
  • Assuming a 97.5% win rate ... achievable by rolling, I think
Results are like this (starting with $50000):

    min: 32435.031 
    mean:  59566.426 
    max: 61535.93 
    stddev: 3665.9998 

So not much different from the "3% per week compounded value":  $59702.61 ...

We'll check the results in 6 weeks!

Finally, I've been listening to this podcast:


I just finished #137 with Dr. William Ziemba on betting horse races and exploiting anomalies in financial markets. The discussion was wide-ranging, but one part of the discussion struck me. Ziemba says that his research indicates that volatility (although he doesn't use that word) is skewed toward the beginning of the month because some people put part of their paycheck into the stock market!

June 1 will be coming up shortly so I'll be watching for this ... Ziemba also writes on crashes:



He points out that crashes are rare; there have only been 3 10%+ moves in the modern era ... which is one of the reasons I feel confident risking 20% on every trade starting June 1.

More next week ...

Saturday, May 5, 2018

A little too exciting in spots, but still 100% wins ... Also Kelly Criterion vs Monte Carlo

On Thursday a.m. early I thought the winning streak might come to an end:


But as you can see, the early morning a.m. plummet created a bounce up into the profitable zone ... I was short the 2610 strikes for Friday and it never got close again.

I am keeping track of the return I'm getting on this page, but I've been thinking about the limitations of the Kelly Criterion to use in evaluating trades.

The Kelly Criterion assumes that when you lose, you lose 100%. This is OK for some trades where this is in fact the case, or nearly so. But my widen the strikes revelation from 2 weeks ago made me realize that with this kind of trading there will be a spread of losses as wide as the wing width. Until I have a loss with this system (no hurry!) I don't even have a dot to put on that map.

But with a Monte Carlo simulation one can write a computer program to use the data that one has for this kind of loss, or just to program various kinds of reasonably expected loss instances.

I have been maintaining such a program for a while now; it runs 20000 simulations of a trade with various parameters (win rate & amount one up until recently) ... and now with a function I added failcalc() to estimate the spread of losses. Source code:

def failcalc():
    # 80% chance of getting the "notsobaddest" 20% of the spread
    spreadone = random.random()
    spreadtwo = random.random()
    if spreadone >= 0.8:
        loss = (1.0 - spreadone) * spreadtwo
    else:
        loss = spreadtwo

    return loss

That is, I assume that losses will be clustered 80% in the 20% smallest loss end of the spread's wing.

Other assumptions: 95% win rate, making 9.31% on every win, risking 15% of the account on every trade, 3 trades per week. Run is from now to the end of 2020.

The simulation using these assumptions gives this result, starting with $50000 today:

Minimum: $405740.16
Mean (average): $3,565,303.20
Maximum: $13,469,500.00
Standard Deviation: $1,584,992.10

Standard deviation is based on this curve:

The Standard Deviation symbol is the greek letter sigma ... basically the standard deviation shows the 68.2% chance of being that amount above or below the mean. So the most likely result (assuming the simulation parameters are correct!) is (roughly) between $2.0M and $5.0M ... 

Let's change the parameters back to a 5-wide wing. This would give a higher return (let's assume 13.5%) but much more likely to give a 100% loss (assume 80% of the time you have a 100% loss, with the rest randomly spread along the [tiny] width of the wing).

Results of this run:

Minimum: $144644.16
Mean (average): $9165858.0
Maximum: $109293100.0
Standard Deviation: $7361821.0

Clearly this one is much more volatile ... and subject to being much more likely to lose 2 in a row (which is not captured in the assumptions, I don't think.)

One think the Kelly Criterion can do is point us to the amount of risk we should be taking on every trade. Currently the Kelly is suggesting we risk 41.2% for the trades we have on our page ... 

Going back to the original run (wide wings, spread of losses wide again), but risking 20% on each trade, gives us:

Minimum: $897,867.06
Mean (average): $14,407,274.00
Maximum: $66,243,100.00
Standard Deviation: $8,207,564.00

So with this one I'm most likely to wind up with $6M to ... $22M ... anything in that range would be OK, really!

I'll be sorely tempted to start this in June, but I am going to stick with 15% risk per trade in May as previously I said ...

What will I do if there's no flaw in my analysis and I do wind up with $10M or so by the end of 2020? This, for sure:


... build a zero-energy house that my Lovely Wife will find acceptable ...

                                                   

Sunday, February 11, 2018

Volatility too much for the TSLA trade: now 3 for 5

The TSLA trade failed last week, making it now 3 for 5. It's out of Kelly Criterion range for sure, now and I'm looking for an alternative.

The one I have for this coming week is the old standby NDX trade, since it's monthly option expiration. But for the following three weeks I need to figure something else out.

One possibility:

Its leveraged ETF is VXX, and I'm going to try both of them by backtesting on a dataset I can get from QuantGo:

They resell options and futures data for a pretty reasonable price. I used their service early 2017 when I was trying to develop an algorithm. I gave up on that but now could use this again to more quickly sort through different underlyings to narrow down candidates to test via monte carlo simulation ...

More next week ...

Sunday, January 7, 2018

A speculative look at possible TSLA returns

The 2-day TSLA trade I mentioned in an earlier post should work around 80% of the time.
I assumed this win rate, earning an average of 30% on wins (and 100% loss when losing) ...
I ran 20000 Monte Carlo simulated 3-year trials ...

Starting with $20000, at the end of 3 years you average having $150381.55 ...

Not bad at all! Now we'll see if it works, starting this week ...


Friday, March 17, 2017

The Monte Carlo Simulation ... it's good but not paranormal

I ran the Monte Carlo simulation I mentioned yesterday and it looked really fantastic ...

But then I found a problem with the program I was running and it's more like this:



The parameters after I corrected the program:

  • Start with $100000
  • Every week take 1/4 of the stake (i.e. $25000 to start) and trade using that much margin
  • Assume a 77% win rate
  • Losses cost 17% of the weekly margin
  • Wins return 16% of the weekly margin
  • Run for 2 years (104 weeks)

Note that this is completely abstract and suffers from the issue that it's not possible to use exactly any amount of margin; you may get only $24000 in margin used instead of $25000.

The good news is that the data we have so far (just a smidgen, that is) was taken at a time of very low volatility (with the market at record highs). This trade may do a bit better with a certain amount of volatility, but it's very happy with the market going straight across too.

With those preambles, here's what the simulation returns after 10000 runs:
  • Probability of going broke: 0
  • Mean result: $870,055.50
  • Standard deviation: $310,804.06
  • Minimum: $199,429.98
  • Maximum: $2,808,124.00
The maximum and minimums are very unlikely. The largest blob of probability is around the mean:

So there's a 68.26% chance that the ending value is between $560K (up 560%) and $1.18 million (up 1118%).

I'm still testing but starting to put this trade on in a few more accounts and will be getting more results for the next few months. Stay tuned!

Sunday, January 22, 2017

Speculative return projections for 1 year of the trade I'm doing

I ran a Monte Carlo Simulation on a computer program that simulates one year of the trade I'm planning (after the 1-contract test period).


The assumptions I'm making are as follows:

  • I assume the trade works 80% of the time (and fails 20% of the time).
  • For each winning trade, we earn $125 per contract
  • For each losing trade, we lose $75 per contract
  • We also lose $9.88 per trade (round trip) in commissions and fees, win or lose
  • We are using a brokerage with only $500/contract margin required for day trading, and we press this to 90% of the possible maximum
  • I also assume that getting a 1000-contract trade filled is possible
Given all that, with 100000 runs starting each with $5000:
  • At minimum, we end with $10,857,638
  • At maximum, we have $21,823,532
  • On average, we have $16,513,832
  • The standard deviation is about $1.3 million, meaning there's a 68% chance of being between $14.2 million and $17.8 million
Do I really think this is possible?

Theoretically, yes; this is a highly leveraged trade.  Increasing the number of contracts (up to this high ceiling of 1000) is the key point.

But practically no:
  1. I don't have the data to show 80% wins; I do have comments from two traders doing similar trades that (a) usually works and (b) wins 90%+. So 80% seems reasonable, but I don't know.
  2. I'm going to start taking money out of the trade as soon as it starts showing results anything like this; I want to quit my job, for starts, and just use this as income to live on.
  3. You have to do this every day to get these results; skipping a day for whatever reason will reduce your expected return.
  4. I'm not at all certain that I can get 1000 contracts filled. It may be more like 200 or 250, which would reduce the returns significantly.
Hang on to your hat! I'm hoping to quit my job by April 30 ...