Test performance algo trading

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #252721 quote
    Dom100
    Participant
    New

    Bonjour,

    j’ai un algorithme de trading qui fonctionne la nuit (DEFPARAM FLATBEFORE = 000600 DEFPARAM FLATAFTER = 090000).

    Il a un arrêt automatique (QUIT) si le gain de la nuit est supérieur à 100,00$ ou la perte supérieure à 100$ (IF STRATEGYPROFIT >= 150 OR STRATEGYPROFIT <= -100 THEN QUIT ENDIF).

    Comment puis-je tester cet algorithme sur plusieurs mois, tout en conservant l’arrêt automatique sur la performance de la journée. Je peux le tester en enlevant les conditions de gain ou perte journalière mais le résultat n’est pas précis.

    Merci par avance pour votre réponse

    #252727 quote
    robertogozzi
    Moderator
    Master

    Vous pouvez le faire aussi longtemps que vous le souhaitez, mais vous devez le relancer à chaque fois que vous l’interrompez avec QUIT.

    Si, toutefois, vous souhaitez qu’il s’arrête pour le reste de la journée, mais reprenne automatiquement le lendemain, vous devez utiliser une variable comme dans cet exemple (TradeON) :

    DEFPARAM FLATBEFORE = 000600  //00:06
    DEFPARAM FLATAFTER  = 090000  //09:00
    ONCE TradeON      = 1
    ONCE MaxProfit    = 100
    ONCE MaxLoss      = MaxProfit //or 100, or 150, etc...
    IF ((StrategyProfit - StrategyProfit[1]) >= MaxProfit) OR ((StrategyProfit - StrategyProfit[1]) <= -MaxLoss) THEN
       SELL AT MARKET
       EXITSHORT AT MARKET
       TradeON = 0
    ENDIF
    IF IntraDayBarIndex = 0 THEN
       TradeON = 1
    ENDIF
    Sma               = average[20,0](close)
    MyLongConditions  = Not OnMarket AND TradeON AND close CROSSES OVER  Sma
    MyShortConditions = Not OnMarket AND TradeON AND close CROSSES UNDER Sma
    IF MyLongConditions THEN
       BUY 1 CONTRACT AT MARKET
    ELSIF MyShortConditions THEN
       SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    SET STOP   %LOSS   0.3   //0.3%
    SET TARGET %PROFIT 0.6   //0.6%
    Iván González thanked this post
    #252732 quote
    Dom100
    Participant
    New

    Merci beaucoup, cela me paraît excellent je vais l’essayer.

    #252745 quote
    Dom100
    Participant
    New

    Bonjour j’ai testé ce programme mais pour moi il ne fonctionne pas.

    Je l’ai essayé sur le micro ES entre le premier septembre et le 17 octobre sur des barres de 5 min. Il ne respecte pas la condition max profit limitée à 100 dollars. Peut-être faut-il changer l’unité de temps dans le programme car on travaille à la fois sur des jours et sur des périodes de 5 min ?

    #252801 quote
    robertogozzi
    Moderator
    Master

    STRATEGYPROFIT se met à jour à la clôture d’une transaction, vous ne pouvez donc pas limiter vos gains ni vos pertes.
    Utilisez cette version modifiée ; elle est plus simple et clôture chaque transaction lorsque vous atteignez un gain ou une perte de 100 € ou -100 €. Elle peut également clôturer à l’heure spécifiée:

    DEFPARAM FLATBEFORE = 000600   //00:06
    DEFPARAM FLATAFTER  = 090000   //09:00
    ONCE TradeON      = 1
    ONCE MaxProfit    = 100
    ONCE MaxLoss      = MaxProfit //or 100, or 150, etc...
    IF IntraDayBarIndex = 0 THEN
       TradeON = 1
    ENDIF
    Sma               = average[20,0](close)
    MyLongConditions  = Not OnMarket AND TradeON AND close CROSSES OVER  Sma
    MyShortConditions = Not OnMarket AND TradeON AND close CROSSES UNDER Sma
    IF MyLongConditions THEN
       BUY 1 CONTRACT AT MARKET
       TradeON = 0
    ELSIF MyShortConditions THEN
       SELLSHORT 1 CONTRACT AT MARKET
       TradeON = 0
    ENDIF
    SET STOP   $LOSS   MaxLoss
    SET TARGET $PROFIT MaxProfit
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Test performance algo trading


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Dom100 @dom100 Participant
Summary

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

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