Multiple strategies in one strategy.

Forums ProRealTime English forum ProOrder support Multiple strategies in one strategy.

Viewing 15 posts - 1 through 15 (of 28 total)
  • #68931

    I while back I started a thread asking if anyone ran multiple variations of the same strategy on the same instrument but with different variable settings so as to cover a broad range of settings that have worked in the past. The idea being not to put all your eggs on one setting.

    https://www.prorealcode.com/topic/running-multiple-variations-of-the-same-strategy/

    I just wrote a strategy with just one variable and it worked quite well in backtest with a period setting anywhere from 2 to 10. So I decided that rather than pick one setting for that variable I would check in the code all of them and if any of them met the buy or sell requirements it would place a trade. I then added a switch so that you can increase the positions size dependent on how many of the variable settings meet the entry criteria or just have level staking. I thought I’d share the code here (not the whole strategy just the multiple entry criteria being met bit of it) just in case anyone else was interested in the idea for their own strategies.

    Maybe another one for your snippet library GraHal?

     

    1 user thanked author for this post.
    #68936
    #68938

    if anyone ran multiple variations of the same strategy on the same instrument but with different variable settings

    Yes I do often, but then I move on and don’t follow through to refine down the best System.

    I have a System running currently on Demo with 6 variations (some with added variables, e.g. volume) the v6.0 gave biggest gain by far in backtest, but up to now the v1.0 (least complex) is in the lead! I guess my System with different variables does not fit in with your criteria  for different variable settings, but thought I’d mention it! 🙂

    I will add your snippet Vonasi. Keep em coming and I’ll be up to 21 in no time at all! 🙂 There are 3 users in the database (link below) right now so it is increasing in popularity!

    @robertogozzi your link comes up as 404 Not Found.

    https://docs.google.com/spreadsheets/d/1rgboqj7sVwsP9ZRhOduOefye48QMWC07jWVXCl-KJPU/edit?usp=sharing

     

    #68939

    Thanks for that robertogozzi. For some reason the link does not work for me but I found it here thanks to Google:

    https://www.prorealcode.com/topic/multiple-strategies-within-one-trading-system/#post-41278

    It is always good to link similar ideas in the same place for others to find.

    Your idea is to have different strategies that an overall strategy that opens one or multiple positions depending on what set of entry criteria are hit and your code stops  any more positions being traded at the same time until there are no positions – then it starts hunting for a position to open again. It would open several positions with buy or sell orders and then leave only the last strategy that opened a position to control the closing of them? As it will prioritise the last strategy over all the others you would have to put your worst strategy first and your best last in the list.

    My idea was more about selecting an exact entry variable. If a period of anywhere between 2 and 10 has produced profitable results for twenty years but some years 1 is better than 10 and other 5 is the best setting for that variable then why not use them all and play the averages. Some would say that you should re-optimize every so often and use the last number that worked but I do not like this idea because just because it just worked does not mean that it will tomorrow. What if you just happen to re-optimize on the day of a market shift and 5 used to work but from today onwards 8 is the number to set your average period to?

     

    1 user thanked author for this post.
    #68940

    I don’t know why the link doesn’t work!

    #68941

    GraHal you are doing what I have suggested as a good way to play the averages. If you have six systems that are basically the same but use six different sets of variables and all have passed backtesting with varying levels of profit then use them all – as long as they are all in a working range (i.e 2,3,4,5,6,7,8, and not 2,5,10,40). Some may win, some may lose but that is better than if you had picked just one and it turned out that it was the biggest loser going forward. The biggest limit to testing this theory out is the 25 demo strategy limit in PRT and in real life your bank account. If all six strategies are running independently it could be expensive which is why I developed my idea. All six can decide to open a position but you only open one position if PosSizeIncrease is set to zero.

    It would not be too difficult to develop it further to use multiple ranges of different variables for different indicators although the more variables and the more indicators the more curve fitted so at the moment I am sticking to one.

    Here is the the equity curve for my test strategy (weekly time frame) with an average period of an indicator set to open positions anywhere from 2 to 9. Unfortunately the number of trades is quite low and the drawdown more than I can stomach but it is a nice final result.

    Screenshot_1-5

    1 user thanked author for this post.
    #68944

    I don’t know why the link doesn’t work!

    It is not just you mine doesn’t either……. Nicolas!

    #71715

    Hi Vonassi,

    Thanks for your share.
    Below a piece of code which allows to use parameters which are non consecutive

     

    1 user thanked author for this post.
    #71716

    I’ve added above to Snippet Library @ Row 32

    Snippet Link Library

     

    1 user thanked author for this post.
    #71720

    Thanks GraHal !

    One more point: I’ve observed that sometimes (quite often), when 2 different (but close variable Cases) are triggered an order at the same time or nearly (up to 2 bars), results are improved. Most probably because the current trend seems cleaner…

    So have you an idea to imagine what piece of code will ONLY place an order when AT LEAST 2 cases are filled (without using a duplication of the all long conditions since only a few parameters are changing) ?
    Thanks a lot in advance

    #71721

    You could use a SUMMATION:

     

    2 users thanked author for this post.
    #150106

    I am trying to implement this but struggling to figure out how to do it.

    If one wanted to try different box sizes, let’s say with the ‘pure Renko’ strategy, how would you add this code to use several different box sizes in one strategy?

    Thanks in advance.

     

    #150107

    How about duplicate the strategy several times and have a different > box size for each strategy??

    #150113

    I have tried a different method in one code, but it’s not beautiful – a lot of copy and paste and I’m not sure it’s the best way. I was curious about the method Vonasi mentioned here. It would be easier to analyse the results if it was all in one strategy also.

    #150122

    easier to analyse the results i

    You could have different position size (0.2, 0.3, 0.4 etc) that relate to the different box size.

    Then factor them up /down to position size = 1 for a direct comparison / analysis in Excel?

    Just thoughts off top of my head 🙂

    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 28 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login