Australian (ASX) Stock Market Forum

Developing a mechanical system from scratch

Is this the type of entry you're looking for with the system?

Looks like a pennant with three inside candles to me, or do they have to be within the full body.

Or am I in the wrong thread? :confused:

(Not holding)

Kennas.
Theres nothing i love more than a chart posted by you with the stock code NOT erased! :p: ;)
 
Wayne.
Why is account size important?

Is it because of the high drawdown experienced by the really clean-up longterm systems?
No

It's because most of the big outsized advances are in small cap stocks. A smaller account can move into and out of these stocks un-noticed. A large account is going to make these stock move.

For instance if you are stopped out and your million dollar position, your stop order might take out the whole depth. Big accounts just can't trade this way.

They have to trade the megolithic cap stocks.

A band of Guerillas verses the infantry.
 
No

It's because most of the big outsized advances are in small cap stocks. A smaller account can move into and out of these stocks un-noticed. A large account is going to make these stock move.

For instance if you are stopped out and your million dollar position, your stop order might take out the whole depth. Big accounts just can't trade this way.

They have to trade the megolithic cap stocks.

A band of Guerillas verses the infantry.

Yeh but doesnt that mean a small account size is better to start with ? :confused:

Your starting to confuse me, or maybe im confusing myself :confused:
 
Kennas.
Theres nothing i love more than a chart posted by you with the stock code NOT erased! :p: ;)
Ha ha. I know where your going. Non too suttle. Not holding. I should have done that so I had any cred left with you. Sorry! :p:

(I tell you what though, I'll be watching it Mon am! :))
 
Ha ha. I know where your going. Non too suttle. Not holding. I should have done that so I had any cred left with you. Sorry! :p:

(I tell you what though, I'll be watching it Mon am! :))

This ones a bit new to me...are we not supposed to post charts with the codes on them?

Cheers,
 
This ones a bit new to me...are we not supposed to post charts with the codes on them?

Cheers,
LOL. No, that's not the case. I have done it some times so that I am not misread to be a 'ramper', that's all. I think that should probably be the case in this thread as well. We shouldn't be interested in stock codes here, just the chart. :)
 
Not sure he is completed yet

Looking at the thread it would appear that CanOz is still in the developement stage of the system. My guess is that he is close to doing some serious backtesting using various stops either n-bar or percent gain or loss. It also appears that the implementation of risk/reward is still in testing.

I agree that looking at stocks in different time frames may be the key to allowing you to make profitable trades on a short term daily basis this could be accomplished by plotting changes in weekly high and low compaired to monthly high and low and quarterly high and lows. This would give you a good idea on the ebb and flow of the stock over a longer time frame and yet allow you to see how the daily stock is behaving.



above is a thumbnail attachement of showing this in place

Disq
 
Weekly is easier to develop than Daily.
Daily than intraday and intraday easier than daytrading.

With longterm (Months,years) expect higher R/R.
Lower win rates.
higher peak to valley drawdowns.
Less trades.

Personally I'd like to see a shorter term (weeks days)
method attempted which incorporates shorts.

Just get on with the ideas guys test many different entries exits and stops.
Dont get hung up on making decision which are expected to be set in concrete1.

Once you get some NUMBERS all will start to fall into its place.

Nicks suggested 2 setups and a few others have been suggested.

Its NOT about being RIGHT its about being Profitable.

Code something up and I can test it for you.
 
I agree tech/a

You are one hundred percent correct on your point of that the trading system does not have to be right all of the time but it must be profitable in order to make it a viable system for trading. That is where the risk/reward from my previous post comes into play. Also you can backtest a system that is only correct 30% of the time but with proper money management you can have a profitable system. But the one thing that coding will not tell you is what your eyes will when looking at the charts. Using Amibroker I have approximate 7 scans I perform each day on the US market. Some of the stock appear on multiple scans and some only show up on one. Looking at the chart to review the results of the scans is what I use to make the final decision as to purchase the stock or to watch in for a few days. In most cases the stocks that appear on more than one scan will in most cases be one of the ones I will play. There are times when one sitting all by it's lonesome on just one scan result will be the play based on what my eyes on the chart are telling me and not what the coded scan is saying.

Disq
 
Once you get some NUMBERS all will start to fall into its place.


Its NOT about being RIGHT its about being Profitable.

.

Further to this and along Bany's lines of progress, its suggested that before we move on we select an objective function. The objective function will be used to measure the effectiveness of our system in the tests that we run. To me this makes sense as you need to decide what factors are most important to you before you start testing, otherwise what are you trying to achieve by testing?

Can we have some discussion about this?

We want things like:
1.) low drawdown
2.) frequent trades
3.) short holding period
4.) high percent annual gain
etc.

He suggests assigning scores to the criteria in the OF, and then adding up the score to determine the overall success as we move forward through testing.

Here are some quotes

"Choosing the objective function is the most important, and the most personnel, task in designing a trading syste."

and this

"Selection of the OF is a management decision and must be made prior to extensive model development"

For those experienced in designing systems, did you only use the BT report to score the system, or did you focus on a certain number of metrics in the report as Bandy suggests?

Cheers,
 
BTW, heres the backtest report from Les's code....

Lets use this a basis to discussing the metrics we want to improve?

Cheers,
 

Attachments

  • ASFSYSDEVLESM3 - Backtest Report.doc
    64 KB · Views: 52
As you can see from the report, the Max system and trade DD are quite high. I looked at this further and found 1 short and a few longs were giving it a headache.

Like this one...

So generally it is worth looking at these trades further to find out specifically what happened?

Cheers,
 

Attachments

  • crg - short.jpg
    crg - short.jpg
    96.5 KB · Views: 105
