Universal Strategy

Universal Strategy

If you have followed the thread found here: https://www.prorealcode.com/topic/profitable-strategy-that-work-on-any-market/

You will be aware that I have placed a challenge to the forum to create a universal market neutral strategy. In other words a strategy that can be adapted to any market without ANY optimization. Below is my attempt at exactly this. I have opted to add a trading time filter as all markets have their sweet spot.

No variables have to be optimized for this strategy to work other than the trading time and spread. Attached is 2 screenshots of the same code executed on 2 different markets (same 1Hr timeframe but different spreads) where in both instances the code has significantly outperformed Buy and Hold. Spread on CAC40 set to 3 and spread on ZAF40 set to 20.

Note that this strategy was not meant to be a jaw dropper in terms of performance but rather a proof of concept that a single strategy can be applied to different markets with positive results. Obviously optimizing this strategy to individual markets will yield better results but that was never the idea. Hopefully the whole ProRealCode community can benefit from this (and even improve on it).

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Nicolas • 16 days ago #

    Thanks for this interesting concept. I successfully test the strategy on DAX and Bund (same kind of results as your other tests on SAF40 and CAC40), but I’m not able to get relevant backtests on other timeframes than 1 hour, and because you stated that this trading strategy is “non timeframe dependent”, that’s why I’m talking about it. Good job!

  2. juanj • 16 days ago #

    I just want to expand a bit on the mechanics of how this strategy should theoretically perform in both ranging and trending markets. The idea is that in a ranging market you would likely see Bollinger reversals between the bands whereas in a trending market you would see a successful Bollinger breakout. This strategy aims to take advantage of both. Then also just to be fair (in answering Nicolas’s question above) although I mentioned the strategy to be timeframe independent, it would more accurate to just call it market neutral. The above set of ‘static’ variables is more suited to a specific timeframe. For lower timeframes such as the 5min chart, a smaller MA such as 50 would likely be ‘more’ suited along with an ATR[1] period. However once configured for an timeframe, it should be compatible between different markets on that timeframe.

  3. juanj • 16 days ago #

    @nicolas it would be interesting to see the 200k bar backtests of the CAC40 and SAF40, if you can post them? Would also be interesting to see if another trading time-frame is maybe better suited back then? I also think that maybe we can look into adding a different stop mechanism, maybe something like your trailing stop? The idea is for the PRC COMMUNITY to build onto this to get it to perform even better and more consistently on all markets.

  4. juanj • 16 days ago #

    I have made a minor modification to the Exit criteria and the result is looking very promising (check the EUR/USD 1Hr with spread of 0.8) for example.

  5. juanj • 16 days ago #

    If longonmarket and ((close[2] > BollU and close[1] > BollU and close < BollU) or (high[2] > BollU and high[1] > BollU and high < BollU)) Then LE = 1 ElsIf shortonmarket and ((close[2] < BollL and close[1] < BollL and close > BollL) or (low[2] < BollL and low[1] < BollL and Low > BollL)) Then
    SE = 1
    EndIf

    If ((close < close[1] - ATR) or (LE = 1)) and RS2 > 95 Then
    Sell at market
    ElsIf ((close > close[1] + ATR) or (SE = 1)) and RS2 < 5 Then Exitshort at market EndIf

  6. juanj • 16 days ago #

    For above modification also add to the entry criteria to initialize the values;

    ‘LE = 0’ below every ‘Buy possize contract at market’
    ‘SE = 0’ below every ‘Sellshort possize contract at market’

  7. juanj • 16 days ago #

    @Nicolas I see it also significantly brings down the drawdown on the CAC40.

    Btw why is the Add PRT Code function not working on here? Also cannot attach screenshots, there are some very sexy curves on for instance the EUR/USD that need some showing off.

  8. juanj • 14 days ago #

    To follow new developments or get the latest version of this strategy please visit the forum:
    https://www.prorealcode.com/topic/profitable-strategy-that-work-on-any-market/

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar
Related users ' posts
JohnScher So, and now who would write the code ?
sreenivas Hi all , i am newbie here, the above bollinger moz indicator for which platform , is it not ...
Nicolas This website is dedicated to prorealtime trading platform programming.
SimoneDasGupta Nice job! It makes good results also on DOW JONES Weekely and on DAX Daily, but also with t...
SimoneDasGupta // short position ca1s = close < average[100](close) ca2s = average[20](close) < average[2...
Doctrading Excellent, thanks SimoneDasGupta !
Wilko Thank you all for your comments! I treat shorting very separately from the long side, at lea...
gabri Wilko,  great code!! I never worked with RSI2 and I found it very interesting. I made some ...
Wilko I'm happy my code snippet inspired some new thoughts! Thanks for the feedback!
gabri GraHaL, I cannot see any link attached. I mostly manual trade but for stocks with strong fi...
GraHal Yes sorry, I set up a link to a screen shot on my google drive and then I got locked into th...
gabri Here's the thread https://www.prorealcode.com/topic/multiframe-rsi-of-rsi/
CKW Thanks Pier! Excellent! I add the SL capped at 0.8% for safety purpose. The Backtest perfor...
JR1976 Dear Pier ,  your screenshot which rappresent the backtest , is since dec 2009 , but the eq...
CKW Dear Pier, Does it work on forex?
Stefanb Wing Can i find you on Twitter?
Toto le Heros Hi Wing, Your code looks quite interresting. I was wondering if you could develop a bit mo...
Pietro Fontana Hi Wings, i did not found a forum thread for this interesting system so i post my comment he...
Magnus Park Hi! Thanks for sharing! Have the code been swapped to the new one? or is it the first one st...
corne Hi there - is there maybe somewhere a new version available to look at?
Henrik Eriksson Viklund *Bump* Have the code been swapped to the new one?
Francesco78 Hi Prince Myshkin I was interested that you chose a 3 day (72hr) period for your ATR calc. ...
CKW Thanks Francesco for sharing. Equity curve in overall looks great and testing it on demo :)...
Francesco78 Hi CKW thanks for your comment and for spending time on the steategies. The framework is ver...
Nicolas Thanks for sharing your automated trading strategy idea. Even if you accumulate loosing orde...
Maz Ok. Potential here to build onto this. Have opened a forum thread for further discussion: h...
ALE
3 months ago
CSR strategy DAX 1 D
CSR strategy DAX 1 D
13
Strategies
Nicolas The code has been updated in the attachment of the post with the last version which contain ...
ALE Thanks as always Nicolas
Toto le Heros It looks very interresting. I have one question related to the following result in ProbackTe...
Maz
3 months ago
Francesco78 very nice, thanks!
finplus Thanks for the job. Which variables do you suggest for timeframe 1 hour? 
Maz Depends massively on your market and the volatility. I suggest using the variable optimizer ...
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...
Nicolas An answer to a query that has been posted in the squeeze indicator: https://www.prorealcode....
Nicolas ok, so your query should be asked there: https://www.prorealcode.com/prorealtime-market-scre...
Nicolas answered here: https://www.prorealcode.com/prorealtime-market-screeners/ttm-squeeze-fired-sc...
mcha Bonsoir Nicolas, Merci beaucoup pour ce complément de code, qui fait disparaitre l'histogr...
Francesco78 Hi Juan Salas and thank you very much for your undeserved compliments. I'm not sure if I un...
Juan Salas Hi Francesco, Yes, this is pretty much the question. The system ask me a number of contract...
Francesco78 ok sounds good, you can put min size = 1 and go for the seasonable breakout too, also you ca...
rafa How can we have this on overbought? Thanks in advanced
Nicolas All conditions under parenthesis for the c1 to c4 conditions should be inverted. 
tomus Can you give an example of the overbought codes please? Thanks.
Andy 22 DRAWSEGMENT(BarBullNew, highest[(BarBullnew-BarBullOld)](close), BarBullNew+10, highest[(...
gabri Ok, I believe your version of PRT doesn't support the command drawsegment. You should check ...
Andy ok thanks!

Top