Sunday, January 29, 2017

Progress on the algorithm but ...

I found a technical indicator that works better than MACD on the tests I've done so far. It's call RSI (Relative Strength Index):


It doesn't generate as many trade signals as I had with the MACD test, and it does show a profit. BUT the profit only comes after a too-large drawdown of the account (over 60%) in the middle of the backtest sequence.

More research is needed! I'll update when I learn a bit more about the next step.

Thursday, January 26, 2017

A book that looks helpful

I was googling around for help doing something in TradeStation's EasyLanguage and came across:


It comes with code in EasyLanguage and Python and I'm very much looking forward to taking advantage of it ... starting tomorrow!

Eyes back on the prize after a tough day ...

I goofed and increased my contract size to 2 on /NQ today and got clobbered. Fortunately I won 3 /NQ 2-tick trades (1 contract each) so cut my loss to $176.



And I found it stressful and annoying, staring at the /ZB DOM chart, even though I won all three.

I am going to stop setting my alarm to get up with the opening of the market but may still try and pick up a couple of ticks of /ZB now and then. But I need to focus back on algorithm development. I have a couple of ideas to try out over the next few days ...

Wednesday, January 25, 2017

A small loss today

Still testing with 1 contract: I quit with a profit of $18 but apparently had left one contract on ... the UI says I lost $57.50 for the day. Oh well. I should have looked at my list of positions to make sure I was flat on everything, but:



I went back to bed and I needed it ... setting alarm for 6:15 (PST) to make sure I'm ready for market opening. Probably jumped the gun on a couple of signals this a.m.

One thing I learned today: two ticks isn't enough for /NQ; I thought it was $10/tick but it's only $5/tick. Sheesh. I won, but only 12 cents or something on a couple of these.

More tomorrow ....

Tuesday, January 24, 2017

Another winning day with one glitch

I'm continuing to test with 1 contract before scaling up. I switched today to using wider stops and closer limits, the latter as little as 2 ticks. This worked well! A 2-tick win on /ZB (bonds) trade was especially pleasant as they're $31.25 per tick.

The only glitch: a trackpad extra bounce! I sold two 'OCO' brackets of /NQ when I meant to sell just one, and the extra one got stopped out immediately for a loss. My solution:


I'll have this within a couple of days.

Overall I made $76.48 today (over $600 if I had been trading 8 contracts ...)

Monday, January 23, 2017

Today's results won't quite make the speculative return benchmark I posted over the weekend:


I used the 'depth of market' interface that I found over the weekend, which worked as specified. But I got stopped out twice in a row before winning two in a row, all within the first 45 minutes of trading after the 6:30 PST opening.

Since I was using a tighter stop than profit target ($75/$125) I actually made a $72.98 profit for the day (on 1 contract of /ES.)

But! It's clear that I would have made two in a row with a wider stop and a narrower profit target; If I'd flipped the two this a.m. I would have made a quick $141 or so.

Maybe I'll try this tomorrow ...

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 ...

An acknowledgement I forgot

The guy who explained the MACD to me in detail was "Tass", the local head of the now defunct trading meetup group. He was gracious enough to do a Youtube session with me to go over this.



Thanks!

Saturday, January 21, 2017

More about the trading platform I'm using

I'm using Zaner360, apparently a "white label" version of OECTrader. I found a set of videos on the details and there is a "depth of market" window that comes up if you know where to look that does just what I want: set up a 'one cancels another' trade called a bracket.




A Youtube video that describes this in detail is here.

I had seen this sort of window in a video for NinjaTrader, but I didn't know the tool I'm using had the same ability; it didn't come up automatically.

Oh well .. I have this ability now until I get the program worked out.

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!

Thursday, January 19, 2017

Day 2 of the test: another small win

I put on a 1-contract /ES long trade this morning before the official market opening. I was able to get close to the profit target on the little uptick after 6:30 (PST):


Profit for today: $90.12, just like yesterday ... for tomorrow I think I'll use a 'limit order' to have it close automatically at the profit target. This would have worked better today and in general it keeps me from having to 'pull the trigger' at the right time.

Another test tomorrow (maybe later today if conditions look exceptionally good.)

Wednesday, January 18, 2017

Acknowledgements

I would be remiss if I didn't acknowledge the people and institutions who helped me prepare to work this plan:






Thanks to all of you!

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.


The Plan

I became aware recently of brokerages that charge only $500 margin per contract for /ES (S&P 500) futures. (Margin is typically 8 or 9 times this). So one can make (or lose!) 8 or 9 times the money when using this extra buying power.


I signed up for an account with one of these brokerages, Zaner and funded it with $5000.

My plan:

  • Test for a week using just 1 contract ($12.50 per tick), with a goal of making a quick $100 every day.
  • If that works, try it with 9 contracts, making a quick $900 or $1000 every day.
  • Get out if the trade goes $50 or $60 (this week) or $500 or $600 (next week and beyond) the wrong way and try again later in the day.
  • Continue work on a trading algorithm in the meantime
So far:

I just started this today, making $90.12 ($100 minus $9.88 round trip commissions & fees). P&L was just over $100 but it ticked down just as I was clicking the 'close' button.




Introduction: I failed as a trader, so I'm trying a computer program

I got interested in trading in 2008 during the financial crisis. I knew there were ways to make money no matter which way the market moved, but I didn't know the details.

I started trading in 2009 and had intermittent success, but overall failed miserably. I made numerous key mistakes, the one that recurred most recently was thinking I knew what was going to happen. Specifically, this guy could never be elected:


But he was, and I was caught on the wrong side of the trade ..

One place I've had some success is with day trading, though I don't like staring at the screen for long periods. This leads me to a plan ....