Connaitre le nombre de positions gagnants et perdantes

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #173491 quote
    OzonsOzons
    Participant
    Junior

    Bonjour,

    à partir du programme ci-dessous que j’aurais pu simplifier, l’objectif est de rechercher dans un premier temps les phases de dérives latérales. Dans un second temps Le signal d’achat est donné par une clôture au-dessus de la bande de Bollinger. Dans un troisième temps la sortie est concrétisée par une clôture inférieure à la moyenne mobile à 20 périodes.

    Question : comment pourrais-t-on programmer sur un historique donné sans passer par l’outil Probacktest :

    1. le nombre de positions gagnantes ainsi que la moyenne des pourcentages de gains
    2. le nombre de positions perdantes ainsi que la moyenne des pourcentages de pertes

    Merci pour votre aide car je patine sérieusement et cela va me permettre lorsque je prends position d’intégrer ces données pour la gestion du risque.

    //INDICATEUR
    BOLINF = BOLLINGERDOWN[20](TYPICALPRICE)
    BOLSUP = BOLLINGERUP[20](TYPICALPRICE)
    
    //
    ENCADREMENT = (CLOSE<BOLSUP AND CLOSE>BOLINF)
    
    //ATDMF
    P1 = ENCADREMENT AND ENCADREMENT[1]
    P2 = P1 AND ENCADREMENT[2]
    P3 = P2 AND ENCADREMENT[3]
    P4 = P3 AND ENCADREMENT[4]
    P5 = P4 AND ENCADREMENT[5]
    
    PLAT = (ENCADREMENT OR P1 OR P2 OR P3 OR P5 OR P5)
    
    ALERTEPLAT = (PLAT AND PLAT[1] AND PLAT[2] AND PLAT[3] AND PLAT[4] AND PLAT[5])
    
    T1 = (ALERTEPLAT[1] AND ALERTEPLAT=0)
    
    // ACHAT
    
    ACHAT = (T1 AND CLOSE>BOLSUP)
    SORTIE = (CLOSE<AVERAGE[20](CLOSE))
    
    RETURN ACHAT
    #173505 quote
    NicolasNicolas
    Keymaster
    Legend

    Il faut tester la différence entre le Close lors de l’événement ACHAT et de l’événement SORTIE

    if ACHAT then 
     prixAchat = close
    endif 
    if SORTIE then 
     diff = close-prixAchat 
     if diff<0 then 
      perte = perte +1
     else 
      gain = gain +1
     endif 
    endif

    Les moyennes s’obtiendraient avec :

    mperte = perte / (gain+perte)
    mgain = gain / (gain+perte)

    Non testé / vérifié.

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

Connaitre le nombre de positions gagnants et perdantes


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Ozons @ozons Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/12/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...