Australian (ASX) Stock Market Forum

Developing a mechanical system from scratch

ATR mightn't be the way to go with that canuck. Might be better off using the daily range(H-L) to measure each day.

Have a read of this link on ATR-

http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:average_true_range_atr

ATR won't always be the high - low figure.

Someone else correct me if I'm wrong here, as I've never really used ATR at all.

I think code-wise, you would want it to look something like this-

range = H - L;
buy = range < ref(range,-1) AND ref(range,-1) < ref(range,-2);

Or something like that(far from a coding guru):eek:
 
I'm going to attempt to help out here.

Firstly when your looking at trading a System you really do have to alter your thinking.
System doesnt equate to best entries and exits.

It does equate to a consistent entry and exit plan.
Each trade will have very varied results.
Some being stopped.
Some with Huge wins relative to risk
Many with moderate wins

Some of this Ive learnt from Radge.
But to increase profit you need either
To trade more winners than losers Over 50% is good but not absolutely necessary
To Have much larger winners than losers,IE a high reward to risk ratio.
Ideally a combination of both.

This will form the basis of Nicks WHY.

With a short term system Nick is referring to trade frequency.
As trades will be shorter then the Reward to Risk will be lower than a longer term system.Mine (Longerterm) run at between 7-12:1 reward to risk.
Most short term methods achieve 1.5-3.5 reward to Risk.
So if you can trade more times with this return in the shortest possible time then you'll soon a mass huge profit over time.

Nicks bang for buck filter which has been coded for both Metastock and Amibroker once run against any entry will identify the highest volatility.
Most systems spit out many potential trades---what Nick is saying is be selective---particularly short term---those with highest volitility have highest chance of quick moves and hence quick return---then off to the next!

So to Nicks suggestion.
He points out that Volatility follows contraction in volatility.
This pattern which is simply 3 inside days demonstrates this.
There are many similar patterns both larger and some more complex.

Insidedays.gif

Here pricebegins with a wide range bar and contracts over 2 bars.
This would fit very well with Motorways VSA analysis I'm sure as normally volume also contracts as supply dries up.
Even better on the smallest contraction indise day bar volume REAPPEARS!

Anyway that was more or less I think what Nick was hoping you'd cotten on to.

For those really interested in knowing your ATR
Here is a great explaination.
http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:average_true_range_atr
 
I think your missing the point again, we wanted to design a system, a system that was different to Tech Trader in the fundemental way, ie. short term instead of long term...

The testing will prove whether it has an equal performance factor or not.

Cheers,

Also, I'm all for Nick leading the team here...no ego problem here, thats for sure! :eek:lol!

I tend to echo Nizar's perspective, as I think they're genuine questions and within context of the discussion.

Drawbacks to TechTrader as I see them are 1. Only trades to the long side, 2. Potentially large drawdown when the trend (finally) bends.

Due to point 1, when the trend does bend you won't make-up for the drawdown in a bear market as the system doesn't reverse posture. Otherwise, I think that a leveraged Tech-Trader style mechanical system must be one of the most effective ways to consistantly profit in this market. I'm interested to see if a short term CFD-based system can provide an advantage in the form of 1. trades to the short side, 2. lower and/or fewer drawdowns over time and/or 3. greater overall expectancy.

The pseudo-code for a technical setup like Nick's 'double-inside' pattern might be:

IF { High islessthan High(of yesterdays bar) AND
Low > Low(of yesterdays bar) AND
High(of yesterdays bar) < High(of the bar two days ago) AND
Low(of yesterdays bar) > Low(of the bar two days ago) THEN
SETUP=true }
ELSE {
SETUP=false }

This does not include any code to qualify whether "the bar two days ago" was of higher relative volatility.
 
Initial stop at technical support
Breakeven Stop ASAP (breakeven 2xinitial stop distance)
Trailing stop - ATR
Exposure Stop - ????

Cheers,

This wouldnt be mechanical and cannot be made mechanical.
Or do you want to use discretion for (initial) stop placement?

