From 8201b47721932ead5593f97b0df9ebfd5a92f08f Mon Sep 17 00:00:00 2001 From: yz Date: Tue, 8 Nov 2022 15:34:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'TSLfm.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TSLfm.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/TSLfm.py b/TSLfm.py index bb7055e..49cd231 100644 --- a/TSLfm.py +++ b/TSLfm.py @@ -47,6 +47,7 @@ class TSLfm: 1、对于交易明细: 量比=现成交总手/[(过去 5 个交易日平均每分钟成交 量)×当日累计开市时间(分)] 2、对于秒线/1 分钟线: 量比取周期内最后一条交易明细的数据。 + zmm: 对 tradetable 公式:按下面的前后逻辑优先判定 没有成交 -> 0 当前成交价>上一笔买一价 ->主买 1 @@ -104,15 +105,15 @@ class TSLfm: ['zmm'] as 'm_iABFlag', //买卖标识 - ['buy_vol'] as 'm_nBidAvVolume', //主买量 - ['sectional_buy_vol'] as 'm_nAccBidAvVolume', //时点当日累计主买量 - ['buy_amount'] as 'm_nBidAvTurover', //主买金额 - ['sectional_buy_amount'] as 'm_nAccBidAvTurover', + ['buy_vol'] as 'm_nActBidVolume', //主买量 + ['sectional_buy_vol'] as 'm_nAccActBidVolume', //时点当日累计主买量 + ['buy_amount'] as 'm_nActBidTurover', //主买金额 + ['sectional_buy_amount'] as 'm_nAccActBidTurover', - ['sale_vol'] as 'm_nAskAvVolume', - ['sectional_sale_vol'] as 'm_nAccAskAvVolume', - ['sale_amount'] as 'm_nAskAvTurover', - ['sectional_sale_amount'] as 'm_nAccAskAvTurover', + ['sale_vol'] as 'm_nActAskVolume', + ['sectional_sale_vol'] as 'm_nAccActAskVolume', + ['sale_amount'] as 'm_nActAskTurover', + ['sectional_sale_amount'] as 'm_nAccActAskTurover', ['w_buy'] as 'm_nBidOrder', //委买 ['sectional_w_buy'] as 'm_nAccBidOrder', @@ -147,14 +148,13 @@ class TSLfm: r := select ['StockID'] as 'code', DateTimeToStr(['date']) as 'datetime', - + ['price'] as 'm_nPrice', ['open'] as 'm_nOpen', ['high'] as 'm_nHigh', ['low'] as 'm_nLow', ['close'] as 'm_nClose', - ['sectional_open'] as 'm_nAccOpen', //时点当日开盘 ['sectional_high'] as 'm_nAccHigh', ['sectional_low'] as 'm_nAccLow', @@ -177,15 +177,15 @@ class TSLfm: ['zmm'] as 'm_iABFlag', //买卖标识 - ['buy_vol'] as 'm_nBidAvVolume', //主买量 - ['sectional_buy_vol'] as 'm_nAccBidAvVolume', //时点当日累计主买量 - ['buy_amount'] as 'm_nBidAvTurover', //主买金额 - ['sectional_buy_amount'] as 'm_nAccBidAvTurover', + ['buy_vol'] as 'm_nActBidVolume', //主买量 + ['sectional_buy_vol'] as 'm_nAccActBidVolume', //时点当日累计主买量 + ['buy_amount'] as 'm_nActBidTurover', //主买金额 + ['sectional_buy_amount'] as 'm_nAccActBidTurover', - ['sale_vol'] as 'm_nAskAvVolume', - ['sectional_sale_vol'] as 'm_nAccAskAvVolume', - ['sale_amount'] as 'm_nAskAvTurover', - ['sectional_sale_amount'] as 'm_nAccAskAvTurover', + ['sale_vol'] as 'm_nActAskVolume', + ['sectional_sale_vol'] as 'm_nAccActAskVolume', + ['sale_amount'] as 'm_nActAskTurover', + ['sectional_sale_amount'] as 'm_nAccActAskTurover', ['w_buy'] as 'm_nBidOrder', //委买 ['sectional_w_buy'] as 'm_nAccBidOrder',