DrawDown Equity

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12055 quote
    Pascal
    Participant
    Average

    Bonjour,

    Je souhaite créer un indicateur graphique du drawdown equity.  Je vous soumets donc une stratégie (qui ne financera pas les prochaines vacances de Nicolas ou la nouvelle voiture d’Aston, puisque ce sont les siennes qui vont tout financer :D).

    Je n’ai pas réussit à trouver la bonne formule du pourcentage issu du résultat entre la balance et l’équité.

    Vous avez 2h ! hahA ! (SVP mettez au moins 2h, ça fait des jours que j’essaie)

    Defparam Cumulateorders = False
    
    Rem          [Points Pivots Journaliers] // Merci Noobywan, Aston
    
    If dayofweek <> 1 THEN
    Ht = DHigh(1)
    Bs = DLow(1)
    C = DClose(1)
    Endif
    If dayofweek=5 then
    Htfriday=Dhigh(0)
    BsFriday=Dlow(0)
    CFriday=Dclose(0)
    Endif
    If dayofweek=1 then
    Ht = Htfriday
    Bs = BsFriday
    C = CFriday
    Endif
    Pivot = (Ht + Bs + C) / 3
    Res3 = Pivot + ((Ht - Bs)*2)
    Res2 = Pivot + Ht - Bs
    Res1 = (2 * Pivot) - Bs
    //Sup1 = (2 * Pivot) - Ht
    //Sup2 = Pivot - (Ht - Bs)
    //Sup3 = Pivot - ((Ht - Bs)*2)
    
    Rem          [Détection de la Tendance]
    
    C1 = close > average[1000]
    
    Rem          [Réinitialisation]
    If intradaybarindex = 1 then
    UnTradeParJourRes1 = 0
    UnTradeParJourRes2 = 0
    UnTradeParJourRes3 = 0
    //UnTradeParJourPivot = 0
    //UnTradeParJourSup1 = 0
    //UnTradeParJourSup2 = 0
    //UnTradeParJourSup3 = 0
    Endif
    
    Rem          [Condition d'Achat]
    
    //If  C1 and close crosses over Sup3 and UnTradeParJourSup3 = 0 then
    //buy 10 contract at market
    //UnTradeParJourSup3= 1
    //Endif
    //If  C1 and close crosses over Sup2 and UnTradeParJourSup2= 0 then
    //buy 1 contract at market
    //UnTradeParJourSup2= 1
    //Endif
    //If  C1 and close crosses over Sup1 and UnTradeParJourSup1= 0 then
    //buy 1 contract at market
    //UnTradeParJourSup1= 1
    //Endif
    //If  C1 and close crosses over Pivot and UnTradeParJourPivot= 0 then
    //buy 1 contract at market
    //UnTradeParJourPivot= 1
    //Endif
    If  C1 and  close crosses over Res1 and UnTradeParJourRes1 = 0 then
    buy 10 contract at market
    UnTradeParJourRes1= 1
    Elsif C1 and  close crosses over Res2 and UnTradeParJourRes2 = 0 then
    buy 10 contract at market
    UnTradeParJourRes2= 1
    Elsif C1 and close crosses over Res3 and UnTradeParJourRes3= 0 then
    buy 10 contract at market
    UnTradeParJourRes3= 1
    Endif
    
    Rem          [Conditions de Sortie]
    
    If longonmarket and close < dlow(1) and dayofweek <> 1 then
    sell at market
    Elsif longonmarket and dayofweek = 1 and close < bsfriday then
    sell at market
    Endif
    
    Rem          [Drawdown Equity]
    
    Floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize + strategyprofit   // Thanks Grizzly, Nicolas
    DrawdownEquity = (((strategyprofit)/Floatingprofit)-1)*(-100)
    LevelZero = 0
    
    If DrawdownEquity > 0 then
    DrawdownEquityPositive = 1
    Else
    DrawdownEquityPositive = 0
    Endif
    
    If DrawdownEquityPositive = 1 then
    Red = 0
    Green = DrawdownEquity
    Else
    Green = 0
    Red = DrawdownEquity
    Endif
    
    Rem          [Graph]
    
    graph Green coloured (0,255,0)
    graph Red coloured (255,0,0)
    graph Levelzero coloured (0,0,0)
    
    DDE.png DDE.png
    #12083 quote
    Nicolas
    Keymaster
    Master

    Moi je verrai cela plutôt comme ça:

    InitialCapital = 10000
    Floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize
    DrawdownEquity = Floatingprofit/(strategyprofit+InitialCapital)*100

    On a ainsi la véritable équité en fonction des profits acquis et du capital initial. Ensuite on peut en déterminer en pourcentage le gain du/des trades actuels.

    Pascal thanked this post
    drawdown-equity-formula.png drawdown-equity-formula.png
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

DrawDown Equity


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Pascal @pascal Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 08/22/2016
Status: Active
Attachments: 2 files
Logo Logo
Loading...