Here a long that got stopped out...only a few trades really mucked this up. 0 shorts were profitable.
 

Attachments

  • csr stopped out of long.jpg
    csr stopped out of long.jpg
    93.9 KB · Views: 104
Typical of shorts, we need to take our profits quicker. So we should have a separate stop for the short trades. Any suggestions on how to differentiate the codefor the two differentstops?

Heres the code i'm currently using (i changes the liquidity threshold):

/*

ASF Sample System Development

2 Inside days AND 6/100 Historical Volatility Ratio

*/

// Define system options can modify these as required

SetChartOptions( 2, chartShowDates|chartShowArrows );
SetBarsRequired(10000,10000);
SetTradeDelays( 1, 1, 1, 1);
SetOption( "initialequity", 100000 );
SetOption( "MaxOpenPositions", 10 );
SetOption( "PriceBoundChecking", 1 );
SetOption( "CommissionMode", 1 );
SetOption( "CommissionAmount", 0.1 );

BuyPrice = SellPrice = Open;
ShortPrice = CoverPrice = Open;
PositionSize = -10; // always invest 10% of the current Equity

// Setup Conditions

VolumeCond = EMA(V * C, 21) > 300000; // Ensure at least $300k of money flow for 21 periods
EMABuyCond = EMA(C, 35);
EMAShortCond = EMA(L, 35);

// BuyTrigCond = O > Ref(L,-1); not used in this version

// NR4DAY
// NR4Day = (H - L) < Ref(LLV(H-L,3),-1); // not used in this version

// 6/100 Historical Volatility
HVSixOneHundred = (StDev(log(C/Ref(C,-1)),6)*100*sqrt(256)) / (StDev(log(C/Ref(C,-1)),100)*100*sqrt(256));
HVRatioCond = HVSixOneHundred < 0.5;

// Check if 2 Inside days occur

InsideDay1 = H < Ref(High,-1) AND Low > Ref(Low,-1);
InsideDay2 = Ref(High,-1)< Ref(High,-2) AND Ref(Low,-1)> Ref(Low,-2);
InsideDayCond = InsideDay1 == 1 AND InsideDay2 == 1;

// Long side - buy and sell conditions

// Buy Condition
Buy = Sell = Short = Cover = 0;

BuySig = InsideDayCond AND HVRatioCond AND VolumeCond AND C > EMABuyCond ;

// Sell Condition

// SellSig = condition.......

Buy = BuySig;


//Buy = ExRem(BuySig, SellSig);
//Sell = ExRem(SellSig, BuySig);

// Short side - short and cover conditions

// Short Condition

ShortSig = InsideDayCond AND HVRatioCond AND VolumeCond AND Low < EMAShortCond;

// Cover Condition

// CoverSig = condition .......

Short = ShortSig;

//Short = ExRem(ShortSig, CoverSig);
//Cover = ExRem(CoverSig, ShortSig);

// Define Stoploss Conditions

ApplyStop(stopTypeLoss, stopModePercent, amount = 10 );

// Lists exploration results conforming to our buy/sell OR short/cover criteria

//Filter = Buy OR Sell OR Short OR Cover;

Filter = Buy OR Short;

AddColumn(Buy, "Buy", 1, colorDefault,IIf(Buy,colorGreen,colorDefault));
//AddColumn(Sell, "Sell", 1, colorDefault,IIf(Sell,colorRed,colorDefault));
AddColumn(Short, "Short", 1, colorDefault,IIf(Short,colorGreen,colorDefault));
//AddColumn(Cover, "Cover", 1, colorDefault,IIf(Cover,colorRed,colorDefault));
AddColumn(Open, "Open", 4.3);
AddColumn(Low, "Low", 4.3); //
AddColumn(High, "High", 4.3); //
AddColumn(Close, "Close", 4.3); //
 
Here a long that got stopped out...only a few trades really mucked this up. 0 shorts were profitable.

No problem with this trade.
Looked like it was going to zero on that day.

If one trade mucked up the numbers than its obviously not a robust system.

And drawdown/percent profit is always a tough issue.
Depends on your personality/psychology, timeframe, and how much heat you are willing to take.
 
So generally it is worth looking at these trades further to find out specifically what happened?

Cheers,


I dont think so.
You will always have outliers but like i said in my previous post, they shouldnt affect the result to great degree.

Longterm systems rely on a few great winners a year but for short-term systems with higher trade frequency, outliers should have a lesser impact on the end results.

But Id be keen to hear what Nick or Tech or others have to say about this.

Can, have you got monte carlo analysis?
 
There are some glaring issues.
D/D and string of losses the obvious.
Zero wins in the short method another infact it pulls down figures.
Testing has shown (my own) that simply reversing at a sell signal to a short
isnt profitable in the majority of cases.
If I have time tonight will comment more.
 
I dont think so.
You will always have outliers but like i said in my previous post, they shouldnt affect the result to great degree.

Longterm systems rely on a few great winners a year but for short-term systems with higher trade frequency, outliers should have a lesser impact on the end results.

But Id be keen to hear what Nick or Tech or others have to say about this.

Can, have you got monte carlo analysis?

No, one of the drawbacks of AB. If you look at the report, you'll see that if we fix the exits on the shorts we should see a huge diff.

Cheers,
 
Omg.
I just had a look at the backtest report.
Its disgusting.
LOL seriously.

Firstly only 10.9% winners.
Iv seen some longterm systems with 30-35% winners but 10%??

As tech mentioned, largest string of losses is 49 as opposed to winners with 6.

Impossible to trade psychologically.

R/R = 0.08

And the drawdown stats....
Well, at 82% its.... :banghead:

We got a lot of work to do.
 
Top