代码整理
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
GridTypePercentage = "Percentage"
|
||||
GridTypeFixed = "PriceBreak"
|
||||
@@ -1,7 +0,0 @@
|
||||
from core.sfgrid.model import SFGridTradeTarget as TradeTarget
|
||||
|
||||
|
||||
class GridFixData:
|
||||
def __init__(self, grid_index, tradeTarget:TradeTarget):
|
||||
self.grid_index = grid_index
|
||||
self.tradeTarget = tradeTarget
|
||||
@@ -1,4 +1,3 @@
|
||||
from core import util
|
||||
from core.logger import LogLevel, PrintLog
|
||||
from core.qmt import qmtv
|
||||
from core.sfgrid import bus_events
|
||||
@@ -6,7 +5,6 @@ from core.sfgrid.bus_events import EventTradeTargetUpdate
|
||||
import core.sfgrid.model as model
|
||||
from core.eventbus import event_bus
|
||||
from core.constants import OrderTypeBuy, OrderTypeSell, OrderTypeInit
|
||||
from core.util import is_trading_time
|
||||
|
||||
from xtquant import xtconstant
|
||||
from xtquant.xttype import XtOrderResponse, XtTrade
|
||||
@@ -96,7 +94,7 @@ class SFGridStrategy:
|
||||
print(f'length: {len(self.tradeTarget.getPriceGrid())}, currentIdx = {currentIdx}')
|
||||
buyIdx = currentIdx + 1
|
||||
buyPrice = self.tradeTarget.getPriceGrid()[buyIdx]
|
||||
remark = f'{OrderTypeInit},{buyIdx},{self.tradeTarget.stock_code}'
|
||||
remark = f'{OrderTypeBuy},{buyIdx},{self.tradeTarget.stock_code}'
|
||||
if len([order for order in orders if order.order_type == xtconstant.STOCK_BUY and order.price == buyPrice]) == 0:
|
||||
tmpOrderSeq = qmtv.orderAsync(
|
||||
str(self.tradeTarget.stock_code),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from mimetypes import inited
|
||||
from typing import Any
|
||||
|
||||
import tkinter as tk
|
||||
|
||||
Reference in New Issue
Block a user