Showing posts with label algorithm. Show all posts
Showing posts with label algorithm. Show all posts

Saturday, February 11, 2017

Algorithm update: first test trade in progress

I put on the first small trade to test this strategy last Monday, February 6.

The algorithm design is to put on a similar trade every Monday, forever; backtesting shows this works nearly 80% of the time.

So the performance chart is so far like this:


Trade DateResultProfit/Loss
2017-02-06Open

It should show +10% in the Profit/Loss column in another 11 or 12 days.

I will update this whenever I have a result, at very minimum.

Wednesday, February 1, 2017

Algorithm progress!

Finally I think I have a plan ...

One thing I have learned in reading is that these algorithms tend to stop working over time as more people get in on them. So it isn't in any of our interest for my to disclose all the details.

I can say that it's based on the tried-and-true iron butterfly:


Oops, not that one; this one:


Once again, I'm keeping this vague ... but I'll be ready to start testing this (in a small account of my own) within a week or so. I'll publish all the results here from the first trade onward and will probably do this for 6 months or so before rolling it out to others.

Best of luck to all of us!

Friday, January 20, 2017

Day 3 of test: a silly mistake, glad I am just testing

I used to know this but I forgot: despite a trend that looks established before official market opening at 6:30 (PST), beware:


The market went up several points just after I put the trade on ... I had put in a limit order to get out at the profit target the other way, and this somehow futzed up the interface that I thought I could still use to exit near my max loss target. Instead I fumbled around and lost $212, about 3x what I should have.

I reversed course and got some of it back going long, but once again fumbled with the interface missing about $50 of that move. Net for the day I lost $130.

I realize after this episode that what I need is a small computer program for this little trade:

    Buy (or Sell) N contracts
    Set a "one cancels another" set of orders when the market moves:

    • 2.25 points in the 'profitable' direction (i.e. $150/contract)  
    • or
    • 1.25 points in the 'unprofitable' direction (i.e. $75/contract)  
This should work at least 85% of the time if I avoid the 'trade just before opening' thing.

Also! This should be doable to work for multiple different people (hi Ruth!)  ... I can write a program to blast out for several accounts simultaneously ..

I'll get this going this weekend!

Wednesday, January 18, 2017

The Algorithm: current status

I started out trying to program against a standard technical indicator, the MACD crossover:


For day trading I tried using different settings than the standard (9,12,26); this Python library I found, qtpylib, had (3,10,16) programmed in by default and found that was recommended by a trading guru as good for intraday trading so tried that.

I couldn't get Python to match what the charts (on ThinkOrSwim) were doing at the same time I was reading this book:


The author was going on about TradeStation and its backtesting features. At the same time I found that Zaner supported TradeStation to send signals into its platform, Zaner360. So I opened a TradeStation account as well.

So far my testing with MACD shows that it puts out too many trade signals. I haven't necessarily given up on it yet but I tried another indicator, the RSI (relative strength index) that seemed to work better:

I'm still working on this as the test shows a lovely profit, but with too much 'drawdown' in the middle of the test. If you start with $100,000 and end with $380,000 that's great ... but not if you have a trough in the middle where you're down $104,000.

There are ways around this and I'm still working on it ... more details when I have them.