Deadline June

Re: TurningPoints Improvements Needed

I'm a bit surprised I really have no idea why one trade has such a big target and the other doesn't. This implies that my system is slowly turning into a black box, and that won't be so good.

Looking at it again I can imagine what the reason is for this, but I want to check it out anyway.

I am going to put it in the garage and up on blocks to see what I can do to improve it, and go over all the posts I've made here complaining about it, but at the moment I am still trying to sort out my historical data. I need the tools ready before I can take it apart.
 

Attachments

  • $EURCAD (60 Min)  13_05_2011.jpg
    $EURCAD (60 Min) 13_05_2011.jpg
    125 KB · Views: 290
  • $EURAUD (60 Min)  13_05_2011.jpg
    $EURAUD (60 Min) 13_05_2011.jpg
    127.3 KB · Views: 258
mechanical trading ****-ups, part 14

I haven't had one of these for a while.

The system reversed and thanks to NinjaTrader, didn't place target and stop orders. It's a very well known bug - for me - but NinjaTrader support can't reproduce it. Meanwhile there is a better method for order handling available which I intend to implement which will resolve the issue.

So the 2 orders on the chart are my emergency rescue plan. The target limit is in the place where it should have been - the stop should have been the same distance the other side of the entry, but I'm putting it at b/e.

Until then I should check it more frequently because this time round it could cost me 60 pips or so.

I missed this 4 hours ago but hopefully the new orders I placed will catch the continuation with the target and it won't retrace any further into the stop.
 

Attachments

  • $AUDCHF (60 Min)  20_05_2011.jpg
    $AUDCHF (60 Min) 20_05_2011.jpg
    161.6 KB · Views: 257
Re: TurningPoints Improvements Needed

I'm still working on the next version of the Ninja****er strategy - I'm not even doing backtests at the moment, I'm still at the stage where I'm framework building (the greatest time-killer of all for software developers).

Anyway, I'm getting there slowly and looking at the charts trade by trade. The main addition to the Turning Points systems that I'm going to make is a trend filter, but I need to work out what.

Since I'm not ready to backtest it yet, I'm just playing it by eye. On this one, I've got a 200 bar EMA. The theory is that I don't want to go against the trend. This was my favourite pair CHF/JPY which lives in a world of its own in terms of where it's going compared to all the other pairs, but is pretty typical in that it gives me continual losses when going against the as-yet-to-be-defined trend.

Those trades on the chart are typical. The last one was a sell and stop loss there on the right.

I also have a nagging doubt that the system likes trading against the trend, in terms of raw numbers of trades made with and against.

All conjecture though. I need some profit and loss series to check these theories out. Otherwise it's all just the rantings of a paranoid system administrator. Paranoid I might be, but I'm good at non-interference. I haven't canned a single trade that this system put on in almost 9 months of trading now.
 

Attachments

  • $CHFJPY (60 Min)  23_06_2011.jpg
    $CHFJPY (60 Min) 23_06_2011.jpg
    153.1 KB · Views: 272
Re: TurningPoints Improvements Needed

AUD/JPY

The overlap between bars on this pair is comparatively huge.

I thought I could use a measure of the overlap as a proxy for volatility. That didn't work. Then I tried it as an inverse proxy for volatility. Also no joy.

OK I don't really have time to do any off-the-cuff system development but it's just so striking.
 

Attachments

  • $AUDJPY (60 Min)  28_06_2011.jpg
    $AUDJPY (60 Min) 28_06_2011.jpg
    157.9 KB · Views: 240
Trading system errors running live

Got another error here, this time on the Aussie / Canadian pair.

The mechanical error could have been rectified with only 5 pips loss if I had acted on it properly but I deviated from my standard protocol and thought I could get some profit out of it if I allowed the market to continue up in my direction.

It didn't, in fact it went down 20 points, before it came back 10 and closed the hourly bar, but then at the stroke of noon it fell off a cliff, dropping 20 points in a second. The USD/CAD did the same. I closed it out for 30 points loss.

Enough disaster stories - the mechanical fault was an InteractiveBrokers disconnect on the stroke of the hour, which resulted in NinjaTrader's order handling going wrong as it tried to reverse a position. The disconnect lasted 6 seconds, but it was enough to prevent NinjaTrader from (a) cancelling out the old exit orders once it reversed, (b) entering new exits and (c) giving any kind of warning.

So when the AUD/CAD reached its new target, instead of going flat, it doubled the position and that's how I found it - having sank back down 5 points.

