Australian (ASX) Stock Market Forum

Developing a mechanical system from scratch

Sorry Joe. I also could of alt-printscreened it to I guess.

I have circled what I believe to be the first instance and also circled the last three days whic I think set up the beginning of the second instance.

Have I got this right?

cheers
Surly
 

Attachments

  • gbg.JPG
    gbg.JPG
    129.8 KB · Views: 79
On Waynes adjustable exits.
Cant use them in a system as the variables have to be fixed.
Fine for discretionary,but how would you pick which variable to use?
The optimise function in AB works a treat.

In the end you'll have a set of parameters that if traded as designed and tested will return the expectancy found through testing.
What you get with a system is a repetitive entry and exit which over time will give the sested return within the upper and lower boundaries of the returns found through testing.
How has that gone this year?

Not really. Stock distributions of returns are leptokurtic i.e. they have fat tails. This means Black Swans happen more often than you would think.

It is this that makes trend following systems work, and it is this that means you get crunched in a gap down more often than normal distribution suggests.

In this market traders are just used to the upside fat tail and have been relatively unexposed to the downside fat tail.

This will also eventually regress to the "mean" and traders will get more frequent unexpected and unwelcome price shocks at some point in the future.

Be prepared for that. :2twocents
Lol.
 
The optimise function in AB works a treat.

Something I will have to look into as I dont have AB--Yet.


How has that gone this year?

With T/T results have actually been as tested although a period like that of last year wasn't in the sample testing.What did and has happened is the system stopped itself out of all positions for the first time in 7 yrs.It hasn't triggered a buy for some months.Will however continue to run the system when new trades are triggered.A great learning experience.
I personally exited the system around 18 mths ago.Hindsight shows I am no worse off had I continued with my own trading with the system.

Yes it was a psychological reason I sold out and went cash.I personally didn't wish to put at risk the $$s I had in the system.(A personal choice).
I have however been using part of the funds in discretionary trading.(20% of them).
 
Very interesting Tech.

I guess that's one of the problems, that testing periods may never be the same as those that they actually operate in, but good systems should not be completely killed either...

I'd say a lot of short systems that were once never profitable, are now also profitable on a tested basis.

Would like to see this thread given a re-birth, now that canny can get on here a little more regularly again.
 
Chops

Having been involved in systems over the years and quite sometime since developing a new one I must say that a lot of my thinking has altered and been added to over the years.
A system if I was to develope it now would have different characteristics to those I developed in 2000-2004.
So to would my testing proceedure and I would add to my software with Amibroker.

Howard Bandy and the market have been a huge influence on my thinking---for the better I think.
Not that the others dont work just that perhaps they are the FJ version not the latest Model Grange!!
 
But what happens now?

A lot of systems would never be profitable testing through this period... so do you just set a 'catastrophic movement' filter, to stop it doing anything?

Do you just ignore this period, dismiss it as an anomaly? Does the system have to be profitable during this period for you to think it valid in future? Or do you design systems knowing that it may not perform how it tests, and just accept that?
 
But what happens now?

A lot of systems would never be profitable testing through this period... so do you just set a 'catastrophic movement' filter, to stop it doing anything?

Do you just ignore this period, dismiss it as an anomaly? Does the system have to be profitable during this period for you to think it valid in future? Or do you design systems knowing that it may not perform how it tests, and just accept that?


Chops.

T/T and the other 3 I designed around that same period were and still are designed as long only methods.They are designed to perform well in trends.
To expect them to perform well in choppy or bearish markets is simply not realistic.Those that persevere at at best to become frustrated and at worst disillusioned---no need to be.
I believe that we know pretty well that the coming next 5 or so years are likely to be choppy. There will be times of bullish and bearishness.
If you wish to trade or design systems they should be based around these likely characteristics.
Shorter timeframe.
Both long and short.
More frequent trading.

You can and should search out other markets which may trend either long or short---better than stock. Perhaps currencies or other Futures or FX.

Just my view.
 
That's the way I think it will be.

A lot of sideways movement, therefore we need to look at trading techniques that are supposedly good in these environments, sideways and reversion type systems you would imagine work well.

My suggestion, if anyone wants to test it, would be something like a weekly hi-lo system.

It also suits the wishes that were expressed in this thread, both long and short, with < 4 days trading time exposure.
 
I've been working on a system (or set of related systems) to trade currencies and the SPI. It should be transferrable to other markets. At the moment, I'm patiently waiting on intra-day testing capabilities to be added to Tradesim so I can check it out thoroughly. Then I might have something to add....
 
I'm re-starting this thread now that i have the time and the ASF access to do it full time.

