Detailed Report nothing like Equity Curve

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #133223 quote
    GraHal
    Participant
    Master

    Anybody any ideas how / why the attached backtest results and Detailed Report bear no resemblance to  the equity curve attached when I click on a row in the Backtest results Table??

    Spread = 4

    DEFPARAM CUMULATEORDERS = False
    //CandleStick Analysis Tool
    //
    CloseLevel = A4 //Close price as % of Range
    BodyLevel = A5 //Total body size as % of Range
    ATRPeriod = A6 //Period to be used for ATR Rising filter
    Spread = 4 //Spread for market being analysed
    ATROn = 0 //Tick to apply ATRRising filter within analyse
    //
    //CandleStick Analysis Tool can be used to analyse the effect that candlestick bodysize and close position within range has on the next candle closing in the same direction. An AverageTrue Range filter can also be applied to analyse the benefits or disadvantage of this. The Equity +/- is calculated on close of position after one candle. Spread is deducted from each position.
    
    //Average True Range Calculation
    ATR = AveragetrueRange[ATRPeriod]
    ATRRising = ATR[1] < ATR
    
    //Body % Calculation
    BodyPerc = ((ABS(close[1] - open[1]))/(High[1]-Low[1]))*100
    
    //Close % Calculation
    IF close[1] > Open[1] THEN
    ClosePerc = ((Close[1] - Low[1])/(High[1] - Low[1]))*100
    ENDIF
    
    IF close[1] < Open[1] THEN
    ClosePerc = ((High[1] - Close[1])/(High[1] - Low[1]))*100
    ENDIF
    
    //Analysis including ATR Filter
    IF ATROn THEN
    //Up Candle followed by Up Candle
    IF BodyPerc > BodyLevel and close[1] > open[1] and close > close[1] and ClosePerc > CloseLevel and ATRRising THEN
    Win = Win + 1
    Count = Count + 1
    Amount = Amount + ((Close - close[1])-Spread)
    ENDIF
    
    //Up Candle followed by Down Candle
    IF BodyPerc > BodyLevel and close[1] > open[1] and close < close[1] and ClosePerc > CloseLevel and ATRRising THEN
    Count = Count + 1
    Amount = Amount - ((Close[1] - close)+Spread)
    ENDIF
    
    //Down Candle followed by Down Candle
    IF BodyPerc > BodyLevel and close[1] < open[1] and close < close[1] and ClosePerc > CloseLevel and ATRRising THEN
    Win = Win + 1
    Count = Count + 1
    Amount = Amount + ((Close[1] - close)-Spread)
    ENDIF
    
    //Down Candle followed by Up Candle
    IF BodyPerc > BodyLevel and close[1] < open[1] and close > close[1] and ClosePerc > CloseLevel and ATRRising THEN
    Count = Count + 1
    Amount = Amount - ((Close - close[1])+Spread)
    ENDIF
    
    //Analysis without ATR Filter
    ELSE
    //Up Candle followed by Up Candle
    IF BodyPerc > BodyLevel and close[1] > open[1] and close > close[1] and ClosePerc > CloseLevel THEN
    Win = Win + 1
    Count = Count + 1
    Amount = Amount + ((Close - close[1])-Spread)
    ENDIF
    
    //Up Candle followed by Down Candle
    IF BodyPerc > BodyLevel and close[1] > open[1] and close < close[1] and ClosePerc > CloseLevel THEN
    Count = Count + 1
    Amount = Amount - ((Close[1] - close)+Spread)
    ENDIF
    
    //Down Candle followed by Down Candle
    IF BodyPerc > BodyLevel and close[1] < open[1] and close < close[1] and ClosePerc > CloseLevel THEN
    Win = Win + 1
    Count = Count + 1
    Amount = Amount + ((Close[1] - close)-Spread)
    ENDIF
    
    //Down Candle followed by Up Candle
    IF BodyPerc > BodyLevel and close[1] < open[1] and close > close[1] and ClosePerc > CloseLevel THEN
    Count = Count + 1
    Amount = Amount - ((Close - close[1])+Spread)
    ENDIF
    ENDIF
    
    //Win Rate as %
    WinRate = (Win/Count) * 100
    
    If WinRate > A88 Then
    Buy at Market
    Endif
    
    If longonmarket and barindex > Tradeindex + A92 and positionperf > 0 Then
    Sell at market
    endif
    
    //Return WinRate coloured (0,0,0) Style(Line,2) as "Win Rate", Win coloured (0,255,0) Style(Line,1) as "Wins", Count coloured (255,0,0) Style(Line,1) as "Bets", Amount coloured (0,0,255) Style(Line,1) as "Equity +/-"
    
    Body.jpg Body.jpg Body-2.jpg Body-2.jpg body3.jpg body3.jpg Body.itf
    #133229 quote
    Vonasi
    Moderator
    Master

    In what way different? If there is a trade still open then the equity curve will be different to the results report as that trade is not included in the results report but is shown on the equity curve.

    #133233 quote
    GraHal
    Participant
    Master

    Just testing!! 🙂 🙂

    I thought you might come up with the answer!!

    Cheers

    #133254 quote
    nonetheless
    Participant
    Master

    Is it a tick by tick issue? How can the total loss be  £11.50 but in April the equity dips below £4000?

    #133256 quote
    nonetheless
    Participant
    Master

    This is what I get with those values.

    GraHal thanked this post
    body-1.jpg body-1.jpg
    #133280 quote
    GraHal
    Participant
    Master

    Is it a tick by tick issue?

    No it wasn’t tick by tick not enabled.

    Your test was over 200k bars and so your equity curve looks well different to mine.

    Sort trades by max Number of bars and check the MAE … just shows that if we have deep enough pockets and sit it out … then we could be Warren Buffet also!!?? 🙂

    (I was feeling a bit rough yesterday, hence me putting the conundrum on here rather than thinking it out, but after Vonasi gave the reason I recalled that the same scenario had tripped me up in the past! 

    Note to Self  – a Live Trade does NOT show in backtest results but live trades DO show on the equity curve) 

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

Detailed Report nothing like Equity Curve


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by GraHal
5 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/25/2020
Status: Active
Attachments: 5 files
Logo Logo
Loading...