clean up log

This commit is contained in:
Kevin Darby committed 2020-01-02 15:36:29 -05:00
1 parent 1939c9c3c0
commit f93dd9f307
2 files changed
+23 -4

No files matched your search

@@ -26,7 +26,7 @@ namespace bts.history
public virtual void record_order_status(OrderStatus stat)
{
if (_disqual.ContainsKey(stat.order.order_id))
if (_disqual.ContainsKey(stat.order.order_id) && !stat.is_terminal())
{
Log.Testing.error($"new status for disqualified error, not recording");
}
@@ -218,7 +218,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
@@ -228,11 +228,30 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"metadata": {
"scrolled": true
},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<table><thead><tr><th>avg_buy_price</th><th>avg_sell_price</th><th>total_buy_size</th><th>total_sell_size</th><th>pnl</th><th>num_buys</th><th>num_sells</th></tr></thead><tbody><tr><td>64.7265625</td><td>129.46093750000003</td><td>80</td><td>40</td><td>0.3125000000009095</td><td>28</td><td>14</td></tr></tbody></table>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<table><thead><tr><th><i>index</i></th><th>order</th><th>fill</th></tr></thead><tbody><tr><td>0</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000260, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Sell, order_status: Working, order_price: 129.46875, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>1</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000263, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Buy, order_status: Working, order_price: 129.421875, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>2</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000261, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Sell, order_status: Working, order_price: 129.484375, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>3</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000263, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Buy, order_status: Working, order_price: 129.421875, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>4</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000261, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Sell, order_status: Working, order_price: 129.484375, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>5</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000263, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Buy, order_status: Working, order_price: 129.421875, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>6</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000261, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Sell, order_status: Working, order_price: 129.484375, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>7</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000263, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Buy, order_status: Working, order_price: 129.421875, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>8</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000261, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.010631Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.010581Z&quot;, order_side: Sell, order_status: Working, order_price: 129.484375, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>9</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000264, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.507182800Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.507132800Z&quot;, order_side: Buy, order_status: Working, order_price: 129.4375, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>10</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000260, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.510711200Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.510661200Z&quot;, order_side: Sell, order_status: Working, order_price: 129.46875, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>11</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000264, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.783886900Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.783836900Z&quot;, order_side: Buy, order_status: Working, order_price: 129.4375, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>12</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000260, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:00.861324Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:00.861274Z&quot;, order_side: Sell, order_status: Working, order_price: 129.46875, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>13</td><td>{ bts.history.Display+OrderDisplay: order_id: 1000264, security_desc: ZNH0, order_sending_time: &quot;2019-11-25T14:00:01.326721200Z&quot;, order_TRANSACT_time: &quot;2019-11-25T14:00:01.326671200Z&quot;, order_side: Buy, order_status: Working, order_price: 129.4375, order_size: 20, order_filled: 0 }</td><td>&lt;null&gt;</td></tr><tr><td>14</td><td>{ bts.history.DiLine truncated
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var pnl = algo_pnl(algo_results_cached);\n",
"display(pnl);\n",