[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Confused with Optimization results



PureBytes Links

Trading Reference Links

I asked this question while back but am still suffering from the same
problem.

Exclude = LastValue( Cum( Buy + Sell ) ) == 0;
Exclude = NOT ( Buy OR Sell );

Neither of the above does not seems to exclude statistics for the stock
with no trade. I'm using Version 3.80.2.

I backtested a portfolio comprised of two stocks, Stock1 and Stock2.
If there was no trade for STOCK2, I'd expect "Overall performance summary" 
and "Performance for Stock1 " were the same but they are NOT.

Is anyone kind enough to take a look at the attachment and tell me what I'm doing wrong?

sincerely,


--- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> Hello,
> 
> One more information, this line was a little bit tricky because of 
a bug
> in 3.7x. With version 3.80 (official) you can use simpler:
> 
> Exclude = NOT ( Buy OR Sell );
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
Title: AmiBroker System Test Report




  
  
    Settings
  
     
  
    Initial Equity:
    10000000
    
    Periodicity/Positions:
    Daily/Long 
  
    Commissions:
    0.00 %
    
    Annual interest rate:
    0.00%
  
    Long trades
  
    Buy price:
    Open
    
    Sell price:
    Open
  
    Buy delay:
    1
    
    Sell delay:
    1
  
    Short trades
  
    Short price:
    Open
    
    Cover price:
    Open
  
    Short delay:
    1
    
    Cover delay:
    1
  
    Stops
  
    Maximum loss:
    disabled
    
    Profit target:
    disabled
  
    Value:
    0.00
    
    Value:
    0.00
  
    Exit at stop?
    no
    
    Exit at stop?
    no


  
  
    Formula 
Buy = Cross(Close, MA(Close, 50)) AND Volume > 1000000; 
Sell = Cross(MA(Close, 50), Close); 
 
Buy = ExRem (Buy, Sell); 
Sell = ExRem (Sell, Buy); 
 
Exclude = NOT ( Buy OR Sell );


  
  
    Overall performance summary
  
     
  
    Total net profit:
    -4338674.75
     
    Total commissions paid:
    0.00
  
    Return on account:
    -21.69 % 
     
    Open position gain/loss
    0.00
  
    Buy&Hold profit:
    67319029.38
     
    Bars (avg. days) in test:
    5684 (4069)
  
    Buy&Hold % return:
    336.60%
     
    System to Buy&Hold index:
    -106.44%
  
     
  
    Annual system % return:
    -2.17%
     
    Annual B&H % return:
    14.13%
  
     
  
    System drawdown:
    -4990338.09
     
    B&H drawdown:
    -1458333.33
  
    Max. system drawdown:
    -6185990.26
     
    B&H max. drawdown:
    -134513888.89
  
    Max. system % drawdown:
    -55.25%
     
    B&H max. % drawdown:
    -94.03%
  
    Max. trade drawdown:
    -2105978.26
     
     
     
  
    Max. trade % drawdown:
    -20.13%
     
     
     
  
    Trade drawdown:
    -1154891.30
     
     
     
  
     
  
    Total number of trades:
    7
     
    Percent profitable:
    0.0%
  
    Number winning trades:
    0
     
    Number losing trades:
    7
  
    Profit of winners:
    0.00
     
    Loss of losers:
    -4338674.75
  
    Total # of bars in winners:
    0
     
    Total # of bars in losers:
    77
  
    Commissions paid in winners:
    0.00
     
    Commissions paid in losers:
    0.00
  
     
  
    Largest winning trade:
    0.00
     
    Largest losing trade:
    -1290760.87
  
    # of bars in largest winner:
    0
     
    # bars in largest loser:
    30
  
    Commission paid in largest winner:
    0.00
     
    Commission paid in largest loser:
    0.00
  
     
  
    Average winning trade:
    N/A
     
    Average losing trade:
    -619810.68
  
    Avg. # of bars in winners:
    N/A
     
    Avg. # bars in losers:
    11.0
  
    Avg. commission paid in winner:
    N/A
     
    Avg. commission paid in loser:
    0.00
  
    Max consec. winners:
    0
     
    Max consec. losers:
    7
  
     
  
    Bars out of the market:
    5606
     
    Interest earned:
    0.00
  
     
  
    Exposure:
    1.4%
     
    Risk adjusted ann. return:
    -158.11%
  
    Ratio avg win/avg loss:
    1.#R
     
    Avg. trade (win & loss):
    -619810.68
  
    Profit factor:
    0.00
     
    
    



  
  
    Performance for Stock1 
  
     
  
    Total net profit:
    -4338674.75
     
    Total commissions paid:
    0.00
  
    Return on account:
    -43.39 % 
     
    Open position gain/loss
    0.00
  
    Buy&Hold profit:
    -208333.33
     
    Bars (days) in test:
    4808 (6815)
  
    Buy&Hold % return:
    -2.08%
     
    System to Buy&Hold index:
    -1982.56%
  
     
  
    Annual system % return:
    -3.00%
     
    Annual B&H % return:
    -0.11%
  
     
  
    System drawdown:
    -4990338.09
     
    B&H drawdown:
    -1458333.33
  
    Max. system drawdown:
    -6185990.26
     
    B&H max. drawdown:
    -134513888.89
  
    Max. system % drawdown:
    -55.25%
     
    B&H max. % drawdown:
    -94.03%
  
    Max. trade drawdown:
    -2105978.26
     
     
     
  
    Max. trade % drawdown:
    -20.13%
     
     
     
  
    Trade drawdown:
    -1154891.30
     
     
     
  
     
  
    Total number of trades:
    7
     
    Percent profitable:
    0.0%
  
    Number winning trades:
    0
     
    Number losing trades:
    7
  
    Profit of winners:
    0.00
     
    Loss of losers:
    -4338674.75
  
    Total # of bars in winners:
    0
     
    Total # of bars in losers:
    77
  
    Commissions paid in winners:
    0.00
     
    Commissions paid in losers:
    0.00
  
     
  
    Largest winning trade:
    0.00
     
    Largest losing trade:
    -1290760.87
  
    # of bars in largest winner:
    0
     
    # bars in largest loser:
    30
  
    Commission paid in largest winner:
    0.00
     
    Commission paid in largest loser:
    0.00
  
     
  
    Average winning trade:
    N/A
     
    Average losing trade:
    -619810.68
  
    Avg. # of bars in winners:
    N/A
     
    Avg. # bars in losers:
    11.0
  
    Avg. commission paid in winner:
    N/A
     
    Avg. commission paid in loser:
    0.00
  
    Max consec. winners:
    0
     
    Max consec. losers:
    7
  
     
  
    Bars out of the market:
    4731
     
    Interest earned:
    0.00
  
     
  
    Exposure:
    1.6%
     
    Risk adjusted ann. return:
    -187.39%
  
    Ratio avg win/avg loss:
    1.#R
     
    Avg. trade (win & loss):
    -619810.68
  
    Profit factor:
    0.00
     
    
    



  
  
    Trade list for Stock1 
  
    Trade
    Entry date
    Exit date
    Net Profit
    Equity value
  
    Long
    1990/02/14
    1990/03/20
    -489130.43
    9510869.57
  
    Long
    1990/05/16
    1990/06/26
    -1290760.87
    8220108.70
  
    Long
    1990/09/17
    1990/09/18
    -603310.73
    7616797.97
  
    Long
    1992/07/03
    1992/07/20
    -911870.18
    6704927.79
  
    Long
    1995/11/07
    1995/11/09
    -358985.77
    6345942.02
  
    Long
    1995/11/13
    1995/11/15
    -440243.02
    5905699.00
  
    Long
    2000/04/20
    2000/04/21
    -244373.75
    5661325.25


  
  
    Performance for Stock2 
  
     
  
    Total net profit:
    0.00
     
    Total commissions paid:
    0.00
  
    Return on account:
    0.00 % 
     
    Open position gain/loss
    0.00
  
    Buy&Hold profit:
    67527362.71
     
    Bars (days) in test:
    876 (1324)
  
    Buy&Hold % return:
    675.27%
     
    System to Buy&Hold index:
    -100.00%
  
     
  
    Annual system % return:
    0.00%
     
    Annual B&H % return:
    75.88%
  
     
  
    System drawdown:
    0.00
     
    B&H drawdown:
    -273469.98
  
    Max. system drawdown:
    0.00
     
    B&H max. drawdown:
    -51338985.86
  
    Max. system % drawdown:
    0.00%
     
    B&H max. % drawdown:
    -55.84%
  
    Max. trade drawdown:
    0.00
     
     
     
  
    Max. trade % drawdown:
    0.00%
     
     
     
  
    Trade drawdown:
    0.00
     
     
     
  
     
  
    Total number of trades:
    0
     
    Percent profitable:
    N/A%
  
    Number winning trades:
    0
     
    Number losing trades:
    0
  
    Profit of winners:
    0.00
     
    Loss of losers:
    0.00
  
    Total # of bars in winners:
    0
     
    Total # of bars in losers:
    0
  
    Commissions paid in winners:
    0.00
     
    Commissions paid in losers:
    0.00
  
     
  
    Largest winning trade:
    0.00
     
    Largest losing trade:
    0.00
  
    # of bars in largest winner:
    0
     
    # bars in largest loser:
    0
  
    Commission paid in largest winner:
    0.00
     
    Commission paid in largest loser:
    0.00
  
     
  
    Average winning trade:
    N/A
     
    Average losing trade:
    N/A
  
    Avg. # of bars in winners:
    N/A
     
    Avg. # bars in losers:
    N/A
  
    Avg. commission paid in winner:
    N/A
     
    Avg. commission paid in loser:
    N/A
  
    Max consec. winners:
    0
     
    Max consec. losers:
    0
  
     
  
    Bars out of the market:
    875
     
    Interest earned:
    0.00
  
     
  
    Exposure:
    0.1%
     
    Risk adjusted ann. return:
    0.00%
  
    Ratio avg win/avg loss:
    1.#R
     
    Avg. trade (win & loss):
    N/A
  
    Profit factor:
    1.#R
     
    
    



  
  
    Trade list for Stock2 
  
    Trade
    Entry date
    Exit date
    Net Profit
    Equity value