Profile Picture

Running Multiple Trading Systems

Posted By peteyjones 3 Years Ago
Posted Tuesday April 21 2015
Hi guys,
I'm a bit green with programming in Right Edge and in general, but I was wondering if anyone can help me out.
I have been racking my brain trying to find a solution to what I imagine to be a somewhat easy problem for most.

What I Have
I have a moving average crossover system that goes both long and short that also has fixed fractional position sizing coded in as a parameter that can be changed.
The fixed fractional position sizer is based on an ATR. A pretty standard trend-following system.

My Problem
My problem is that I am trying to run multiple, or rather just two instances of it at the same time.
 I have downloaded the "MultipleSystems" that has been uploaded and had a look through the code to see how I can create my own but I am stuck.
Again, I apologize as I am a novice on C# programming and getting the logic right. 

What I'm Trying to Do
Firstly, I would just like to run my TF system on the same set of symbols but on two (2) timeframes, i.e. have one system run as 'medium-term' and the other 'short-term'.
I'm having trouble using the example from Multiple Systems to create a top level system that just has my 2 TF systems in it.
It is unclear to me how the top-level strategy allocates to the 2, whether it does it evenly or if it is able to be programmed to change between the two.

Any assistance at all would be greatly appreciated as I have certainly hit a wall. 

Posted Wednesday April 22 2015

Take a look at the MultipleFrequencyLogic sample to see how to run the same trading logic with different frequencies.  Overall it's a similar concept to how the MultipleSystems sample works.

For asset allocation, you probably want to calculate the position size in code for each strategy.  The basic idea is to have a percentage allocation for each strategy, multiply that percentage by the account value (SystemData.AccountValue) whenever you open a position, and use the result as the total account value allocated to the strategy to feed into the ATR-based position sizer.

Using this method, profits or losses from one strategy will be shared among all the strategies.  If you don't want this, then each strategy can start with a certain amount of capital to trade, and you can add the PnL value for each trade the strategy makes to that amount.

Hopefully this helps a bit.  Feel free to ask more questions, and if you're willing to post the code you're working with I can probably offer better help.


Similar Topics

Reading This Topic

2005-2018 © RightEdge Systems