TF différents entre indicateur et stratégie

Forums ProRealTime forum Français Support ProOrder TF différents entre indicateur et stratégie

Viewing 9 posts - 1 through 9 (of 9 total)
  • #242931

    Bonsoir,

    Je souhaite  pouvoir mettre en œuvre des back test opérant sur une stratégie de type “call”. J’ai besoin des données de l indicateur en 4H et de faire fonctionner mon BT sur un graphique 5 min par exemple. est-ce possible et si oui comment? merci d’avance.

    #242942

    Holà ! vous pouvez faire ce qui suit:

    #242967

    Bonsoir Ivan, merci. Malgré votre aide je n y parviens pas. pouvez vous aider encore ? Voici la stratégie en question :

    //STRATEGIE CALL BOTTOM est une strategie d achat avec crosses under. TF strategie 5 min. TF indicateur 4h

    DEFPARAM CumulateOrders = False // Une seule position à la fois

     

    //TIMEFRAME(default) doit etre un TF4H
    // Variables pour récupérer les 20 niveaux “clé” renvoyés par l’indicateur
    Top1 = 0
    Top2 = 0
    Top3 = 0
    Top4 = 0
    Top5 = 0
    Top6 = 0
    Top7 = 0
    Top8 = 0
    Top9 = 0
    Top10 = 0
    Top11 = 0
    Top12 = 0
    Top13 = 0
    Top14 = 0
    Top15 = 0
    Top16 = 0
    Top17 = 0
    Top18 = 0
    Top19 = 0
    Top20 = 0
    TopCount = 0 // Nombre total de niveaux renvoyés par l’indicateur

    // Appel de l’indicateur pour récupérer les niveaux “TOP”
    Top1, Top2, Top3, Top4, Top5, Top6, Top7, Top8, Top9, Top10,Top11, Top12, Top13, Top14, Top15, Top16, Top17, Top18, Top19, Top20, TopCount = CALL “call BOTTOM”

    //Doit etre en TF5min

    // Vérification des croisements sous les niveaux “TOP”
    IF TopCount > 0 THEN
    // Parcours des 20 niveaux “TOP” pour détecter un croisement
    IF close CROSSES UNDER Top1 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top2 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top3 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top4 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top5 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top6 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top7 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top8 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top9 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top10 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top11 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top12 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top13 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top14 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top15 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top16 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top17 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top18 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top19 THEN
    buy 1 CONTRACT AT MARKET
    ELSIF close CROSSES UNDER Top20 THEN
    buy 1 CONTRACT AT MARKET
    endif
    endif

    TIMEFRAME(default)
    // Take Profit Logic with Trailing Stop and Two Partial Closures
    SET TARGET pPROFIT 100

    partialTakeProfit = 50 * pipsize // First TP level for partial closure
    securedProfitAfterTP = 25 * pipsize // Second TP level to secure minimal profit
    trailingstart = 55 // Trailing stop starts at 55 pips of profit
    trailingstep =35 // Trailing stop moves by 35 pips increments

    // Reset stoploss and partial closure indicators
    IF NOT ONMARKET THEN
    newSL = 0
    isPartialProfitTaken = 0 // Indicator for first partial closure
    entryPrice = 0 // Initial entry price
    MAXPRICE = 0 // Reset maximum price reached
    ENDIF

    // Manage long positions
    IF LONGONMARKET THEN
    // Record initial entry price when position is opened
    IF entryPrice = 0 THEN
    entryPrice = tradeprice(1)
    ENDIF

    // Track maximum price reached since entry
    MAXPRICE = MAX(MAXPRICE, close)

    // First partial closure at 50 pips
    IF isPartialProfitTaken = 0 AND close – entryPrice >= partialTakeProfit THEN
    SELL 0.5 CONTRACT AT MARKET // Sell 0.5 contract
    isPartialProfitTaken = 1 // Mark that the first partial closure has been taken
    ENDIF

    // Second partial closure to secure +2.5 pips profit
    IF isPartialProfitTaken = 1 AND close <= entryPrice + securedProfitAfterTP THEN
    SELL AT MARKET // Close remaining position at +2.5 pips profit
    isPartialProfitTaken = 0 // Reset the indicator
    ENDIF

    // Trailing stop logic
    // Start trailing stop at trailingstart pips of profit
    IF newSL = 0 AND close – entryPrice >= trailingstart * pipsize THEN
    newSL = entryPrice + trailingstep * pipsize // Set initial trailing stop level
    ENDIF

    // Move trailing stop up by trailingstep every time the price reaches a new profit level
    IF newSL > 0 AND close – newSL >= trailingstep * pipsize THEN
    newSL = newSL + trailingstep * pipsize
    ENDIF
    ENDIF

    // Stop order to exit long position if trailing stop is hit
    IF newSL > 0 THEN
    SELL AT newSL STOP
    ENDIF
    //************************************************************************

    #242968

    pour un achat c’est

    #242969

    Bonsoir @fifi743 dans mon cas la strategie doit utiliser crosses under meme si c est un achat, car le prix doit venir du bas

    #242970

    le prix va de bas en haut pour faire un cross du top
    donc c’est un

    si le prix va de haut en bas et cross bottom
    c’est un

    crosses under

    #242971

    Oui merci encore de vous intéressé a mon dossier . si j utilise crosses over j’obtiens 0 trade. Avec crosses under voir image jointe. C est un BT sans variables.

    #242975

    Je ne vois pas que vous ayez utilisé l'expression timeframe(4h,updateonclose) Par contre, déclarer les variables TOPn=0 posera probablement des problèmes.

    #242977

    Ok,merci. Vous allez revenir vers moi avec une version exploitable du coup?

Viewing 9 posts - 1 through 9 (of 9 total)

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