Australian (ASX) Stock Market Forum

TradeSim

Hi rnr.

As for the MS coding.
I wrote exactly what it on pg.115 of the TradeSim manual.

ExtFml( "TradeSim.SetVariableTradeRank",ATR(10));

Under the call to initialise function.

Then under TradeSim global preferences I specified it to Rank from highest to lowest, this giving preference to trades where the ATR is the highest.

So now the trade database is first sorted by date, and then by volatility, with the most volatile stocks (measured by ATR) given a higher rank.

If you want to Rank from lowest to highest, then you can just choose this option under TradeSim global preferences.

I hope it helps, though i probably made a mistake somewhere in there!

Regards,
Nizar.

Hi Nizar,

Thanks for the heads-up on that.
It's the text in bold where I was having a problem.

Regards,
rnr
 
Ranking by price (lower priced first) gives a substantial boost and conclusive results that proves that this method is likely to generate returns to the higher end of the monte carlo results.

....

Nizar,

Out of interest do you also use price as one of your entry condition filters?

eg. Only selecting stocks which are trading up to a certain price level?

Just curious....
 
I think the answer lies Nizar in where your entry sits relative to the life of the chart.

What Ive found with T/T is those stocks which have their initial buy which coincides with a point in the chart which lends itself to a longer term move end up more profitable than those which are (at the point of the initial buy) getting near the end of a longer term move.

See buy triggers can and do come at various points in the life of a stock.
Sure we can attempt to code these filters,but in the end Ive found I cant code intuition.That ability of the brain to look at a chart and have that feel of opportunity.Just as you can have that feel of pending or continuing disaster.

Thats why I like to "eyeball" my potential buys triggered from a system.
Ive had 4 or more and not taken any.

Many would say I'm adding a discretionary component to the system.
I disagree,here is why.

My testing particularly Monte carlogives me a range which I can expect my system to perform.REGARDLESS of which stocks I choose I can expect the results to fall in there somewhere.
Quite possibly my intuition plays no part in the performance of my trading,it could just be luck.To me it doesnt matter,if Im happy with the lowest end of the scale in the returns of my system then I'm happy to be deluded or accept the luck that comes my way,as I can expect at least the lowest end---anything better is a bonus.

Tech/a,

Have you quantified the benefit yielded through your eye-ball filters?
Its outperformed the average portfolio returned from Monte Carlo, to what degree?

Was this performance due to increased win% or average win size? I expect the former. I recall the T/T method had a hit rate of about 35%. The Eyeball filters increased this to how much i wonder.

If you dont have the figures thats okay, but stator can spit them out quite easily, but i suspect you no longer trade that method, why would you when your other systems have R/R of 8-12+ !!
 
Thats why I like to "eyeball" my potential buys triggered from a system.
Ive had 4 or more and not taken any.

Many would say I'm adding a discretionary component to the system.
I disagree,here is why.

My testing particularly Monte carlogives me a range which I can expect my system to perform.REGARDLESS of which stocks I choose I can expect the results to fall in there somewhere.

After thinking more about this you can include me within the many that say you are adding a discretionary component.

Bold and in red is something that has not and cannot be backtested with TradeSim.

When there is available trading capital, TradeSim always takes the trade. Say for example, Maybe there are 10 candidates and only capital for 2 trades. Monte Carlo analysis will tell you the variation if you picked the 2 best trades or the 2 worst trades and all the combinations and permutations in between.

But in such a scenario, TradeSim will NEVER not take any trade, as you have done.

So you have no reason to believe that your results will fall within the monte carlo testing.

Yes its true that your system like many others have more buy signals than trading capital, ie. you cant take all trades that are signalled.

But if you want to expect results similar to what was tested then you have to trade exactly the way TradeSim trades. From my understanding, having 4 signals and not taking any is deviating from the system. Discretion cannot/shouldnt be applied here. Having 14 signals, and capital for 2 trades, you could pick any 2 you want. This is where discretion is allowed and has been factored in to the system via monte carlo simulations.

What you have been doing, if I understand correctly, is deviating from the system from which the BluePrint was made from, and thus, playing with fire. But i guess its worked for you ;)

Nizar.
 
Well I disagree.