In my other thread i showed the results of a few systems that I've developed already using a Genetic Program called Adaptrade Builder. These systems did not meet my Objective Function, so i'll try again.

I will attempt to first develop a Price Pattern+Volume system to trade the DAX on a 15 minute time frame. Trying to keep things simple to start with.


-Starting Capital is 25,000 EUR
-Objective function is will be found by multiplying the Win% x Profit Factor x ratio of -W/L with- a goal of greater than 1.2
-I will try to get this OF unoptimized, not sure if that is realistic at this stage.

I will be using a Genetic Algorithm (Adaptrade Builder) to develop the system.
-Metrics that I'm using are:
-Maximize Profit - which i have weighted at 5
-Pct Wins - weight 4 and a target of 55%
-PF - weight 4 and target 2
-Ratio W/L - weight 4 and a target of 2

For the data:
-Construction data is from Sept 01/2009 - May 30/2010
-First OOS period - Sept 01/2010 - May 30/2011
-Second OOS Period - Sept 01/2011 - 01 April 2012
-Reasoning behind the data selection is that generally September to May is the most active period with plenty of liquidity.

Standard procedure for evaluation:
1.) Construct according to metrics
2.) Test on OOS1 to see if Objective function is met or not
3.) If OF not met then we will start again at step 1
4.) If OF is met on OOS1 then we will optimize the MM Stops and Exits only, on OOS1 and test on OOS2
5.) If OOS2 meets the OF then we start to trade on the IB Paper trader and post the results weekly. We will trade for 3 months unless we determine that further testing is needed.

I will post the results as i get through the first OOS period.

Should be interesting.

Cheers,


CanOz
 
Ok, after a couple of hours and three separate build runs where i added generations, and changed the weighting of the metrics so that the emphasis was on PF, W%, and W/L Ratio and less on profitability i finally got a system that meets my Objective Function.

I have system code for a DAX system that over 8 months of historical data produced a profit after slippage and commissions of 9007.00 EUR.

The PF = 1.833
The W% = 50.2
The W/L ration = 1.8329

Next step is to take the code over to MultiCharts and test it over the same period to ensure the results are the same.

CanOz
 
Ok, after a couple of hours and three separate build runs where i added generations, and changed the weighting of the metrics so that the emphasis was on PF, W%, and W/L Ratio and less on profitability i finally got a system that meets my Objective Function.

I have system code for a DAX system that over 8 months of historical data produced a profit after slippage and commissions of 9007.00 EUR.

The PF = 1.833
The W% = 50.2
The W/L ration = 1.8329

Next step is to take the code over to MultiCharts and test it over the same period to ensure the results are the same.

CanOz

