Moving Average Crossover Example – How to order orders?

I've been working on building out my own trading infrastructure and to test the basic functionality of the backtesting portion, I've written a basic short term MAC (10 and 30 day). The universe I'm using has been cherry picked so every result is excellent, but the part I've concerns about is when using this strategy across multiple securities, how should the orders be ordered?

What I mean to say is, if the universe input is shuffled, the backtesting results are different because every order (buy or sell) has an impact on the account value, so the trade history varies according to the universe input. Some larger trades may take place before smaller or vice versa. I'm wondering what others have done to a handle such a situation and to show I'm not here to simply consume, I've developed something that seems to work that I'd like to share.

I've used the Chebyshev inequality, commonly used to very roughly approximate bounds of a distribution, to determine the probability of a security moving up 5%. Ordering the securities by this in descending order i.e. largest probability first, the variation between backtests where the universe input order is shuffled no longer impacts the backtesting results.

Submitted November 07, 2020 at 09:01PM by PLxFTW
via https://ift.tt/2U3kiuO

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s