WHy dont we try a %. Like 10% initial stop maybe?? Tech i think your T/T uses something similar.
 
I think code-wise, you would want it to look something like this-

range = H - L;
buy = range < ref(range,-1) AND ref(range,-1) < ref(range,-2);

This will work if you don't care that the H or L of each bar may lie outside the range of the preceding bar. By doing this you tend to miss the pattern, which is a micro-triangle, a la often found in the position of an Elliott Wave 4, hence followed by a Wave-5 and subsequently the target area for an ensuing A-B-C correction ie. nice place to have a stop just outside of.
 
This wouldnt be mechanical and cannot be made mechanical.
Or do you want to use discretion for (initial) stop placement?

WHy dont we try a %. Like 10% initial stop maybe?? Tech i think your T/T uses something similar.

It's entirely possible to place a stop at a programmable technical support level. Ed Seykota's support/resistance system does exactly this. It's not the type of discretionary support/resistance zoning that most people think of ie. look at the chart on a large time frame and see where price activity has become range bound or been turned around...but for an initial and/or trailing stop in a mechanical system it could suffice.
 
It's entirely possible to place a stop at a programmable technical support level. Ed Seykota's support/resistance system does exactly this. It's not the type of discretionary support/resistance zoning that most people think of ie. look at the chart on a large time frame and see where price activity has become range bound or been turned around...but for an initial and/or trailing stop in a mechanical system it could suffice.

Thanks for that ASXG.
I had no idea.

Do you know exactly how to do this with amibroker/metastock or would it require some other software?
 
Hi all

I would like to make the point that a "near enough is good enough" attitude is only acceptable for long term systems.

However, with a short term system like the one we are developing, every aspect of it must be planned and specific because when using leverage you do not have the cushion of time to fall back on.

That is why I'm suggesting that once you have identified a possible trade that meets with all other criteria you confine entry times to the 5th hour of trade.

Cheers
Happytrader
 
Hi all

I would like to make the point that a "near enough is good enough" attitude is only acceptable for long term systems.

However, with a short term system like the one we are developing, every aspect of it must be planned and specific because when using leverage you do not have the cushion of time to fall back on.

That is why I'm suggesting that once you have identified a possible trade that meets with all other criteria you confine entry times to the 5th hour of trade.

Cheers
Happytrader

Happy we are talking Short term not day trading or a few days trading.
I agree if your down to these timeframes but you'll need realtime data to test.
I dont think thats whats in mind.

The system will spit out the numbers and missing the first hour of trading for an entry can and often is costly.Swings and roundabouts.

Attempting to perfectly time entry and exits will send you round the twist and its NOT necessary---as you understand system structure and what you achieve by trading one you'll understand.

I think you also presume that longterm system traders like myself dont trade or design shorter term systems.I'm playing with a concept now have been for a few months..
 
Just to keep things moving I have thrown some initial sample code together that people can have a look at, modify, add to, improve and focus discussion.

Run it as an exploration in AB.

Cheers.

Code:
/* 

ASF Sample System Development

*/

NumColumns = 3;

VolRatio =  StDev(log(C/Ref(C,-1)),5) / StDev(log(C/Ref(C,-1)),99);
Column0 =  VolRatio;
Column0Name = "VolRatio";

InsideDay1 = H < Ref(High,-1) AND Low > Ref(Low,-1);
Column1 =  InsideDay1;
Column1Name = "Inside Day 1";

InsideDay2 = Ref(High,-1)< Ref(High,-2) AND Ref(Low,-1)> Ref(Low,-2);
Column2 =  InsideDay2;
Column2Name = "Inside Day 2";

Filter = InsideDay1 == 1 AND InsideDay2 == 1;

Buy = Filter;
 
sorry to butt in - here's a possible short term strategy to test. 1min, 10day, 233period MA looking for price crossing the MA. appears to be a few points up for grabs. prob have to change the MA period for all-seshuns data


2598a874f7.gif
 
Hi all

I would like to make the point that a "near enough is good enough" attitude is only acceptable for long term systems.

