Ordres d'achat successifs

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #42356 quote
    Alain FedermannAlain Federmann
    Participant
    New

    Bonjour à tous,

    Pourriez vous m’indiquer si il est possible de créer un backtest avec des ordres d’achat successifs.

    Je voudrais par exemple, après être entré sur le marché, rajouter une position à l’achat si le cours baisse de 20%.

    J’ai fait ça pour tester mais ça ne fonctionne pas.

    MyRSI = RSI[14](Close)
    MyBollingerDown = BollingerDown[25](Close)
    IF NOT LongOnMarket THEN
    IF MyRSI < 30 AND Close < MyBollingerDown THEN
    ha=close
    BUY 2000 CASH AT MARKET
    IF close<(ha*0.8) THEN
    ha=close
    BUY 2000 CASH AT MARKET
    ENDIF
    ENDIF
    ENDIF
    
    SET TARGET %PROFIT 20

    Merci par avance de votre aide.

    #42366 quote
    Alain FedermannAlain Federmann
    Participant
    New

    J’ai trouvé, il fallait utiliser TRADEPRICE pour avoir le prix lors de la dernière transaction. 🙂

    Nicolas thanked this post
    #42387 quote
    bertholomeobertholomeo
    Participant
    Veteran

    Bonjour Alain,

    J’ai un backtest avec toutes mes conditions d’achats et de ventes mais je souhaiterai ajouté une position à l’achat si le cours baisse (et inversement).
    Pouvez vous me donner le code à ajouter à mon backtest ?
    Merci

    #42776 quote
    Alain FedermannAlain Federmann
    Participant
    New

    Bonjour bertholomeo,

    Je découvre à peine PRT, je ne suis pas sûr d’avoir le niveau pour vous aider.

    Mais cela devrait ressembler à :

    IF close < TRADEPRICE*0.8 THEN

    …

    Ceci devrait permettre au black test de racheter si le cours devient inférieur de 20% à votre prix d’achat.

     

Viewing 4 posts - 1 through 4 (of 4 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

Ordres d'achat successifs


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Alain FedermannAlain Federmann
9 years, 2 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 08/02/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...