coder un Money Management

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54476 quote
    sailorman
    Participant
    Average

    Bonjour Nicolas,
    nouveau j’espère etre au bon endroit pour poser mon problème ,-) (n’ayant pas trouver sur le forum)
    je voudrais sur ce pro-order qui suit, inclure le calcul de gestion taille de position en fonction de mon capital en pourcentage,
    exemple : capital de 10 000€ => 10 lots     –      capital de 9 000€ => 9 lots    –   etc…
    Merci

    //————————————————————————-// Code principal : Trendfollower EUR/USD 5M//————————————————————————-// Timeframe M5// EURUSD (IG – Markets)// Spread 2 pips
    DEFPARAM CumulateOrders = FalseDEFPARAM FLATBEFORE = 080000DEFPARAM FLATAFTER = 210000
    IF (abs(close-open[8]) > 0.006) THENIF (close > open[8]) THENBUY 10 CONTRACTS AT MARKETSET STOP pLOSS 50SET TARGET pPROFIT 225ENDIF
    IF (close < open[8]) THENSELLSHORT 10 CONTRACTS AT MARKETSET STOP pLOSS 50SET TARGET pPROFIT 225ENDIFENDIF

    #54477 quote
    Nicolas
    Keymaster
    Master

    Il suffirait de faire une petite règle de 3 non ? 🙂

    Pour chaque 1000€, investir 1 lot, soit: 

    moncapital = 10000
    mylot = moncapital / 1000
    
    if conditionAchat then 
     buy mylot contract at market
    endif

    Si tu veux en plus ajouter le profit de la stratégie pour recalculer la taille de lot à chaque nouvelle position: 

    moncapital = 10000
    mylot = (moncapital+strategyprofit) / 1000
    
    if conditionAchat then 
     buy mylot contract at market
    endif

     

    #54480 quote
    sailorman
    Participant
    Average

    Génial Nicolas,

    je vais le mettre en application “test”

    Merci !

    #54484 quote
    sailorman
    Participant
    Average

    Je me permet de revenir vers toi nicolas :

    j’ai utiliser ta deuxième condition qui réutilise les gains (car le but est là ! )

    seulement quand il calcule dans le temps, il donne des positions avec virgule exemples :  2.36 lots

    je crains que cela ne passe pas chez le broker IG qui ne fait que des lots entier.

    comment puis-je résoudre c’est arrondi de position de lot ?

    Merci 

    Olivier

    #54486 quote
    Nicolas
    Keymaster
    Master

    Il désormais possible d’avoir des lots avec décimales sous ProOrder (donc avec IG ou PRT-CFD).

    Cependant, pour arrondir tu peux utiliser l’instruction ROUND:

    moncapital = 10000
    mylot = (moncapital+strategyprofit) / 1000
    
    if conditionAchat then 
     buy round(mylot) contract at market
    endif

     

     

    #54488 quote
    sailorman
    Participant
    Average

    Un grand merci pour cette info que je ne savait pas (décimal sous pro order)

    Merci pour ta réactivité (c’est très agréable) je te souhaite un bon week-end !!!

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

coder un Money Management


Support ProOrder

New Reply
Author
author-avatar
sailorman @sailorman Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by sailorman
8 years, 1 month ago.

Topic Details
Forum: Support ProOrder
Language: French
Started: 12/01/2017
Status: Active
Attachments: No files
Logo Logo
Loading...