Martingale positive évolutive

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #239352 quote
    lannoogeoffrey
    Participant
    Average

    Bonjour à tous,

    J’essai de coder une martingale positive, c’est à dire, on multiplie la mise par un facteur uniquement si le trade précédent est gagnant.

    j’applique le code suivant trouvé dans le forum déjà

    once n=0.25
    if positionperf(1)<=0 then 
    BUY n CONTRACT AT market
    else
    BUY n*1.1 contract at market
    endif

    Mais quand je fais le backtest, je me rends compte qu’il ne multiplie qu’une seule fois le nombre de lot de départ. Or je voudrais qu’il le fasse à chaque fois jusqu’à ce qu’il y ait un perdant, ou jusqu’à un certains nombre de trade gagnant d’affilé. Mais je n’arrive à rien de concluant.

    Merci d’avance.

    #239358 quote
    robertogozzi
    Moderator
    Master

    Essayez ceci:

    once n=0.25
    once x=n
    IF NotOnMarket THEN
      x=n
    ENDIF
    if positionperf(1)<=0 then
      BUY n CONTRACT AT market
    else
      x=x*1.1
       BUY x contract at market
    endif
    Iván González thanked this post
    #239368 quote
    lannoogeoffrey
    Participant
    Average

    Merci.
    Mais malheureusement il fait la même chose il commence à 0.25 € puis passe à 0.27 € et reste ensuite à 0.27 € jusqu’à une perte. Alors qu’il faudrait qu’il passe à 0.3, puis 0.33, …

    #239369 quote
    robertogozzi
    Moderator
    Master

    Supprimez ou commentez les lignes 3, 4 et 5.

    Iván González thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Martingale positive évolutive


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzi
1 year, 4 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 10/22/2024
Status: Active
Attachments: No files
Logo Logo
Loading...