USDJPY 3candles and reversal strategy with ADX and VOL filter.

USDJPY 3candles and reversal strategy with ADX and VOL filter.

Dear all

I have been playing around with the concept of reversal after n consecutive bullish or bearish bars and I found a quite nice result in the USD JPY 1 hr timeframe.

The strategy has 3 condition:

  • 3 consecutive bars of hte same colour
  • ADX > ADXmin
  • Vol > Volmin ( expressed in ATR )

In attachment you find the results of a WF static analysis 70/30 with 3 variables.

Please feel free to comment, any constructive criticism will be greatly appreciated!

 

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?

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

  1. StantonR • 05/15/2017 #

    I’m not getting any trades.
     

    • Francesco78 • 05/15/2017 #

      Stanton, I realize in the code there are a few backslash you need to eliminate. Ahead of t, n, and adxval. Pls confirm if je code is working if yoi remove them.

  2. StantonR • 05/15/2017 #

    I removed them and used the download with the variables set and still dont get trades.

    • Francesco78 • 05/15/2017 #

      Sorry to hear, I have no clue whats happening then..

  3. maorai • 05/15/2017 #

     To me it’s the same. NO trades at all

  4. Francesco78 • 05/15/2017 #

    Just to be sure this is the version I use

  5. Elsborgtrading • 05/15/2017 #

    Hi Stanton – it’s properly because Francesco is using a spread bet account

  6. Elsborgtrading • 05/15/2017 #

    …you account is proberly in JPY while Fran’s is in euro. try and add more equity

  7. Francesco78 • 05/15/2017 #

    Im using IG INDEX
    why does it matter if I may ask?

  8. StantonR • 05/15/2017 #

    Yeah my currency is in JPY for this pair

  9. StantonR • 05/15/2017 #

    Yeah my currency is in JPY for this pair added 1,000,000 yen still no trades

  10. ALE • 05/15/2017 #

    Hi Francesco
    my EURO account no trade.

  11. Francesco78 • 05/15/2017 #

    mm ok.. Im really wondering what’s going on..
    I’m testing it across many different currency pair and bund and seems to stay up quite nicely in most of the cases and most of timeframes.. I have a UK account but it shouldn’t make any difference
     

  12. Francesco78 • 05/15/2017 #

    mm ok.. Im really wondering what’s going on..
    I’m testing it across many different currency pair and bund and seems to stay up quite nicely in most of the cases and most of timeframes.. I have a UK account but it shouldn’t make any difference.
    Try to use constant position maybe?
    Nicolas was it working properly when you reviewed it?
     

  13. Francesco78 • 05/15/2017 #

    Is it for working for anyone of you?

    • DEIO • 05/15/2017 #

      hi Francesco,
      it seems to me that it works with any instrument  but currencies.
      It’s possible ?
       

  14. juanj • 05/15/2017 #

    I think the problem lies with the ‘volok’ parameter (line 19 in original code). I have rewritten the code to systematically determine where the problem might be (my flatbefore time is different due to my timezone).
    Unfortunately using tick by tick testing yields negative results. Without tcik by tick the code performs very well in test period March 2013 to Current except for a period between March and October 2014 where there is a large draw down period.
    //USDJPY TF 1hr spread 1.5 pips
    DEFPARAM CUMULATEORDERS = FalseDEFPARAM PRELOADBARS = 14DEFPARAM FLATBEFORE = 010000DEFPARAM FLATAFTER = 200000
    possize = 1//round(100/averagetruerange[14])
    n = 3 // number of consecutive bars with the same colourfastma = 5 /// period of fast moving averageslowma = 100// period of slow moving averageadxval = 25 // take position only if there is a trendt = 7 // multiplier for exit strategyatr = averagetruerange[14](close)atrmin = 10 // take poistion only if there is enough volfastav = average[fastma,1](close)slowav = average[slowma,1](close)
    red = 0green = 0For i = 1 to nIf close[i] > open[i] thenred = red + 1ElsIf close[i] < open[i] thengreen = green + 1EndIfNext
    volok = 1 //no volume for securityIf atr > atrmin thenvolok = 1EndIf
    ctrend = 0If adx[14] > adxval Thenctrend = 1EndIf
    if countofposition = 0 and red >= n and ctrend = 1 and fastav > slowav and volok = 1 thenbuy possize contract at marketendif
    if countofposition = 0 and green >= n and ctrend = 1 and fastav < slowav and volok = 1 thensellshort possize contract at marketendif
    set target pprofit t*atrset stop ploss 2*t*atr
     

  15. Francesco78 • 05/15/2017 #

    Hi Junaji, thank for your comments, I have always backtested in tick by tick mode. Please do not use any flat bore and flat after. I forgot to remove them from the original code. With flatbefore and flatafter the results are negative.
    Best

  16. Francesco78 • 05/15/2017 #

     @ DEIO 
    what do you mean? you mean that id doesnt give you any trade for currencies?
    From what I have been looking at, it works well with USDCAD, GBPJPY, CADJPY and BUND

  17. StantonR • 05/15/2017 #

    HI There
    The security does not have volume but does have volume but does have ATR as you can add the ATR indicator.
    So I dont think that is the issue.

  18. StantonR • 05/15/2017 #

    HI There
    The security does not have volume but does  have ATR as you can add the ATR indicator.
    So I dont think that is the issue.

  19. Francesco78 • 05/15/2017 #

    Guys can you pls let me know if any one of you can run the code at all?
    Thanks

  20. StantonR • 05/15/2017 #

    Think Juan is right can run it on dax but not on forex pairs.Could have something to do with volume. As volume is not available on forex pairs on some accounts.

  21. Francesco78 • 05/15/2017 #

    Guys volok means VOLATILITY ok.
    there is no reference to volume in this code whatsoever

  22. Francesco78 • 05/15/2017 #

    are you all using v 10.3?

  23. juanj • 05/15/2017 #

    Hi Francesco, I did use v10.3, however like the others I am having trouble running it on FX pairs on the original code. But the re-written code work well.
    Your strategy also adapts very well to other markets. I have managed to get some good results out of it on some of the indexes.
    It’s a very cool idea. Well Done

  24. Francesco78 • 05/15/2017 #

    ok I see, many thanks, so you are not able to replicate the results on USDJPY right?
     

  25. juanj • 05/15/2017 #

    Unfortunately not. However it is possible that there is a setting somewhere on your system that is different to ours.
    The strategy however still holds merit as I can produce decent results on other markets, proving it is a valid strategy to outperform a given market.
    I have strategies in place that outperform it on the 1 hr but the results are still good and the strategy can definitely be built upon.

  26. Francesco78 • 05/15/2017 #

    Ok thank you, I hope we will be able to find what is missing so that we can share our results more efficently in the future.
    Ciao

  27. Nicolas • 05/15/2017 #

     The problem is at line 19, you should adapt the ‘atrmin’ variable to the pointsize of the current security:
    volok = volindic > atrmin*pointsize
    I think there might be a problem in the stoploss size, you should use “loss” instead of “ploss”, to be perfectly compatible with any instrument:
    set stop loss 2*t*volindic
    (like you did correctly for the takeprofit).

  28. Francesco78 • 05/15/2017 #

    Thanks! I hope this will sort the issues some people were experiencing

  29. Francesco78 • 05/15/2017 #

    Hi Grahal, thanks for your attention to my strategy, yes there is a forum thread I opened.
    https://www.prorealcode.com/topic/ncandle-and-reversal-filtered-strategy/

  30. DarioMazza • 05/15/2017 #

    THIS doesn’t work. no operations

  31. Francesco78 • 05/15/2017 #

    ciao Dario, 
    try to change line 19 with 
    volok = volindic > atrmin*pointsize
    Let me know.
    Best

  32. pepmartorell • 05/15/2017 #

     It seems it doesn’t work, even with the change proposed by Francesco78. In fact the maximum amount of winning trades in my nacktest simulation is under 10%…
    Where’s my error? I apply the code on USDJPY at 1-hour frame, wth 1.5 pips, etc.

  33. Francesco78 • 05/15/2017 #

    Hi Pepmartorell, please let’s continue the discussion on the forum thread so that we can share pictures, I would like to see a snapshot of your screen when you try the backtest in order to help you.
     

  34. Francesco78 • 05/15/2017 #

    Hi Pepmartorell, please let’s continue the discussion on the forum thread so that we can share pictures, I would like to see a snapshot of your screen when you try the backtest in order to help you.
    this is the link
    https://www.prorealcode.com/topic/ncandle-and-reversal-filtered-strategy/
     

  35. Jusmih1 • 05/15/2017 #

    Hi there,
    i am looking at your Strategy however when you put in automatic trading mode its saying that I have to remove all the variables from the “Probacktest” and to replace them with specific numeric values in the code of the trading system? can you help me as I am not sure how to do this? Thank you

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
jimkn0pf Christopher, wie saehe denn die Formel ohne Kontrollkerze (3. Kerze) aus?
Doctrading
4 years ago
Stanko Ciao doctrading, grazie per il tuo contributo. Volevo chiederti se hai tenuto in osservazion...
Stanko Buongiorno doctradinge buongiorno a tutti. Vorrei riportare all'attenzione questo sistema p...
Meta Signals Pro Hi, Yes I am monitoring all the strategies posted on this site and I confirm that the strat...
luxrun sorry, add prt code add doesn't work
robertogozzi Don't worry about PRT code, I can't make it work either! Great for pointing that out, it's ...
Khaled @Luxrun, good morning, you mentionned "y = exponentialaverage (x)", isn't the period of the ...
luxrun One question, Roberto: the two AvgT are variable, could you explain to me what they regulate...
robertogozzi AvgT stands for Average Type, it's a parameter for the AVERAGE keyword (https://www.prorealc...
woktrade Superbe !
Vonasi An updated version with a bug fix can be found here: https://www.prorealcode.com/topic/dis...
snucke hey Vonasi is it possible you can help me get this indicator to show how much a market mo...
robertogozzi Yes, you can use any setting that suits you best! As to which one... it depends on the inst...
DaxRider grazie Robnerto
Vinks_o_7 Vonasi you're a beast !!! ;-)))
pableitor Amazing indicator , you are pushing PRT to the limit! But looking at the scatter its not c...
Nicolas remplacer les valeurs de coloured(0,255,0) par coloured(r,g,b) et ajouter ces noms de variab...
mohamed merci Nicolas!
sacram14 Merci Nicolas pour ce set-up que je ne connaissais pas ! J'ai tenté de reprendre le code pou...
Balmora74 thanks for this code Philippo ! So if i understand well a Positive (+) EntryOK x ROC means a...
Dritan Hi Philippo,thanks for sharing this code.Can You add please Volume more than 250.00?Thanks
Vonasi Sure that is possible. I will code it and make a post in the English ProBuilder forum and pu...
Vonasi Vama v2 with Hull moving average included can be found here: https://www.prorealcode.com/top...
JMat45 Thank you, Vonasi.
Bard Very interesting approach Vonasi! I'm getting a 404 error when trying to download though?
Vonasi I just tested and I was able to download with no error.
Psari Hi Vonasi, I am a newbie and was wondering whether you could possibly help me with this pro...
jiddan78 how to convert to afl amibroker ?
Nicolas We do not supply free coding assistance for AFL Amibroker on the website. You can ask for pa...
Ngomsi @ Vonasi, how to use timeframe , 13 minutes ,21 minutes, 34 minutes,et 55 minutes with this...
JJ Tec Hola. Me gustaría contactar contigo para ver la estrategia..
nilsla1981 Has someone already tested in real ?
Lucas0000 Hola. estoy buscando un programador en proorder, para hacer un programa basado en el Q-trend...
Bard I've also just noticed that changing the "Bands Deviation" setting from 1.25 to eg 3 doesn't...
bartekz Hi @Nicolas, Really impressed by your work. I am trying to replicate the Wave-PM indicator t...
Nicolas You don't have to replicate it, download the file and import it into your platform.
Vinks_o_7
5 years ago
IV Mcm I've always wondered how to make the ADX faster, thank you!
Vinks_o_7 You welcome !
Vinks_o_7 Another variation that may be more accurate : we calculate the average of normalized DI's in...
Nicolas change the lastline with: RETURN lastsig and check if lastsig change its value with the a...
nectouxg Hello Nicolas, I will try tonight when I get home, just one last question, I trade the DA...
FXtonio Bonjour, j'ai un problème avec le code, il me dit que ce n'est pas correct ligne 26-27-28: ...
Pablo Carmona del Moral hola juanjo, muchas gracias por este screener que nos has compartido. creo que lo voy a util...
Pablo Carmona del Moral para el volumen he cambiado: // Volumen significativo VS=volume>2*(average[10](volume[1...
Juanjo Muchas Gracias Pablo, ...Tengo varios screener, uno lo tengo adaptado para operar intradía, ...

Top