What I need to do is to program my NT7 strategy to detect in the OnBarUpdate() event whether it's connected or not. If it's not connected, I need it to text me a warning or something.

Another feature I'd like is a button to click to put the strategy into 'unattended' mode so that it will shut down the strategy and close its position if it detects a disconnect when trying to submit orders.
 

Attachments

  • $AUDCAD (60 Min)  29_06_2011.jpg
    $AUDCAD (60 Min) 29_06_2011.jpg
    171.4 KB · Views: 288
Re: TurningPoints Improvements Needed

Another strange occurrence from my Turning Points system. The second entry immediately after the exit on the spike just doesn't fit in with the way the mechanics of the system work. Or should work. I'll have to look at this later.

July has been really good for the equity levels in my account so far. If the month ended today, it would be my most profitable month yet.

I have reprogrammed this Turning Points strategy to use some more reliable NinjaTrader order management features, but I haven't put it in action yet. I now let NinjaTrader handle the targets and stops just by calling two functions after the entry. It should take care of the one-cancels-other logic better than I did.

Haven't got anywhere with my improvements yet. Been spending a lot of time learning to trade manually.
 

Attachments

  • $EURJPY (60 Min)  26_07_2011.jpg
    $EURJPY (60 Min) 26_07_2011.jpg
    150.3 KB · Views: 266
Performance reports and forecasts

I'm putting together a template for a performance and forecast report to keep my records on the straight and narrow. I've spent too long doing everything ad hoc and I think it'd be good to have definitive reports in pdf format available for people who need it - like myself, my accountant and other traders / friends / colleagues who want an overview of what I'm doing.

I think the best way to refine this template first of all is to write out a list of contents just like a book. I figure I'll write the documents in excel where I can build the tables and the charts easily, and then print it to pdf when it's done.

Something is wrong with the list BB code because it's not showing. If I'm doing something wrong, I'll find out and correct it in a while, otherwise I'll have to rejig the whole list layout.

1a. Intro desc of system

  • edge justification
  • markets chosen or rejected & reasoning
  • slippage applied & reasoning
  • trading engine, broker, hardware, networking etc