Back to the drawing board:(...it tests the same on MultiCharts, which was good. Unfortunately when i tested it on unseen data it took no trades at all:eek:. I suspect that it was not statistically relevant so I'll need to add that to my metrics. Also I'll allow it to use an ATR and an a Tri-Avg as well.

Well need to make that procedural change too, so we test it first on unseen data to ensure its taking trades on MC then go back and optimize on OOS2.

While we're building another one for the DAX, we'll run the code over the other markets, the HSI, the SPI and ES just in case we stumbled upon something by chance that works.

Cheers,


CanOz
 
Can
I'm not familiar with the software your using.
Not familiar with sow o the terminology.

But I think your to middle road not at extremes.
By that I mean

(1) if your trading short-term you'll want 65 % and well upwards in win rate.
(2) you'll get trends with a less success rate of 30-40%

The 50% area is very difficult to design a system in--- well that's my experience anyway.
 
Can
I'm not familiar with the software your using.
Not familiar with sow o the terminology.

But I think your to middle road not at extremes.
By that I mean

(1) if your trading short-term you'll want 65 % and well upwards in win rate.
(2) you'll get trends with a less success rate of 30-40%

The 50% area is very difficult to design a system in--- well that's my experience anyway.

Thanks Tech, the OOS is 'out of sample'.

The higher win rates are usually associated with a scalper, use a wide stop and short target etc..

The software I'm using uses an algorithm to design an algorithm. So I've got little control for the moment.

I'm also learning Easy Language so I'll be doing some research as i become more handy with that as well. It will be interesting to see if i can come up with a better system than the software. I've got dozens of ideas, only limit is my basic coding skill...it'll come I'm sure.

Thanks,


CanOz
 
The software I'm using uses an algorithm to design an algorithm. So I've got little control for the moment.
CanOz

If you let the genetic algo run over unbounded time-series it will almost certainly find what you've shown, the 'optimal' solution which isn't very useful walk forward.

You can influence it by providing inputs.

For example, in finding optimal daily mean reversion signals might be to provide ROC2 and Bollinger(120,1.5) of the ROC2 as inputs to the genetic algorithm. You need to come up with some (very simple and robust) inputs which will influence your algo to the sort of trading edges you think exist!

Do you catch what I'm saying? It's very important for intraday, since you need to avoid the exact issue you've found. You will probably find it's not as important if you 'trained' on daily data.

EDIT:
A very simple place to start is to provide
* Bollinger(N,1) on closing price
* Kelt(N,N,1)
* ROC(N*10)
* Bollinger(N*10,1.5) on ROC(N*10)
* Bollinger(N*10,1) on volume
* Bollinger(N*10,2) on volume

Do you see why?
 
If you let the genetic algo run over unbounded time-series it will almost certainly find what you've shown, the 'optimal' solution which isn't very useful walk forward.

You can influence it by providing inputs.

For example, in finding optimal daily mean reversion signals might be to provide ROC2 and Bollinger(120,1.5) of the ROC2 as inputs to the genetic algorithm. You need to come up with some (very simple and robust) inputs which will influence your algo to the sort of trading edges you think exist!

Do you catch what I'm saying? It's very important for intraday, since you need to avoid the exact issue you've found. You will probably find it's not as important if you 'trained' on daily data.

EDIT:
A very simple place to start is to provide
* Bollinger(N,1) on closing price
* Kelt(N,N,1)
* ROC(N*10)
* Bollinger(N*10,1.5) on ROC(N*10)
* Bollinger(N*10,1) on volume
* Bollinger(N*10,2) on volume

Do you see why?

No, i'm afraid its over my head Sinner....

The code looks like a Bollinger squeeze with the KC and the BB...

The algo can be influenced by the indicators i select and 'let' it use.

I'll try your recommendation and see what happens, but other than programming in EL the indicators based on your BB/KC/ROC i'm sure i cannot get the exact parameters.

Thanks Sinner,

In the meantime I've slapped some indicators on achart to see if i can figure out where you're going with this....


CanOz
 
No, i'm afraid its over my head Sinner....
CanOz

Hmmm...it's not the squeeze or anything like that!

Let me try and explain it a different way...

Right now you are feeding in pure price to the system, nothing else.

e.g. tick price time-series
1.01
1.02
1.03
1.02
1.03
1.02
1.03
1.04
1.03
1.02

the optimal algo might just be "buy 1.02 sell 1.03" or "short 1.03 cover 1.02" but what if when the system goes live, it's trading in a price range between 2.00-2.10? "Buy 1.02" or "short 1.03" will never work even though it was "optimal".

but if you added a ROC to it, so that it optimally knew (because they are genetically advantageous) instead "buy on 0.1% dips sell on 0.1% rises"?

this is just an example to give you an idea of what I mean.

The above Bollinger, ROC are converting raw numbers into statistical numbers, specifically std. dev from a mean and % (log normalised) changes in price/volume...notice I said ROC and not Momentum (Momentum is raw). This was just an example I chose because it is simple and robust. Nothing magic about it, there is very high tech math stuff or even technical rules (N occurrences) you could input instead.

The genetics work out whether it's optimal to buy or sell in any given situation, but you have to parameterise the situation, e.g. is it 'genetically advantageous' to buy when the price/volume is exceeding some mean by some std devs or is it more advantageous to short or even be flat?
 
Hmmm...it's not the squeeze or anything like that!

Let me try and explain it a different way...

Right now you are feeding in pure price to the system, nothing else.

e.g. tick price time-series
1.01
1.02
1.03
1.02
1.03
1.02
1.03
1.04
1.03
1.02

the optimal algo might just be "buy 1.02 sell 1.03" or "short 1.03 cover 1.02" but what if when the system goes live, it's trading in a price range between 2.00-2.10? "Buy 1.02" or "short 1.03" will never work even though it was "optimal".

but if you added a ROC to it, so that it optimally knew (because they are genetically advantageous) instead "buy on 0.1% dips sell on 0.1% rises"?

this is just an example to give you an idea of what I mean.

The above Bollinger, ROC are converting raw numbers into statistical numbers, specifically std. dev from a mean and % (log normalised) changes in price/volume...notice I said ROC and not Momentum (Momentum is raw). This was just an example I chose because it is simple and robust. Nothing magic about it, there is very high tech math stuff or even technical rules (N occurrences) you could input instead.

The genetics work out whether it's optimal to buy or sell in any given situation, but you have to parameterise the situation, e.g. is it 'genetically advantageous' to buy when the price/volume is exceeding some mean by some std devs or is it more advantageous to short or even be flat?

You know, this could explain why i had 0 trades when i was just using price patterns and volume....

Heres some of my options....
 

Attachments

  • Indicators.gif
    Indicators.gif
    75.7 KB · Views: 6
Top