Arrêt du système par manque d’historique

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #218194 quote
    Zarcan89
    Participant
    New

    Bonjour,

    J’ai un soucis d’arrêt de code la nuit à 1h30 très précisément. En fouillant dans le forum j’ai essayé de retirer les fonctions “call” de mes deux indicateurs, j’ai ajouté également un “defparam preloadbars”.

    Au début je pensais que c’était en rapport avec les “trous” dans la cotation (je l’utilise sur FR40 au comptant de chez IG en 15min et la nuit certaines bougies sont nulles, inexistantes), mais ce n’est pas le cas ni à 1h30 ni dans la 30aine de bougie qui précède.

    Je me demande donc si cela n’a pas un rapport avec le passage de 0h00à 0h15 mais je ne vois pas pourquoi … Cela représente 6 bougies de 15 minutes jusqu’à 1h30 et aucuns de mes indicateurs n’est paramétré sur 6 ou moins de 6.

    Voila le code en espérant que vous ayez une super idée à me soumettre ^^

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    DEFPARAM Preloadbars = 100000
    
    //Alphatrend
    ap = 14
    Coeff = 1.5
     
    if (MoneyFlowIndex[ap]>=50) then
    magic=Low[0]-AverageTrueRange[ap](close)*coeff
    endif
     
    if (MoneyFlowIndex[ap]<=50) then
    magic=High[0]+AverageTrueRange[ap](close)*coeff
    endif
     
    if (MoneyFlowIndex[ap]>=50 and magic<magic[1]) then
    magic=magic[1]
    endif
     
    if (MoneyFlowIndex[ap]<=50 and magic>magic[1]) then
    magic=magic[1]
    endif
     
    if magic>magic[1] then
    couleur=1
    elsif magic<magic[1]then
    couleur=-1
    endif
    
    //PGO
    SMA = Average[22](close)
    ATR = TR(close)
    MMe = ExponentialAverage[22](ATR)
    
    PGO=(close-SMA)/(MMe)
    
    
    indicator1 = PGO
    indicator2 = couleur
    
    // Conditions pour ouvrir une position acheteuse
    c1 = (indicator1 CROSSES OVER(-2))
    c2 = (indicator2 = 1)
    
    IF c1 and c2 THEN
    BUY 0.5 CONTRACT AT MARKET
    Set Stop ploss 100
    Set Target profit 45
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    c4 = (indicator1 CROSSES UNDER 2)
    IF longonmarket and c4  THEN
    SELL AT MARKET
    ENDIF
    
    
    // Conditions pour ouvrir une position vendeuse
    c5 = (indicator1 CROSSES UNDER 2)
    c6 = (indicator2 = -1)
    
    IF c5 and c6 THEN
    SELLSHORT 0.5 CONTRACT AT MARKET
    Set Stop ploss 87
    Set Target profit 97
    ENDIF
    
    // Conditions pour fermer une position vendeuse
    c7 = (indicator1 CROSSES OVER(-2))
    IF shortonmarket and c7 THEN
    EXITSHORT AT MARKET
    ENDIF
    

    Merci

    PS: Vous remarquerez la présence du code “Alpha trend”, je l’utilise avec plaisir et vous remercie vivement du partage.

    #218198 quote
    Nicolas
    Keymaster
    Master

    L’indicateur MoneyFlowIndex, nécessite du volume pour se calculer, alors si il est à 0, je pense que cela peut créer ce type de comportement.

    On peut essayer en vérifiant la présence de volume pour lancer son calcul, sinon lui donner la valeur précédente, comme ceci:

    if volume>0 then 
     if (MoneyFlowIndex[ap]>=50) then
      magic=Low[0]-AverageTrueRange[ap](close)*coeff
     endif
     
     if (MoneyFlowIndex[ap]<=50) then
      magic=High[0]+AverageTrueRange[ap](close)*coeff
     endif
     
     if (MoneyFlowIndex[ap]>=50 and magic<magic[1]) then
      magic=magic[1]
     endif
     
     if (MoneyFlowIndex[ap]<=50 and magic>magic[1]) then
      magic=magic[1]
     endif
    else 
     magic=magic[1]
    endif
    #218203 quote
    Zarcan89
    Participant
    New

    Merci Nicolas.

     

    En premier lieu cela change beaucoup les résultats du backtest mais pas forcément en mal. Disons que c’était équilibré achat/vente et que maintenant ça penche beaucoup coté achat en terme de résultats.

     

    Je lance le programme et vous tiens au courant demain.

     

    Encore merci!

    #218239 quote
    Zarcan89
    Participant
    New

    Bonjour,

     

    Pas d’arrêt cette nuit!

     

    Merci Nicolas, bonne journée!

    Nicolas thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Arrêt du système par manque d’historique


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Zarcan89 @zarcan89 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Zarcan89
2 years, 6 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 07/27/2023
Status: Active
Attachments: No files
Logo Logo
Loading...