Since the market crashed in March of 2020 the rebound has been swift and irrational.

Boeing, for example, is in many ways worse off than it was in March.

It’s clear air travel has plummeted and that airlines will be impacted for

years. Where will airlines get the money to purchase planes?

An example of one headline in April: “Boeing customers cancel staggering 150 Max plane orders”.

Buy the dip?

One thing I’ve noticed is that since the end of March you can

basically just buy every dip and expect a pop, selling the next day. I

mentioned this to a friend on Friday and decided to backtest it.

Well, sure enough it works!

I’ll mention I made one modification. Originally I wrote the system like so:

1. Check if Boeing is down more than 3% 15 minutes from close

2. If yes, buy with 100% of portfolio

3. The next day, 15 minutes from open liquidate the portfolio.

This worked OK. Great actually! It returned about 25%. But want to know what really kicked it up a notch?

Instead of just selling the next day, I only sell if the position is

sitting at a realized gain. So e.g. if the next day its flat or drops

another 1%, don’t sell it, just keep holding on until its up and THEN

sell. Of course, this is completely insane and you would have to expect

the market to only go up, but that’s what has been happening.

Guess what? This simple system returned a whopping 65% in two-ish months. Yeah, I know, crazy.

Check out the backtest screenshot:

And here are the raw trading logs for those that want to see the dates the trades were made:

Here is the code!

Before we look at the code, I’ll just mention here are the details of the backtest:

  • start with 100k in cash

  • start at April first and go until last Friday (June 19th 2020)

  • end up with about 165k or a 65% return.

I wrote this little script on Quant Connect. The screenshot at the

top of the page is the backtest result, and the code below is everything you need to try this out.

Note the place I mentioned in the code you should comment if you want this to be a little bit less insane.

#algorithmic-trading #trading #python #algorithms #trading-algorithms

How I Made a 65% ROI with this Boeing Trading Algorithm
1.75 GEEK