No different to being fully capitalised.
The underlying reason why the method works is still intact.
The eyeballing doest alter the method of selection IE the conditions or variables.
They are simply 2 things.
They (The selections)
(1) Cannot be in a tight trading range which has lasted years.
(2) Must be in a trend or clearly seen as breaking out of a prolonged downtrend or range as seen in (1)
I eventually become fully capitalised.

I wont argue who is more correct,It gives me a degree of comfort maybe it is false.
 
Nizar
Ive had 4 or more and not taken any.

In terms of testing not taking some trades it is possible to simulate using a random trigger in the buy signal. I can't remember what it is in MS but in AB something like " and random() > 0.5;" would do it.

The chart below (hopefully) give some idea of the impact of randomly ignoring trades - otherwise it's on my blog - search for it using "random".

Ttrades+not+taken.png


Monte Carlo only give a range in which a system will perform if market conditions remain similar. I would think that the performance could easily move outside of the tested range if market conditions change. It doesn't mean that the system is not working, just that it's performance is obviously highly correlated to future market conditions.

stevo
 
Nizar


In terms of testing not taking some trades it is possible to simulate using a random trigger in the buy signal. I can't remember what it is in MS but in AB something like " and random() > 0.5;" would do it.

The chart below (hopefully) give some idea of the impact of randomly ignoring trades - otherwise it's on my blog - search for it using "random".

Ttrades+not+taken.png


Monte Carlo only give a range in which a system will perform if market conditions remain similar. I would think that the performance could easily move outside of the tested range if market conditions change. It doesn't mean that the system is not working, just that it's performance is obviously highly correlated to future market conditions.

stevo

I had a look at that post in your blog.
Interesting stuff.
Seems like you've thought of everything.

So you add Random entry as an extra component into the entry trigger?
 
So you add Random entry as an extra component into the entry trigger?

Yes - although only when testing!

In Amibroker I could use an optimise to alter the chance of taking a trade from 100% to 10%. I did 10 simulations to see if there was much variation from different runs and got the chart.

Not surprisingly the profitability of a system tested drops as the number of trades taken decreases. I would also expect that a system with a lot of signals would drop slower than a system that gives only a few signals. If the system lost money in the first place then it is possible that profitability might increase if less trades are taken!

Sometimes I force myself to take a trade because I know more opportunities means potentially more profit. I am sure that I have taken a trade that my gut did not like, or the chart didn't "look good" and have made substantial money on it - 100% plus. The downside can only go to nothing as a worst case.

stevo
 
Yes - although only when testing!

In Amibroker I could use an optimise to alter the chance of taking a trade from 100% to 10%. I did 10 simulations to see if there was much variation from different runs and got the chart.

Not surprisingly the profitability of a system tested drops as the number of trades taken decreases. I would also expect that a system with a lot of signals would drop slower than a system that gives only a few signals. If the system lost money in the first place then it is possible that profitability might increase if less trades are taken!

Sometimes I force myself to take a trade because I know more opportunities means potentially more profit. I am sure that I have taken a trade that my gut did not like, or the chart didn't "look good" and have made substantial money on it - 100% plus. The downside can only go to nothing as a worst case.

stevo

Thanks Stevo.

I do like that chart. Just to put those results into perspective, how many trades does that weekly system take per year on average?

I'm not going to code for this only because I will never (intentionally) skip a trade because I don't like the chart. I feel I have enough discretion and flexibility built into the system as it is. But still it would be an interesting excercise. Maybe later when I have some time.

Its not unusual to hear that the stocks that didn't pass the eyeball test actually do fly. Somebody on another board said that he eyeballs charts for stock selection and has been underperforming tradeSim, and tradeSim (by default) trades alphabetically!

I think what I will do is keep track of those stocks that I exclude through eyeballing. Over a large number of trades, if these ones consistently outperform the stocks that I do actually trade then in the future I won't eyeball at all, rather just sort every candidate by price and go from there.
 
Hi,

If I have this line in my code:

ExtFml( "Tradesim.EnableProtectiveStop",1);

Does this mean that if i enter some positions on this bar, then theres no need to check for an exit on the CLOSE of the same bar, rather I wait for the next bar??

Because I tried changing the number 1 to 0 and running the simulation again, and results are exactly the same.

I suspect this is because I have this line in my code:

ExtFml("Tradesim.EnableDelayOfAllExitsByOneBar");

Yeh?

Thanks.

Nizar.
 
I think the answer lies Nizar in where your entry sits relative to the life of the chart.

