TradeSummary#

tradeexecutor.analysis.trade_analyser.TradeSummary Python class in Trading Strategy framework.

class TradeSummary[source]#

Bases: object

Some generic statistics over all the trades

__init__(won, lost, zero_loss, stop_losses, undecided, realised_profit, open_value, uninvested_cash, initial_cash, extra_return, duration, average_winning_trade_profit_pc, average_losing_trade_loss_pc, biggest_winning_trade_pc, biggest_losing_trade_pc, average_duration_of_winning_trades, average_duration_of_losing_trades, time_bucket=None, average_trade=None, median_trade=None, max_pos_cons=None, max_neg_cons=None, max_pullback=None, max_loss_risk=None, max_realised_loss=None, avg_realised_risk=None, take_profits=0, trade_volume=0.0, lp_fees_paid=0, lp_fees_average_pc=0, daily_returns=None)#
Parameters:
Return type:

None

Methods

__init__(won, lost, zero_loss, stop_losses, ...)

from_dict(kvs, *[, infer_missing])

from_json(s, *[, parse_float, parse_int, ...])

get_basic_plots()

Show basic plots

get_basic_stats()

Show basic stats only

get_full_plots()

Show basic and advanced plots

get_full_report()

Show basic and advanced stats and plots

get_full_stats()

Show basic and advanced stats

schema(*[, infer_missing, only, exclude, ...])

show()

Render a summary table in IPython notebook.

to_dataframe()

Convert the data to a human readable summary table.

to_dict([encode_json])

to_json(*[, skipkeys, ensure_ascii, ...])

Attributes

won

lost

zero_loss

stop_losses

undecided

realised_profit

open_value

uninvested_cash

initial_cash

extra_return

duration

average_winning_trade_profit_pc

average_losing_trade_loss_pc

biggest_winning_trade_pc

biggest_losing_trade_pc

average_duration_of_winning_trades

average_duration_of_losing_trades

time_bucket

total_positions

win_percent

return_percent

annualised_return_percent

all_stop_loss_percent

lost_stop_loss_percent

all_take_profit_percent

won_take_profit_percent

average_net_profit

end_value

average_trade

median_trade

max_pos_cons

max_neg_cons

max_pullback

max_loss_risk

max_realised_loss

avg_realised_risk

take_profits

trade_volume

lp_fees_paid

lp_fees_average_pc

daily_returns

advanced users can use this property instead of the provided quantstats helper methods

daily_returns: Optional[Series]#

advanced users can use this property instead of the provided quantstats helper methods

to_dataframe()[source]#

Convert the data to a human readable summary table.

Return type:

DataFrame

show()[source]#

Render a summary table in IPython notebook.

get_full_report()[source]#

Show basic and advanced stats and plots

get_basic_stats()[source]#

Show basic stats only

get_full_stats()[source]#

Show basic and advanced stats

get_basic_plots()[source]#

Show basic plots

get_full_plots()[source]#

Show basic and advanced plots

__init__(won, lost, zero_loss, stop_losses, undecided, realised_profit, open_value, uninvested_cash, initial_cash, extra_return, duration, average_winning_trade_profit_pc, average_losing_trade_loss_pc, biggest_winning_trade_pc, biggest_losing_trade_pc, average_duration_of_winning_trades, average_duration_of_losing_trades, time_bucket=None, average_trade=None, median_trade=None, max_pos_cons=None, max_neg_cons=None, max_pullback=None, max_loss_risk=None, max_realised_loss=None, avg_realised_risk=None, take_profits=0, trade_volume=0.0, lp_fees_paid=0, lp_fees_average_pc=0, daily_returns=None)#
Parameters:
Return type:

None