Réinvestissement des gains

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #197212 quote
    Damien82
    Participant
    New

    Bonjour à tous,

    Je souhaiterais savoir si quelqu’un aurait le code pour le réinvestissement des gains ?

    Merci beaucoup !

    Mes meilleures salutations

    Damien

    #199841 quote
    robertogozzi
    Moderator
    Master

    Fait:

    ////////////////////////////////////////////////////////////////////////
    // Gestion de la taille des lots (avec réinvestissement)
    ////////////////////////////////////////////////////////////////////////
    ONCE LotManagement = 1          //1=enable LOT size management
    ONCE MyCapital     = 10000      //10000  Capital invested
    ONCE MinLots       = 1          //1      min lots
    ONCE MaxLots       = 999        //999    max lots
    ONCE InitialSize   = 1
    ONCE LotSize       = InitialSize
    NT = (OnMarket AND Not OnMarket[1]) OR (LongOnMarket AND ShortOnMarket[1]) OR (LongOnMarket[1] AND ShortOnMarket)
    IF LotManagement AND (Not OnMarket OR NT) THEN
       MyEquity        = MyCapital + StrategyProfit
       MyInvestment    = MyEquity / MyCapital
       TempLot         = floor(InitialSize * MyInvestment,1)
       LotSize         = min(MaxLots,max(MinLots,TempLot))
    ENDIF
    ////////////////////////////////////////////////////////////////////////
    //              Exemple de stratégie
    //
    if close crosses over average[100,0](close) and not onmarket THEN
       buy LotSize contracts at market
    elsif close crosses under average[100,0](close) and not onmarket THEN
    sellshort LotSize contracts at market
    endif
    set target pprofit 300
    set stop   ploss   100
    graph LotSize

    Voici les paramètres à utiliser :

    • LotManagement       1 = activer le réinvestissement, 0 = le désactiver
    • MyCapital                  Capital initial investi pour cette stratégie
    • MinLots                     Nombre minimum de lots requis
    • MaxLots                    Nombre maximum de lots (999 est recommandé)
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Réinvestissement des gains


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Damien82 @damien82 Participant
Summary

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

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