Random entry systems

tomorton

Legendary member
7,734 1,101
I can't see random entries working - i.e. random direction at a random time on a random day.

But what about an entry at every close on an index, in line with the prevailing trend, and a stop-loss at 1 x ATR. Entering with trend is always likely to profit from a continuation of trend: and a close stop-loss would deal with the occasional entry that happens to coincide with a reversal or retracement. Over time that would tend to give considerable asymmetry on the side of the winners.

Who'd like to back-test this? (I have to do all that sort of thing manually)
 

Adamus

Experienced member
1,898 97
I'll back test it but first I want to create a backtest that will test just the exits, using random entries.

I can do what LBR does in that link BSD posted - fix up a random entry mechanism for a backtest of my current favourite exit method.

I'll run it on 1 hour bars or 2 hour bars over 10 years repeatedly, 100 times. I've set up NinjaTrader to export all the trade results into a .csv file which I can open in excel and get the total results from.

So at the moment on GBP/USD I'll use 1 hour bars. I'll make the entry method using a random number generator for any number between 1 and 50 and I'll enter the trade that many bars after the last exit, in the opposite direction.

So the system will go long, short, long, short with 1 to 50 bars between trades. On average I should get 1 trade per day, so over 10 years that's 2200 trades, multiplied by 100, is 22,000 trades.

Actually maybe that's a bit too much work (clicking 'backtest' 100 times and sitting there waiting) so maybe 25 times will do.

That'd be testing the exit mechanism 5,000 times or so.

Won't that give me a representative sample of how the exit mechanism works and what I should expect?

If it's optimizable, perhaps I should optimize it against the random entries rather than the entry method I'm planning on using.

Then a timed entry method like yours tomorton.
 

bangkoker

Well-known member
314 17
I'll back test it but first I want to create a backtest that will test just the exits, using random entries.

I can do what LBR does in that link BSD posted - fix up a random entry mechanism for a backtest of my current favourite exit method.

I'll run it on 1 hour bars or 2 hour bars over 10 years repeatedly, 100 times. I've set up NinjaTrader to export all the trade results into a .csv file which I can open in excel and get the total results from.

So at the moment on GBP/USD I'll use 1 hour bars. I'll make the entry method using a random number generator for any number between 1 and 50 and I'll enter the trade that many bars after the last exit, in the opposite direction.

So the system will go long, short, long, short with 1 to 50 bars between trades. On average I should get 1 trade per day, so over 10 years that's 2200 trades, multiplied by 100, is 22,000 trades.

Actually maybe that's a bit too much work (clicking 'backtest' 100 times and sitting there waiting) so maybe 25 times will do.

That'd be testing the exit mechanism 5,000 times or so.

Won't that give me a representative sample of how the exit mechanism works and what I should expect?

If it's optimizable, perhaps I should optimize it against the random entries rather than the entry method I'm planning on using.

Then a timed entry method like yours tomorton.
Sounds interesting
 

meanreversion

Senior member
3,398 535
MR, I meant percentage profitable trades only for entries with equidistant stops and targets without slippage or commission - surely percentage profitable trades is the only statistic that is relevant in that situation?

As for exits, I don't see why LBR's approach won't work. Random entries tested over 100 runs of the backtest. That would create a huge sample size. I guess that is what I would go with, but it's really not so easy to collate the results of 100 backtests into one result set compared to all the normal backtesting, optimization or walk-forward methods that NinjaTrader for example offers.

Just doing one backtest on an exit mechanism with random entries would just not give you a representative sample, would it?
Oh sorry, yes I see what you're saying.

As far as my random system goes, it enters randomly on a given date in the direction of the trend (e.g. if heads, buy, if tails, do nothing). Once in the trade, it runs the position with a trailing stop. Once it gets stopped out, it goes back to randomly choosing whether to enter or not.

If your system randomly enters then has 1:1 profit/loss ratio, I can't see that will return anything other than flat p/l unless you include a trend filter.
 

Adamus

Experienced member
1,898 97
If your system randomly enters then has 1:1 profit/loss ratio, I can't see that will return anything other than flat p/l unless you include a trend filter.
We must be getting our lines crossed again. A random entry mechanism without any trend filter should be made profitable (before transaction costs at least) by a decent exit mechanism. Do you disagree?
 

Adamus

Experienced member
1,898 97
Actually doing a compilation of several runs with random entries makes it impossible to measure drawdown, or better said, a real cludge. Not sure if it's worth considering, but one of the functions of the exit mechanism should be to reduce drawdowns. Difficult.
 

jakesullivan

Newbie
2 0
Thank you guys for the experience. Will try everything. Where are you taking all this info about forex? Is it really as good, as you say? I'm sorry for a lot of questions. I'm rather new in all this stuff and won't mind to hear some good hints about subj. I have already collect some. (if you interested, you can look it - in my signature - I'm not greedy man :))
 

Adamus

Experienced member
1,898 97
I think I'm becoming a grumpy old man and I'm not even fifty yet - but doesn't anyone else find that post above slightly irritating?

Anyway just thought I'd report on all the CPU cycles I've been burning up with my random-entry test for exit mechanisms.

Firstly the results from one test to the next vary a lot more than I thought, despite covering 10,000 trades per test.

For instance the dollars per trade can vary from -$15 to -$30 per trade.

The hit rate / %profitable is more stable, as is the drawdown.

So I have to run the test about 5 times to get a good idea of what results it produces.
 

lbranjord

Well-known member
453 15
Isn't Jake Sullivan the name of the marine in Avatar? Probably to enhance clickbank numbers or something. Anyway, once I clicked an add about a trading system and got a 3 trojan viruses. It didn't even look like an advertisement. How stupid I am sometimes.
 
AdBlock Detected

We get it, advertisements are annoying!

But it's thanks to our sponsors that access to Trade2Win remains free for all. By viewing our ads you help us pay our bills, so please support the site and disable your AdBlocker.

I've Disabled AdBlock