Automated Trading Machine (ATM) makes it simple to remove fear and greed from your trading. Automated trading is no longer just for the rich or nerdy. Our revolutionary software runs on your computer, using your trading rules, but none of your emotions. There's just one requirement - you know how to use a mouse. Learn more...
Random Number Between 0 And Max 255
There is a custom indicator called "Special / Miscellaneous". And in that custom indicator family is an indicator called "Random number between 0 and max 255".
What that results in is a line filled with random numbers between 0 (zero) and the upper limit you specify. The upper limit can be anything from 1 to 255 (actually you can enter a bigger number, but even if you do so 255 is used).
How is this useful?
Sometimes people like to test the results of their trading system against the results obtained by chance. Along the lines of "are all my fancy rules giving any better result than tossing a coin?"
So after creating your fancy trading system, copy it, delete all entry rules, and replace with one involving this random number. Test the results.
Only whole numbers are used, no decimal points. So a random number between 0 and 1 means that the result will either be 0 or it will be 1. There are only 2 possible results. It's 50-50 as to which will come up, chosen randomly by the computer. So this is just like tossing a coin. Create an entry rule that says only enter when the random number equals 1. And that would give a trading signal, on average, every second bar.
Similarly, a random number between 0 and 5 would be like rolling a dice (as there are 6 possible results - 0, 1, 2, 3, 4, 5).
But normally trading signals aren't given every 2 or 6 bars. If you have tested your original system, you can work out roughly how often it gives trading signals. And then set the upper limit on this random generator to something similar. If you want to do this kind of comparison, you have to be comparing apples with apples.
Just remember that 0 (zero) is always going to be one of the possible results, so if you want a signal approximately every 20 bars then enter an upper limit of 19.
- Login to post comments
Recent blog posts
- New Release: v3.0.3 - Everything Except Autotrading
- Mid July 2010 Update
- Start of June 2010 Update
- New Release: v3.0.2 - Copy, better error message, more options
- New Release: v3.0.1 - The Stabilise-ening
- Ah, The First Bug [Fixed in v3.0.1]
- New Release: v3.0.0 - The Rewrite
- Start of February 2010 Update
- End Of 2009 Update
- New Release: v2.0.10

Recent comments
35 weeks 2 days ago
50 weeks 3 days ago
1 year 4 weeks ago
1 year 4 weeks ago
1 year 10 weeks ago
1 year 11 weeks ago
1 year 18 weeks ago
1 year 18 weeks ago
1 year 21 weeks ago
1 year 26 weeks ago