Flying Fish: Trend-on-retracement rebound strategy

Flying Fish: Trend-on-retracement rebound strategy

I propose this code which takes a position on trend rebounds at the 32.2% and 61.8% Fibonacci level with a Williams% R confirmation, and the Vwap Weekly as a trend indicator. I created this backtest on the CAC 40 in 30Min time frame But I think that this strategy can be applied to other assets and also be optimized.

The details are in the code in comments to help understanding.

Thank you

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. Boris • 03/30/2021 #

    Merci Jigsaw, il donne des résultats très sympathiques 200K bougies tick par tick ! 63,51% / 3.44 ! Fonctionne bien sur STXE 2€ également
    Merci pour ton partage !

  2. Jigsaw20000 • 03/30/2021 #

    Bonjour , Merci pour le commentaire je prépare une version DAX en M15 , et en allégeant un peu le code , les VWAp monthly et Yearly ne servent à rien dans ce code et ralentissent pas mal les backtest . si vous le souhaitez vous pouvez déja les effacer du code .

  3. superfalcio • 03/30/2021 #

    hello, i tryed to copy and past in prorealtime, but i got a lot of errors and undefinite parameters… did it happened also to you and than you fixed? tankyou

  4. Jigsaw20000 • 03/30/2021 #

    Bonjour, J’ai mis en Pièce jointe le fichier .ITF , vous pouvez l’importer directement dans la plateforme , souvent le copier/coller peut modifier le code en ne respectant pas les espace ou les sauts de ligne .

  5. macdopa • 03/30/2021 #

    Félicitation à ses résultats de plus de 450% au dernier trade (du 29 mars au 01 avril) avec CAC40 à 30 min après avoir débattu aux 2 premiers trades. Ceci démontre l’atout majeur de ce code qui résulte en sa

    capacité de tirer énormément des profits tant que la tendance est prononcée et maintenue longtemps

    . (A @Jigsaw20000 de nous aider à séparer cette partie du script pour autres utilisations).
    Essayez de vérifier les résultats à longue période : 2’500 unités ou 10’000 unités.

  6. NA • 03/30/2021 #

    this strategy seems promising however in the code there are still script errors that cannot be corrected for those who would like to alleviate it by removing the monthly and annual VWAps from the DAX M15 version seems to be in preparation … to see also if will the strategy recover at the start of 2021? the one who will want to make the corrections for the others is an angel thank you

  7. Jigsaw20000 • 03/30/2021 #

    Bonjour, je travail toujours à évoluer mon code pour le DAX en M15 , je souhaite intégrer un indicateur type oscillateur de cycle , certains indicateurs , notamment ceux de J.ehler sont parfaits mais trop lourd pour mon code , auriez vous une idée d’indicateur de cycle simple pour filtrer au mieux les signaux achat/vente ?

  8. ginko • 03/30/2021 #

    Bonjour, vous pensiez à quel indicateur de John Ehler en oscillateur de cycles. Si je me souviens bien il a fait des stochastiques et d’autres indicateurs dont la longueur est adaptative, surtout valables pour des produits cycliques (matières premières, commodities).
    Il y a le momentum, le RSI, les stochastiques (valable en range surtout), le DeMarker (DeM), le OBV, le KVO, repulse, et certains composés (le PRT cycle à base de stochastiques), le DMI, les MACD, les MACD0delay (mesurant les accélérations), le DPO… Tout dépend de ce que vous cherchez optimiser les entrées avec des oscillateurs de type surachat/survente, ou des oscillateurs de tendance.

  9. Jigsaw20000 • 03/30/2021 #

    Bonjour, effectivement je dois préciser ma demande . En fait je cherche un oscillateur , un indicateur donc borné pour limiter les variables . c’est très important pour moi que ce soit un oscillateur car c’est un signal de vente et d’achat .
    Ma stratégie définie le plus haut et le plus bas des 40 bougie précédente et trace un Fibonacci , je souhaite rentrer sur un retournement au 38,2 ou 61,8 , l’oscillateur de cycle doit m’avertir proche de ces niveau d’un retournement de cycle (un pull back sur l’oscillateur par exemple) .
    j’

  10. Jigsaw20000 • 03/30/2021 #

    j’aime bien reflex de john elher que nicolas a traduit mais trop lourd pour mon code

  11. Flashtrader • 03/30/2021 #

    Bonjour, merci pour votre travail, les backtests sont très prometteurs !
    J’ai tenté de lancer le code en automatique via ProOrder mais j’ai le message d’erreur suivant : “Les stops combinés ne peuvent pas être utilisés avec ProOrder”.
    Auriez-vous un moyen d’y remédier ?
    En vous remerciant d’avance.

  12. Arsenic12728 • 03/30/2021 #

    Bonjour Jigsaw2000
    Ton code à l’air vraiment bien mais le fichier ITF ne se télécharge plus…
    Pourrais tu le réinitialiser s’il te plait ?
    J’ai hâte de le tester.
    Merci pour ton travail

    • Nicolas • 03/30/2021 #

      le fichier itf se télécharge correctement, vous pouvez toujours copier/coller le code de la page sinon.

  13. Jigsaw20000 • 03/30/2021 #

    Bonjour,
    Voici le code simplifié , j’ai aussi modifié l’écriture des trailing stop pour permettre de de lancer sur Ig market .
    Merci

  14. Jigsaw20000 • 03/30/2021 #

    //================================================//
    // ========== PARAMETRE GENERAUX ================ //
    //================================================//

    DEFPARAM CumulateOrders = false

    // REINVESTISSEMENT DES GAINS

    REINV = 1 // 0 = NON / 1 = OUI

    IF REINV = 0 THEN
    Capital = CapitalInit
    ELSIF REINV = 1 THEN
    Capital = CapitalInit + (strategyprofit*2/3)
    ENDIF

    //================================================//
    // ========== PARAMETRES DES POSITIONS ========== //
    //================================================//

    // MONEY MANAGEMENT // 3 VARIABLES A PARAMETRER //

    Capitalinit = 10000 // CAPITAL INITIAL
    RisquePourc = 1.5 // RISQUE PAR TRADE EN %
    DSL = 46 // DISTANCE AU STOP LOSS

    RisquePartrade = capital*RisquePourc*0.01
    RisqueParContrat = DSL*pipsize
    N = RisquePartrade / RisqueParContrat
    IF N = 080000 and time < 223000

    //================================================//
    // ========== PARAMETRE DES INDICATEURS ========= //
    //================================================//

    // RETRACEMENT DE FIBONACCI ET LOCALISATION DES ZONES // 1 VARIABLE A PARAMETRER //
    NbCycle = 54 // NOTE : LE NOMBRE DE BOUGIE PRECEDENTE CORRESPOND A UN CYCLE , EXEMPLE 40 BOUGIES DE 30 MIN REPRESENTENT UN CYCLE DE 20H00 //

    hh = highest[NbCycle](high)
    ll = lowest[NbCycle](low)
    amplitudefibo = ((hh – ll)/ll)*100
    RT382 = ll+(hh-ll)*0.382
    RT618 = ll+(hh-ll)*0.618

    // LES V-WAP YEARLY , MONTHLY ET DAYLY //

    //calcule de la période
    if DayOfWeek=0 or (dayofweek[1]=5 and dayofweek5) then
    weekbar=barindex
    endif
    once dWeekly=1
    dWeekly = max(dWeekly, barindex-weekbar)
    VWAPweekly = SUMMATION[dWeekly](volume*typicalprice)/SUMMATION[dWeekly](volume)

    // LE Volatility index //

    // LE Volatility index //

    PTotETMoving=20
    PeriodET = 2 //”Ecart type”
    PeriodTotET = 18 //”Période de recherche”,minval=0)
    PeriodEMA= 3 //”Période EMA”,minval=0, type=input.integer)
    BMax= 0.8 //”Borne Maximum”,minval=0, type=input.float)
    BMin= 0.2 //”Borne Minimum”,minval=0, type=input.float)

    ET = std[PeriodET]
    ETmaxpostTotET=highest[PeriodTotET](ET)

    if (PTotETMovingPeriodET) then
    PTotETMoving= PTotETMoving+1
    if ETmaxPeriodET+PeriodTotET) then
    ETmax=ETmaxpostTotET
    endif
    Volat=(ET/ETmax)

    MMExp=average[PeriodEMA,1](volat)

    //williams %R//

    Catest = williams[22]<williams(close) and williams VWApWeekly
    CaMom2 = VWAPWEEKLY > VWAPWEEKLY[21]
    CaMom3 = MMExp 0.8
    CaLoc5 = amplitudefibo < 1.4

    //ENTREE LONG SUR PREMIER ARRET //

    //Les Conditions de figure //

    CaFiG6 = LOWEST[1](low) RT382

    //stoploss et take profit //

    takeprofit = 2.02
    Stoploss = (tradeprice*takeprofit/100)*0.5
    If stoploss > DSL Then
    stoploss = DSL
    endif

    If CtimeAchat1 AND CaMom1 AND CaMom2 AND CaMom3 AND CaLoc4 AND CaLoc5 AND CaFig6 and Catest THEN
    BUY n SHARES AT MARKET
    set target %profit takeprofit
    set stop loss Stoploss
    set stop ptrailing stoploss*1.02
    ENDIF

    //ENTREE LONG SUR RELOAD ZONE //

    // les conditions de Momentum

    CaMom1bis = hh > VWApWeekly
    CaMom2bis = VWAPWEEKLY > VWAPWEEKLY[54]
    CaMom3bis = MMExp 0.8
    CaLoc5bis = amplitudefibo < 1.4

    //Les Conditions de figure //

    CaFiG6bis = LOWEST[1](low) RT618
    CaFig7bis = open>close

    //stoploss et take profit //

    takeprofitbis = 2.51
    Stoplossbis = (tradeprice*takeprofit/100)*0.4
    If stoplossbis > DSL Then
    stoplossbis = DSL
    endif

    If CtimeAchat1 AND CaMom1bis AND CaMom2bis AND CaMom3bis AND CaLoc4bis AND CaLoc5bis AND CaFig6bis AND CaFig7bis and catest THEN
    BUY n SHARES AT MARKET
    set target %profit takeprofitbis
    set stop loss Stoplossbis
    set stop ptrailing stoplossbis*1.54
    ENDIF

    //===============================================//
    // ======= LES CONDITIONS D’ENTREE SHORT ======= //
    //===============================================//

    //Les condition de Momentum//

    CvMom1 = hh < VWApWeekly[75]
    CvMom2 = VWAPWEEKLY 0.27
    CvWill = williams[9] 0.8
    CvLoc5 = amplitudefibo RT618 AND CLOSE[1] DSL Then
    stoplossV = DSL
    endif

    If CtimeAchat1 AND CvMom1 and CvMom2 AND CvMom3 AND CvWill AND CvLoc4 AND CvLoc5 AND CvFig6 THEN
    sellshort n SHARES AT MARKET
    set target %profit takeprofit
    set stop loss StoplossV
    set stop ptrailing stoplossV*1.08
    ENDIF

    //short sur REBOND 61.8% de retracement//

    //Les condition de Momentum//

    CvMom1Vbis = hh < VWApWeekly[64]
    CvMom2Vbis = VWAPWEEKLY < VWAPWEEKLY[21]
    CvMom3Vbis = MMExp < 0.49
    CvWillVbis = williams[43] -23

    CvLoc4Vbis = amplitudefibo > 0.8
    CvLoc5Vbis = amplitudefibo RT382 AND CLOSE[1] DSL Then
    stoplossVbis = DSL
    endif

    If CtimeAchat1 AND CvMom1Vbis AND CvMom2Vbis AND CvMom3Vbis AND CvWillVbis AND CvLoc4Vbis AND CvLoc5Vbis AND CvFig6Vbis THEN
    sellshort n SHARES AT MARKET
    set target %profit takeprofitVbis
    set stop loss StoplossVbis
    set stop ptrailing stoplossVbis*1.1
    ENDIF

  15. Corto78 • 03/30/2021 #

    Bonjour Jigsaw,

    En copiant le code ci-dessus, on a quelques erreurs de syntaxe sur les lignes suivantes :
    30, 71, 80, 82, 89, 112, 117, 142, 143, 144, 165

    Serait-il possible de les corriger et mettre le fichier en téléchargement ?

    Merci d’avance et bravo

  16. Jigsaw20000 • 03/30/2021 #

    Bonjour, Je voudrais mettre le liens du code en format .itf mais je n’y arrive pas , quelqu’un peut-il m’indiquer la marche a suivre ?

  17. Corto78 • 03/30/2021 #

    Il faut aller dans la liste des ProBacktest & Trading Automatique (là ou tu as créer ton système), sélectionner celui que tu veux exporter et cliquer sur le bouton Exporter

  18. Malloc • 03/30/2021 #

    Bonjour,
    Votre système a l’air intéressant et prometteur mais en l’état il est inutilisable tant il y a de bugs (sans doute à cause d’un souci de copier/coller).
    Vous serait-il possible de nous transmettre une version exploitable ?
    Merci par avance,
    Malloc

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas
5 years ago
swapping https://www.prorealcode.com/topic/prc_quickfibtl/ Please Hans63 and robdav follow to uppe...
Hans63 Thank you swapping
FREDNC @Nicolas merci pour se remarquable indicateur, reste à voir comment on va pourvoir l'intégre...
arnaudat Merci nicolas, j'ai déjà pris cette version et en plus je suis sur les futures. Par contre d...
ullle73 hi nicolas, when im making a strategy out of this i get the error "PRC_VWAP z-score" called ...
Nicolas Please open a new topic in the ProOrder forum section and post the code there in order to ch...
swapping fib1236 = (hiday-lowday)*1.236+lowday DrawSegment(startbar,fib1236,barindex,fib1236) colou...
swapping Oups ! Nicolas il y a un problème avec l'insertion de code en utilisant le bouton [Add PRT ...
swapping fib1236 = (hiday-lowday)*1.236+lowday DrawSegment(startbar,fib1236,barindex,fib1236) colour...
Nicolas Sure, I suggest you open a new topic in the forum to discuss about your ideas.
hdgm Bonjour Nicolas, est ce que l'on peut en faire une stratégie de trading automatisée ?
Nicolas Non, pas en utilisant l'indicateur zigzag traditionnel de la plateforme.
Van Salt Hi Bianca, the indicator shows you some interesting cluster-zones from long- and shortterm f...
Vinci1966 Questo indicatore è molto interessante. Mi sono permesso di apportare alcune modifiche nell'...
Vinci1966 // VAN SALT´s <> Version 20171105 // This Indicator draws the Shortterm and Longtern ...
Nicolas Please open a new forum topic, and respect the posting rules. Add a precise description of w...
FXTT ok will do, apologies, as I said I am new here. many thanks
Noobywan Version v2 including requested additions: https://www.prorealcode.com/prorealtime-indicators...
Nicolas Better to download the file from the page and import it into your platform in order to not c...
marcov66 Hi Nicolas, thanks for sharing the VWAP Date Indicator. It is really powerful. Nevertheless,...
Nicolas Are you sure you are using the same exact date, hours, minutes, seconds for anchor?
BERTJES82 Hi Nicolas, is it possible to adjust the starting date of the VWAP on the charts? Thanks in ...
Nicolas Yes, have a look there: https://www.prorealcode.com/prorealtime-indicators/vwap-date-anchored/
Dadoo Merci Nicolas!
marinober Ciao. avrei necessità di usare questo indicatore in intraday . Dovrei poter dare un prezzo d...
Nicolas Use the wrench of the price chart! Upper left of the window
Dymjohn The wrench shows options for the components of the indicator not how to show in the main cha...
Nicolas http://www.prorealcode.com/topic/overlapping-indicators/  
Nicolas
8 years ago
Nicolas You will find the VWAP code from PRT here: https://www.prorealcode.com/topic/is-there-any-wo...
keks Thanks for sharing this wonderful code. Is there a way to draw a horizontal line to plot pre...
taklause Hello, just one question, can it be that this indicator does not work on ProRealTime v12? T...
Nicolas Dans l'onglet prix, choisir d'appliquer l'échelle qu'au prix uniquement.
Eloi MERCI
211 Really nice indicator Nicolas! Well done!
supertiti Bonjour Nicolas comme j'avais l'impression qu'il en manque un bout j'ai fais ça : Peux...
Nicolas Merci supertiti ! C'est juste, encore un ptit bug quelquepart ! :|
Nicolas Je pense que cela a été fait dans le forum il y a quelques temps, il faudrait le retrouver t...
besserwerden Hello, I want t use this screener, but only results for uptrend. Is there a possibillity to ...
besserwerden Hello Nicolas, I want t use this screener, but only results for uptrend. Is there a possibil...

Top