Stratégie en renko

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #127456 quote
    LurubuLurubu
    Participant
    Senior

    Merci de ta réponse.

    La stratégie que je cherche à programmer est celle-ci :

    Il s’agit d’un break out classique mais en renko.

    Pour pouvoir la tester j’ai pris le code des renkos trouvé sur ProBuilder.

    A partir de là, je construis un canal horizontal d’ouverture (15 h 30sur le Dow) que je fixe au bout de n renkos.

    Puis j’attends la cassure de la limite haute (pour l’exemple) pour figurer le niveau d’entrée (NivA) et le stop (NivStopA). (nombre d’entrées limité)

    Ensuite mon stop évolue à 3 box du renko.

    Enfin à la cassure du stop, on revient au point de départ.

    Pas très original mais le fait d’être en renko complique un peu les choses.

    Ci-joint le code.

    Je n’arrive pas à effacer le “NivA” et le “StopA” en fin de session (22 h 00) et je ne comprends pas la conduite erratique du “NivStopA” qui s’active quand bon lui semble. Ce n’est san doute pas grand-chose mais je me sens impuissantt.

    Merci de m’aider.

    //------------------------------------------Calcul des renkos
    BoxSize = Renko
    
    // On aime bien que les valeurs des Renko soient "rondes"…
    
    once renkoMax = ROUND(close / boxSize) * boxSize
    once renkoMin = renkoMax - boxSize
    
    IF high > renkoMax + boxSize THEN
    WHILE high > renkoMax + boxSize
    renkoMax = renkoMax + boxSize
    renkoMin = renkoMin + boxSize
    WEND
    ELSIF low < renkoMin - boxSize THEN
    WHILE low < renkoMin - boxSize
    renkoMax = renkoMax - boxSize
    renkoMin = renkoMin - boxSize
    WEND
    ENDIF
    
    //------------------------------------------- Numerotation des renkos : on numérote à chaque nouveau niveau
    
    If renkoMax <> renkoMax[1] then
    nbT = nbT[1] + 1
    endif
    
    //---------------------------------------------- Calcul du canal d'ouverture
    
    LimH = 0
    limB = 100000
    alpha1 = 0
    
    if Time = 153000  then
    Debut = nbT
    LimH = High
    LimB = Low
    else
    If nbT >= Debut and nbT < Debut + nbRMax then
    LimH = Max(LimH[1],renkoMax)
    LimB= Min(LimB[1],renkoMin)
    else
    LimH = LimH[1]
    LimB = LimB[1]
    alpha1 = 250
    endif
    endif
    
    
    
    If LimH = 0 and LimB = 0then
    alpha1 = 0
    endif
    
    //-------------------------------- Achats
    NivA = 0
    NivStopA = 0
    alpha2 = 0
    alpha3 = 0
    
    
    If Time > 153000  and renkoMax crosses over LimH and NbAchat < AchatMax then
    NbAchat = NbAchat[1] + 1
    NivA = close
    NivStopA = LimB
    alpha3 = 0
    DrawText("#NbAchat#",BarIndex,LimB - 50)//aux fins de vérification
    else
    NivA = NivA[1]
    NivStopA = Max(NivStopA[1],renkoMin - 3 * BoxSize)
    alpha2 = 250
    alpha3 = 250
    endif
    if NbAchat >= AchatMax then
    NivA = 0
    NivStopA = 0
    endif
    If (renkoMin crosses under NivStopA) or (renkoMin[1] >= NivStopA[1] and renkoMin < NivStopA) then
    NivStopA = 0
    //NivStopA = NivStopA[1]
    //alpha2 = 0
    alpha3 = 0
    endif
    
    
    // on arrête le canal à 1935
    If time > 223000 then
    limH = 0
    LimB = 0
    NivA = 0
    alpha1 = 0
    NbAchat = 0
    NivStopA = 0
    endif
    return renkoMax coloured(0,257,257) style(Line,1) as "RenkoMax",renkoMin coloured(0,257,257) style (Line,1) as "renkoMin",LimH coloured(244,102,27,alpha1) style(Line,2) as "LimH", LimB coloured(244,102,27,alpha1) style(Line,2) as "LimB",NivA coloured(0,0,200,alpha2) style(Line,2) as "NivA",NivStopA coloured(250,0,0,alpha3) style(Line,2) as "NivStopA"
    
    Exemple-2.png Exemple-2.png
    #127478 quote
    NicolasNicolas
    Keymaster
    Legend

    Sujet déplacé au bon endroit, trading automatique = forum ProOrder.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Stratégie en renko


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Lurubu @lurubu Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
6 years, 7 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 04/22/2020
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...