Tech.

COA may be of interest to you.
Threatening to break the top of its trading range after more than a year of consolidation.
Big volume last week as well.
Triggered a buy for me last week for the first time in 18 months.
 
Somebody on another board said that he eyeballs charts for stock selection and has been underperforming tradeSim, and tradeSim (by default) trades alphabetically!

Could it be possible that when testing a system through Tradesim if your:

1. Running "Single Simulations".
2. Adjusting parameters to make results better on "Single Simulations".
3. Finally a Monte Carlo.

Performing a #2 is curve fitting to trades alphabetically (if no Ranking) so #1 may well be at the higher side of a Monte Carlo run.

SB
 
Well I disagree.

No different to being fully capitalised.
The underlying reason why the method works is still intact.
The eyeballing doest alter the method of selection IE the conditions or variables.
They are simply 2 things.
They (The selections)
(1) Cannot be in a tight trading range which has lasted years.
(2) Must be in a trend or clearly seen as breaking out of a prolonged downtrend or range as seen in (1)
I eventually become fully capitalised.

I wont argue who is more correct,It gives me a degree of comfort maybe it is false.

Well I must apologise for my ignorance.
As usual, you are correct.

I ran a few tests yesterday and today and for systems that only trade a fraction of possible trades (like T/T and my system), profitability isn't significantly affected to any extent if you randomly ignore some signals, even say, half of them (at least for mine this was the case).

What I failed to understand before this was that it doesn't really make a difference if you don't take a trade due to capital restraints or if you don't like the chart. Either way you're not taking the trade.
 
Thats the way I saw it Nizar.
Hadn't tested it though so I wasnt kidding when I said my comfort may well be false.
 
Just wondering how TradeSim handles takeovers?

I'm feeding Premium data into it, and this data is clean.

Regardless; if a company was taken over by another for cash, and the stock subsequently delisted, if an exit wasn't triggered then i suspect TradeSim still hold the stock at its last traded price?

BUT how about if a company is bought by another company for Script?
Premium data would adjust for this I suspect but how about TradeSim?

Any thoughts would be much appreciated.

Nizar.
 
Nizar
If you are testing on the current All Ords stocks, or some other index, then the defunct stock shouldn't be in the universe of stocks being tested.

If I do a test on all "clean" stocks (all 3 character stocks over a certain turnover limit) I get, using AB, an exit on the last bar that the stock traded. So in the TradeSim database that I generate using Amibroker I get an exit for CPC in the week ending 22/12/2005. I have no idea what happened to CPC.

AZR might be another one that disappeared in Jan 2007, although I didn't hold it. Also RCD, SFE, TAB. I don't really remember old trades and struggle to remember takeovers. My memory is not what it used to be, it's just another trade.

I am not sure how Metastock handles these, probably the same way.

I think you asked how many trades my system would take in a year. Since January 2003 I have taken over 150 trades, with some still open. So around 30 trades round turn a year actual trades a year.

stevo
 
Nizar
If you are testing on the current All Ords stocks, or some other index, then the defunct stock shouldn't be in the universe of stocks being tested.

If I do a test on all "clean" stocks (all 3 character stocks over a certain turnover limit) I get, using AB, an exit on the last bar that the stock traded. So in the TradeSim database that I generate using Amibroker I get an exit for CPC in the week ending 22/12/2005. I have no idea what happened to CPC.

AZR might be another one that disappeared in Jan 2007, although I didn't hold it. Also RCD, SFE, TAB. I don't really remember old trades and struggle to remember takeovers. My memory is not what it used to be, it's just another trade.

I am not sure how Metastock handles these, probably the same way.

I think you asked how many trades my system would take in a year. Since January 2003 I have taken over 150 trades, with some still open. So around 30 trades round turn a year actual trades a year.

stevo

Stevo.

I asked David about this and he said that if a stock was merged with another or taken over OR delisted due to any reason -- Then, it would appear in the TradeSim trade database as an open trade and the price would be from when it was last traded.
 
Stevo.

I asked David about this and he said that if a stock was merged with another or taken over OR delisted due to any reason -- Then, it would appear in the TradeSim trade database as an open trade and the price would be from when it was last traded.

Just a clarification.

The trade will be CLOSED on the last bar it traded but marked as open trade in the trade database (to differentiate from those trades that have been closed due to protective stops or exit triggers).
 
Top