1b. the model, i.e. the backtest of the finished NT strategy:

  • backtest stats across basket (per instrument in appendix)
    • any system parameter values
    • backtest period start, end
    • commission applied
    • slippage applied
    • total profit, annual profit, monthly profit
    • profit p.a. / max drawdown
    • gross profit, gross loss p.a.
    • profit factor (gross profit / gross loss)
    • total commission, comm. p.a.
    • trades p.a., trades per day
    • total trade count, wins, losses
    • % wins, %losses
    • largest win, largest loss
    • average win, average loss
    • ratio average win:average loss
    • max drawdown
    • max time to recover
    • max winning streak in trades, in days
    • max losing streak in trades, in days
    • longest w/out trade
    • equity <> straight line correlation coefficient
    • max rolling equity standard dev.
      • (don't know how 26 columns are going to print to PDF nicely)
  • portfolio level stats
    • max open positions
    • max margin requirement seen, date
    • absolute max margin
    • profitable weeks count, unprofitable
    • % 6 month profitable periods
    • % 12 month profitable periods
    • % 18 month profitable periods
    • Sharpe ratio
    • Sortino ratio
  • money management stats
    • weighting per instrument
    • worst forecast loss (biggest observed gap + largest loss)
    • geometric p.a.
    • optimal f
    • geometric mean
    • geometric average profit
    • terminal wealth ratio, annualised TWR
  • table of non-portfolio stats for all instruments
  • ten worst losses for basket
  • ten worst drawdowns in USD for basket
  • ten worst drawdowns in days for basket
  • equity curve chart (per instrument in appendix)
  • margin distribution bar chart (max per day)
  • correlation to S&P
  • correlation to USD Index
  • correlation to EUR/USD
  • correlation to CRB Index
  • correlation of instruments cross-reference table
  • hourly returns distribution bar chart
  • daily returns distribution bar chart
  • weekly returns distribution bar chart
  • monthly returns distribution bar chart
  • yearly returns distribution bar chart
  • hour of day returns distribution bar chart
  • day of week returns distribution bar chart
  • individual trade analysis
    • perfect trade description
    • avg win, avg loss per trade, per instrument
    • MAE, MFE, ETD per instrument
  • optimisation charts of parameters showing profit against parameter value, illustrating the optimisation surface smoothness or spikiness (appendix)

2. then come the out-of-sample test stats with:

  • same stats report
  • same charts
  • comparison of key stats with backtest to produce % decline against backtest

3. forward test in real-time

  • same stats
  • same charts
  • comparison with out-of-sample and backtest

4. forecast/expectancy for live trading performance

  • non-compounded forecast
  • compounded forecast
    • gross ROI
    • annualised ROI
    • compounded profit / max drawdown
  • capital allocation

5. live trading

  • inception date

6. trade results for last quarter

  • same stats report
  • same charts
  • comparisons with backtest / out-of-sample / forward test
  • trade log per instrument per last quarter (-> appendix)

7. further live trading results

  • year-to-date per year
  • over last 12 months
  • for calendar year
  • since inception
  • annualised since inception (just thinking a little bit ahead here...)
 
Another one bites the dust

I pulled the plug on my main trading system after a big drawdown which hit my system stop loss. It was caught out twice by high volatility and Swiss National Bank intervention and then after that, just an average losing day saw equity levels sink down to the stop loss trigger.

With hindsight, as Boris, our mayor here in London might say, it was bonkers. I had many opportunities to avoid 'defeat' so to speak, or at least the few thousand dollars lost.

I shouldn't have withdrawn so much cash from the account, for instance.

I had numerous opportunities when equity was 'up' to reduce leverage.

I should have realised that my reluctance to reduce lot size was purely down to testosterone (n) especially at the opportune moments when the equity was in positive territory, and cortisol when the equity was down.

I should have implemented regular monthly reviews to check that all vital signs were in order, but I was so wrapped in (a) learning to trade PA and (b) developing a successor to the system, that I just wasn't paying attention enough to the system. It was pretty much on a back-burner, but just not at the appropriate reduced lot size.

I should have reduced lot size earlier by necessity if I'd managed to bring another system into production.

I should have put a maximum risk parameter on the stop loss in the system, or perhaps a fixed % of equity, as had occurred to me several times.

I should have pulled the plug earlier by working faster on its replacement.

I could have pulled the plug earlier because I knew I would probably not make money on it but I wanted to run it for a year for statistical reasons :rolleyes:

And there are probably more if and buts. The main lesson though is that the effect of testosterone and cortisol don't just affect discretionary traders - I can vouch for their power on mechanical traders too.

So I'm left with a considerably reduced account for my next system, whenever that might be ready for production, to be shared as the trading stake for my PA/discretionary trading. The saga will continue, but without any little screenshots of crazy **** that my system was getting up to.

As an aside, I estimate I was spending an hour a day everyday except Saturdays running the beast on NinjaTrader. So, 6 hours a week. I should definitely have added another hour to that to allow for a performance review - mea culpa.
 
Last edited:
Re: Another one bites the dust

Adamus,

Taken an interest in your thread and have a loose proposal. I see you've sound experience in indicator/strategy coding in ninjascript/C#. I do not which is a crying shame as I have a project to complete!

I have a system that shows sound performance in manual backtesting and sim trading. But boy does that manual back-testing take an age.

So I figure if I can get a strategy put together I will be able to get through the back testing a whole lot quicker - and most importantly increase the test numbers so they are statisically robust.

My goal is to take the rule set and filters I use manually and be able to just speed up the development process. I do not want to get a fully automated strategy.

Entries are based on standard NT indicators (or ones I've built based on them) and are really very straight forward. One potential issue is one indicator is from a commercial vendor so that code is not available, but looks straight forward to clone (I have documentation to define it).

Would like however to be able to play around with exits.

A long shot - are you in the market for scripting work and if so at what rate.

Let me know and if you are so we can talk further.

Thanks
 
Re: Another one bites the dust

Adamus,

Taken an interest in your thread and have a loose proposal. I see you've sound experience in indicator/strategy coding in ninjascript/C#. I do not which is a crying shame as I have a project to complete!

I have a system that shows sound performance in manual backtesting and sim trading. But boy does that manual back-testing take an age.

So I figure if I can get a strategy put together I will be able to get through the back testing a whole lot quicker - and most importantly increase the test numbers so they are statisically robust.

My goal is to take the rule set and filters I use manually and be able to just speed up the development process. I do not want to get a fully automated strategy.

Entries are based on standard NT indicators (or ones I've built based on them) and are really very straight forward. One potential issue is one indicator is from a commercial vendor so that code is not available, but looks straight forward to clone (I have documentation to define it).

Would like however to be able to play around with exits.

A long shot - are you in the market for scripting work and if so at what rate.

Let me know and if you are so we can talk further.

Thanks

Hi Mokodo,

I will PM you.

Thanks
 
Top