{% set MAPPER = {'up': '上', 'down': '下', 'stock': '股票', 'future': '期貨'} %} {% macro render_fee_setting(type, setting) %}
{{ MAPPER[type] }}

手續費: {{ "%.6f"|format(fee_settings[type]["fee"]) }}%

交易稅: {{ "%.6f"|format(fee_settings[type]["tax"]) }}%

每筆交易固定成本: {{ "{:,.0f}".format(fee_settings[type]["per_trade_cost"]) }}

滑價設定:

{% endmacro %} K-Bar Chart
進出場點位
回測資訊
股票回測
手續費:{{ "%.6f"|format(fee_settings["stock"]["fee"]) }}
證交稅:{{ "%.6f"|format(fee_settings["stock"]["tax"]) }}
買入-滑價方向:{{ MAPPER[fee_settings["stock"]["slippage"]["buy"]["direction"]] }}
買入-滑價 Tick 數:{{ fee_settings["stock"]["slippage"]["buy"]["tick_count"] }}
賣出-滑價方向:{{ MAPPER[fee_settings["stock"]["slippage"]["sell"]["direction"]] }}
賣出-滑價 Tick 數:{{ fee_settings["stock"]["slippage"]["sell"]["tick_count"] }}
每筆交易固定成本:{{ "{:,.0f}".format(fee_settings["stock"]["per_trade_cost"]) }}
期貨回測
手續費:{{ "%.6f"|format(fee_settings["future"]["fee"]) }}
證交稅:{{ "%.6f"|format(fee_settings["future"]["tax"]) }}
買入-滑價方向:{{ MAPPER[fee_settings["future"]["slippage"]["buy"]["direction"]] }}
買入-滑價 Tick 數:{{ fee_settings["future"]["slippage"]["buy"]["tick_count"] }}
賣出-滑價方向:{{ MAPPER[fee_settings["future"]["slippage"]["sell"]["direction"]] }}
賣出-滑價 Tick 數:{{ fee_settings["future"]["slippage"]["sell"]["tick_count"] }}
每筆交易固定成本:{{ "{:,.0f}".format(fee_settings["future"]["per_trade_cost"]) }}
沖銷明細
{% for row in profit_rows %} {% endfor %}
標的代號 進場方向 進場時間進場價格(不含滑價)進場價格(含滑價) 交易數量(最小單位) 進場手續費進場交易稅進場額外成本進場價金 出場方向 出場時間出場價格(不含滑價)出場價格(含滑價) 出場手續費出場交易稅出場額外成本出場價金 損益 損益率
{{ row["code"] }} {{ row["entry_action"] }} {{ row["entry_dt"] }} {{ "%.4f"|format(row["entry_origin_price"]) }} {{ "%.4f"|format(row["entry_price"]) }} {{ "{:,.0f}".format(row["min_qty"]) }} {{ "{:,.0f}".format(row["trade_cost_fee"]) }} {{ "{:,.0f}".format(row["trade_cost_tax"]) }} {{ "{:,.0f}".format(row["trade_cost_fixed"]) }} {{ "{:,.0f}".format(row["entry_amount"]) }} {{ row["exit_action"] }} {{ row["exit_dt"] }} {{ "%.4f"|format(row["exit_origin_price"]) }} {{ "%.4f"|format(row["exit_price"]) }} {{ "{:,.0f}".format(row["cover_cost_fee"]) }} {{ "{:,.0f}".format(row["cover_cost_tax"]) }} {{ "{:,.0f}".format(row["cover_cost_fixed"]) }} {{ "{:,.0f}".format(row["exit_amount"]) }} {{ "{:,.0f}".format(row["profit"]) }} {{ "{:.2f}".format(row["profit_ratio"] * 100) }} %
回測績效
進出場摘要
進場次數:{{ "{:,.0f}".format(account_info['entry_times']) }}
出場次數:{{ "{:,.0f}".format(account_info['cover_times']) }}
獲利次數:{{ "{:,.0f}".format(account_info['profit_times']) }}
虧損次數:{{ "{:,.0f}".format(account_info['loss_times']) }}
勝率:{{ "{:.2f}".format(account_info['profit_times'] / account_info['cover_times'] * 100) if account_info['cover_times'] > 0 else 0 }} %
初始本金:{{ "{:,.0f}".format(initial_capital) }}
結算本金:{{ "{:,.0f}".format(current_capital) }}
總損益:{{ "{:,.0f}".format(account_info['profit']) }}
報酬率:{{ "{:.2f}".format(account_info['profit'] / initial_capital * 100) if initial_capital > 0 else 0 }} %
總獲利:{{ "{:,.0f}".format(account_info['profit_total']) }}
總虧損:{{ "{:,.0f}".format(account_info['loss_total']) }}