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
Khaled
1 year ago
Nicolas
2 years ago
DELBERT Bonsoir , Nicolas , j'ai transféré votre indicateur sur ma PRT 10,3 et j'ai un méssage d'ére...
Nicolas Vous pouvez essayer en remplacant la ligne avec: vwapsd = sqrt(average[lengthz](square(clo...
DELBERT Bonsoir , merci Nicolas , a bientôt .
larouedegann
2 years ago
TWAP
TWAP
0
Indicators
smp I also have an End Of Day (EOD) cash pivot indicator for use on cash markets; this indicator...
Xenotrax A première vue, sa à l'air d'être un indicateur très puissant sur de petites temporalités, j...
merri Bonjour Nicolas, Comment transformer cet indicateur en bot sur PRT ?
Nicolas Cela a déjà été fait, voir ce sujet: https://www.prorealcode.com/topic/strategia-con-lindica...
venugopal Hi Nicolas, Thanks for this code. Is it possible to build a screener using this indicator?. ...
Nicolas It has been done in that topic. Enjoy.
Abouadam2 EFFICACE
Daniele Maddaluno If you need to use it in PRT v11 take a look at this topic: https://www.prorealcode.com/top...
Monobrow Hi Daniele Thank you for the indicator, it looks very good. However, I have a problem so...
avatar
Anonymous Thanks very much for sharing, look forward to testing this idea out.
IV Mcm I don't speak English and the translation is not clear. Do you have a different turn of ...
IV Mcm stonk ?
avatar
Anonymous Thanks very much for sharing, look forward to testing this idea out.
mistersylv What parameter should we change to make another channel appear in the higher or lower time u...
GARNIEPI hello I am looking for an anchored vwap intraday, indicator which allows you to visualize th...
withoutwings To be able to flexibly wrap around the full 24h (i.e. past midnight), or to use just a singl...
Nicolas Oui c'est possible. Merci de ne pas poster des demandes qui sont hors sujets. Pour les deman...
Igor Merci pour cet itf. Question : comment faire pour instruire un screener ?
Nicolas tester le croisement du Close avec la première valeur de l'indicateur : "TrailingStop", faci...
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...
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 Pour créer des alertes, vous pouvez suivre ce petit tutoriel : https://www.prorealtime.com/f...
thibault76 Bonjour Nicolas, cette stratégie est intéressante. Par contre, en 2022, le code ne fonction...
Nicolas Aucun message d'erreur pour ma part en version 11.1. Tu es certain de créer un code d'indica...
Meta Signals Pro Pleasure ! Please let us know if you make good trades with it and if you see improvements we...
francis59 Bonjour, Bonjour, comment puis-je créer un screener basé sur cet indicateur, qui affiche le...
Trader Sab I am curious to try it how, however I get an error message for line 47 and 48 - drawsegment,...
rama what is the buy condition or sell condition for this can you suggest a code k1=1 buy and k1...
rama I would like to know at point 1 an alert or binary indicator so that I can place order
maxlys Bonjour Nicolas, merci pour ce code qui a l'air intéressant. Comment ajouter dans le code l'...
Dari when I put the indicator does not put it on the price, sn in a new box like many indicators....
Nicolas by adding it on price instead. Use the wrench on the left upper side of your price chart.
Nicolas Add indicator on price doesnt require any specific type of subcription. Click on the wrench ...
tahiti bonjour j'ai une petite question comment peux on enlevé la bar blanche sur la bougie en cour...
sixeight Hi Kris, is there a way to increase the number of rows? I get a loop error
Kris75 Hi, This is great !! anyone ever developped a strategy about it ???
swapping hello Kris75, not that I know but it is possible to make a scenario ;)
digitation Hi swapping, Thanks for sharing this useful tool. I was wondering how difficult it would be...

Top