Profit and Loss statistics can be manipulated as attributes, and accessed from a query.

Each term can be modified to specify some subset of answers upon which to calculate
the statistics.  The modifiers use the following form, ( which is more easily understood
by looking at the menus ).

TERM [  [ only ( Open | Close ) | ( Short | Long ) ]  | <symbol> | from <order block> ]

    for example:  

  • num_trades only Open - will return the number of open trades.
  • num_trades only Short - will return the number of short trades made.
  • num_trades of IBM - will return the number of trades of IBM.
  • num_trades from 1.1:  - will return trades from order block 1.1.

At the bottom of this document, is a query which "shows" these variables.  
Note that the group of terms Average Period Statistics, which includes:

  • avg_ret_period
  • compound_ret_period
  • pct_periods_new_high
  • stddev_of_period_returns
  • sharpe_ratio
  • zstat 
  • standard_error
  • std_error_ratio
  • geom_error_ratio

All require time period modifiers to equal the default output of the P & L Statistics Report

 

Statistical Term          Description
avail_equity                     Avail Equity
avg_consec_lose_periods          Avg Consec Lose Periods
avg_consec_lose_trades           Avg Consec Lose Trades
avg_consec_win_periods           Avg Consec Win Periods
avg_consec_win_trades            Avg Consec Win Trades
avg_lose_trade_length            Avg Lose Trades Length
avg_profit_lose_trade            Avg Profit Lose Trade
avg_profit_trade                 Avg Profit Trade
avg_profit_win_trade             Avg Profit Win Trade
avg_ret_period                   Avg Return Period
avg_trade_length                 Avg Trades Length
avg_win_trade_length             Avg Win Trades Length
biggest_loss                     Biggest Loss
biggest_win                      Biggest Win
closed_equity                    Closed Equity
commission                       Commission
compound_ret_period              Compound Return Period
entry_date                       Entry Date
entry_price                      Entry Price
entry_time                       Entry Time
equity                           Equity
exit_date                        Exit Date
exit_price                       Exit Price
exit_time                        Exit Time
geom_error_ratio                 Geom Error Ratio
max_closed_equity                Max Closed Equity
max_consec_lose_periods          Max Consec Lose Periods
max_consec_lose_trades           Max Consec Lose Trades
max_consec_win_periods           Max Consec Win Periods
max_consec_win_trades            Max Consec Win Trades
max_contracts                    Max Contracts
max_drawdown                     Max Draw Down
max_drawdown_per_trade           Max Draw Down Per Trade
max_open_equity                  Max Open Equity
max_open_loss                    Max Open Loss
min_closed_equity                Min Closed Equity
min_exit_equity                  Min Exit Equity
min_open_equity                  Min Open Equity
num_closed_trades                Num Closed Trades
num_contracts                    Num Contracts
num_lose_periods                 Num Lose Periods
num_lose_trades                  Num Lose Trades
num_periods                      Num Periods
num_trades                       Num Trades
num_win_periods                  Num Win Periods
num_win_trades                   Num Win Trades
open_equity                      Open Equity
original_entry_date              Original Entry Date
original_entry_time              Original Entry Time
pct_lose_periods                 Percent Lose Periods
pct_lose_trades                  Percent Lose Trades
pct_new_high_trades              Percent New Equity High Trades
pct_new_low_trades               Percent New Equity Low Trades
pct_periods_invested             Percent Periods Invested
pct_periods_new_high             Pct Periods New High
pct_win_periods                  Percent Win Periods
pct_win_trades                   Pct Win Trades
performance_ratio                Performance Ratio
pessimistic_return               Pessimistic Return
profit_factor                    Profit Factor
ratio_avg                        Ratio Avg
sharpe_ratio                     Sharpe Ratio
slippage                         Slippage
standard_error                   Standard Error
std_error_ratio                  Standard Error Ratio
stddev_of_period_returns         Stand Deviation Of Return Period
zstat                            Zstat

 


    1: ORDER 
     1.1: Buy 1 contract of CCE 
       Enter on the market 
   WHEN 
       Date is within 10 years 
     AND 
       Close of CCE is more than exponential_average ( Close of CCE, 0.0476 ) 
       * (1 - 0.02) 
     AND 
       Close of CCE is less than exponential_average ( Close of CCE, 0.0476 ) 
       * (1 + 0.02) 
     AND 
       Close of CCE is DEFINED 
     AND 
       Low of CCE crosses below exponential_average ( Close of CCE, 0.0476 ) * 
       (1 - 0.02) 
   EXIT 
       Date is 3/10/98 

   2: ORDER
     2.1: Sell 1 contract of CCE
       Enter on the market
   WHEN
       Date is within 10 years
     AND
       Close of CCE is more than exponential_average ( close of CCE, 0.0476 )
       * (1 - 0.02)
     AND
       Close of CCE is less than exponential_average ( Close of CCE, 0.0476 )
       * (1 + 0.02)
     AND
       Close of CCE is DEFINED
     AND
       High of CCE crosses above exponential_average ( Close of CCE, 0.0476 )
       * (1 + 0.02)
   EXIT
       Date is 3/10/98

   SHOW