However, with a short term system like the one we are developing, every aspect of it must be planned and specific because when using leverage you do not have the cushion of time to fall back on.

That is why I'm suggesting that once you have identified a possible trade that meets with all other criteria you confine entry times to the 5th hour of trade.

Cheers
Happytrader

End of Day is best for me, i can't watch the screen all day.

ATR - thanks guys...i feel a bit embarrassed...especially after i just completed Nick's course and he mentions it in the Chandelier stop...:eek:

Good discussion going on!

Cheers,
 
This all seems like fun...

Interesting idea to do it as a group. I've been trying to develop a very similar type of system for the past few months but started out knowing nothing at all. Hence not very far advanced.

The hardest thing i have found is that the smallest changes can have huge impacts, and the results of changes are sometimes very hard to understand. :banghead:

Learnt a lot reading this already so will be watching closely.

Cheers
 
Happy we are talking Short term not day trading or a few days trading.
I agree if your down to these timeframes but you'll need realtime data to test.
I dont think thats whats in mind.

The system will spit out the numbers and missing the first hour of trading for an entry can and often is costly.Swings and roundabouts.

Attempting to perfectly time entry and exits will send you round the twist and its NOT necessary---as you understand system structure and what you achieve by trading one you'll understand.

I think you also presume that longterm system traders like myself dont trade or design shorter term systems.I'm playing with a concept now have been for a few months..

Hi Tech

All time frames including hourly charts are easily and freely available www.bigcharts.com. Tech, what happened to implementing Nicks guidance about defining a period of low volatility to take advantage of the high volatility which occurs in the first hour of trading? Aren't you in fact suggesting doing the opposite? Trying to position yourself in a trade in the first hour is far more risky, stressful and will send you round the twist faster than entering in the last hour. In fact on R0n1n's Entry thread, you suggested not trading the first hour. Missing out is only an emotion not a reason.

I presume nothing about long term system traders such as yourself, but I can spot the difference a mile off. Nothing wrong with either, just different mindsets. Anyways, hows your short term concept coming along?

Canaussieuck there is no need to look at charts all day just afew minutes at key times during the day.

Cheers
Happytrader
 
Thanks for that ASXG.
I had no idea.

Do you know exactly how to do this with amibroker/metastock or would it require some other software?

Amibroker...the entire system, including a hook-in to the back-tester.

http://www.amibroker.com/library/detail.php?id=735

It may not be what those developing this system are looking for. It simply takes the highest low for X periods (or lowest high if short) and calls that the stop/exit. As applied the above code to GOLD future data; winners: average bars held was 60 (12 weeks*) losers: average bars held was 25 (5 weeks*).

* Assuming 5 trading days to a week.

His entire system is based around using support/resistance to define the trend and position entries, exits and stops. Interesting all the same, but as I said, perhaps not useful for what seems to be taking form here.
 
Hi Tech

All time frames including hourly charts are easily and freely available www.bigcharts.com. Tech, what happened to implementing Nicks guidance about defining a period of low volatility to take advantage of the high volatility which occurs in the first hour of trading? Aren't you in fact suggesting doing the opposite? Trying to position yourself in a trade in the first hour is far more risky, stressful and will send you round the twist faster than entering in the last hour. In fact on R0n1n's Entry thread, you suggested not trading the first hour. Missing out is only an emotion not a reason.


Canaussieuck there is no need to look at charts all day just afew minutes at key times during the day.

Cheers
Happytrader

Not for Systems testing I'm afraid.(Downloadable historical Tick or Minute data.)

Have 2 in place currently.One is currently running at 80% on capital over 9 mths and I only trade it periodically---(Running Businesses is time consuming---Particularly in the Construction Industry).
New concept coming along nicely.
Its setting up the softare and computers which is taking the time. Its out of the square.

Does anyone here have intraday data and tesing capability.
If so i'm sure you'll find that (For stocks) time of day entry is not a biggie.
Futures---different.

I presume nothing about long term system traders such as yourself, but I can spot the difference a mile off.