#Trades Statistics                 

     NumTrades: num_trades 
     NumClosedTrades: num_closed_trades 
     NumWinTrades: num_win_trades 
     PctWinTrades: pct_win_trades 
     MaxConsecWinTrades: max_consec_win_trades 
     AvgConsecWinTrades: avg_consec_win_trades 
   WHEN
       Date is within 1 day

   SHOW
     PercentNewEquityHighTrades: pct_new_high_trades 
     NumLoseTrades: num_lose_trades 
     PercentLoseTrades: pct_lose_trades 
     MaxConsecLoseTrades: max_consec_lose_trades 
     AvgConsecLoseTrades: avg_consec_lose_trades 
     PercentNewEquityLowTrades: pct_new_low_trades 
   WHEN
       Date is within 1 day

   SHOW
#Period Statistics                 

     NumPeriods: num_periods 
     NumWinPeriods: num_win_periods 
     PercentWinPeriods: pct_win_periods 
     MaxConsecWinPeriods: max_consec_win_periods 
     AvgConsecWinPeriods: avg_consec_win_periods 
   WHEN
       Date is within 1 day

   SHOW
     NumLosePeriods: num_lose_periods 
     PercentLosePeriods: pct_lose_periods 
     MaxConsecLosePeriods: max_consec_lose_periods 
     AvgConsecLosePeriods: avg_consec_lose_periods 
     PercentPeriodsInvested: pct_periods_invested 
   WHEN
       Date is within 1 day

   SHOW
#Length Statistics                

     AvgTradesLength: avg_trade_length 
     AvgWinTradesLength: avg_win_trade_length 
     AvgLoseTradesLength: avg_lose_trade_length 
   WHEN
       Date is within 1 day

   SHOW
# Contract Statistics                

     NumContracts: num_contracts 
     MaxContracts: max_contracts 
   WHEN
       Date is within 1 day

   SHOW
#  Average Period Statistics                

     AvgReturnPeriod: 1 month avg_ret_period 
     CompoundReturnPeriod: 1 month compound_ret_period 
     PctPeriodsNewHigh: 1 month pct_periods_new_high 
     StandDeviationOfReturnPeriod: 1 month stddev_of_period_returns 
     SharpeRatio: 1 month sharpe_ratio 
   WHEN
       Date is within 1 day

   SHOW
     Zstat: 1 month zstat 
     StandardError: 1 month standard_error 
     StandardErrorRatio: 1 month std_error_ratio 
     GeomErrorRatio: 1 month geom_error_ratio 
   WHEN
       Date is within 1 day

   SHOW
#  Average Trade Statistics                

     AvgProfitTrade: avg_profit_trade 
     AvgProfitWinTrade: avg_profit_win_trade 
     AvgProfitLoseTrade: avg_profit_lose_trade 
     RatioAvg: ratio_avg 
     ProfitFactor: profit_factor 
     PessimisticReturn: pessimistic_return 
     PerformanceRatio: performance_ratio 
   WHEN
       Date is within 1 day

   SHOW
# Extreme Statistics               

     BiggestWin: biggest_win 
     BiggestLoss: biggest_loss 
     MaxOpenLoss: max_open_loss 
     MaxOpenEquity: max_open_equity 
     MinOpenEquity: min_open_equity 
     MaxClosedEquity: max_closed_equity 
   WHEN
       Date is within 1 day

   SHOW
     MinClosedEquity: min_closed_equity 
     MaxDrawDown: max_drawdown 
     MaxDrawDownPerTrade: max_drawdown_per_trade 
     MinExitEquity: min_exit_equity 
   WHEN
       Date is within 1 day

   SHOW
#  Final Statistics                 

     ClosedEquity: closed_equity 
     OpenEquity: open_equity 
     Equity: equity 
     Commission: commission 
     Slippage: slippage 
     AvailEquity: avail_equity 
   WHEN
       Date is within 1 day

 

   SHOW
#  Entry Statistics        

 

     EntryPrice: entry_price 
     OriginalEntryDate: original_entry_date 
     EntryDate: entry_date 
     OriginalEntryTime: original_entry_time 
     EntryTime: entry_time 
   WHEN
       Date is within 1 day

   SHOW
# Exit Statistics                

     ExitPrice: exit_price 
     ExitDate: exit_date 
     ExitTime: exit_time 
   WHEN
       Date is within 1 day
   

Back to XMIM Examples, Reference Tables and Special Queries