I know what you mean.
I have the same ability in spotting novices.
 
Not for Systems testing I'm afraid.(Downloadable historical Tick or Minute data.)

Have 2 in place currently.One is currently running at 80% on capital over 9 mths and I only trade it periodically---(Running Businesses is time consuming---Particularly in the Construction Industry).
New concept coming along nicely.
Its setting up the softare and computers which is taking the time. Its out of the square.

Does anyone here have intraday data and tesing capability.
If so i'm sure you'll find that (For stocks) time of day entry is not a biggie.
Futures---different.



I know what you mean.
I have the same ability in spotting novices.

Hi Tech

As Nick has said If we are to get more 'bang for bucks' we need to define low volatility to take advantage of high volatility, then of course time of day is most definitely a 'biggie' This is especially so when using leverage and honouring stop losses.

The idea of being specific and implementing the guidance of those that are walking the walk, is to save time, effort and energy. By the looks of past threads on system development, if the process is too drawn out then people lose interest.

Yes I must admit working is time consuming, however, I'm sure if this system is done right we can manage to average a trade a week and be profitable, with minimal observation time and stress.

Canaussieuck, I don't mind helping out with a couple of bluechip stocks to test, however, I would be taking entry prices from the 5th hour of trade to make it more realistic. Maybe you could allocate a couple of stocks to each interested participant? Submitted for your consideration.

Cheers
Happytrader
 
Hi Tech

As Nick has said If we are to get more 'bang for bucks' we need to define low volatility to take advantage of high volatility, then of course time of day is most definitely a 'biggie' This is especially so when using leverage and honouring stop losses.

The idea of being specific and implementing the guidance of those that are walking the walk, is to save time, effort and energy. By the looks of past threads on system development, if the process is too drawn out then people lose interest.

Yes I must admit working is time consuming, however, I'm sure if this system is done right we can manage to average a trade a week and be profitable, with minimal observation time and stress.

Canaussieuck, I don't mind helping out with a couple of bluechip stocks to test, however, I would be taking entry prices from the 5th hour of trade to make it more realistic. Maybe you could allocate a couple of stocks to each interested participant? Submitted for your consideration.

Cheers
Happytrader

Happy, lets just work our way through the system and not get bogged down with when to take a trade etc, what stocks etc., ok? I think once we get to a stage were we can test some thing then you'll have a better idea of where you can fit this into your personal agenda.

Cheers,
 
Happy.

I'd like to test your "Fact".
Do you have any hsirorical tick data that I could use to run tests on.
Ive seen tests done on this before and the results I saw didnt show any benifit in buying later in the day.
But obviously you have evidence and the ability to test the "Fact".

I thought the whole idea here was to design a system EOD so that those who dont have live data can follow/test and possibly use.

If you introduce shorter again time frames then you may as well work off 10,15,30 or 60 min Charts.

Premium Data have what we all need.
I might contact Richard and buy some historical shorter term data for testing.
I'm interested inyour Factual claim.
 
Just to keep things moving I have thrown some initial sample code together that people can have a look at, modify, add to, improve and focus discussion.

Run it as an exploration in AB.

Cheers.

Code:
/* 

ASF Sample System Development

*/

NumColumns = 3;

VolRatio =  StDev(log(C/Ref(C,-1)),5) / StDev(log(C/Ref(C,-1)),99);
Column0 =  VolRatio;
Column0Name = "VolRatio";

InsideDay1 = H < Ref(High,-1) AND Low > Ref(Low,-1);
Column1 =  InsideDay1;
Column1Name = "Inside Day 1";

InsideDay2 = Ref(High,-1)< Ref(High,-2) AND Ref(Low,-1)> Ref(Low,-2);
Column2 =  InsideDay2;
Column2Name = "Inside Day 2";

Filter = InsideDay1 == 1 AND InsideDay2 == 1;

Buy = Filter;

Heres a chart that the exploration picked up, i only ran it for the 31st.
 

Attachments

  • IDOGIF.jpg
    IDOGIF.jpg
    82.2 KB · Views: 114
Top