大侠好。今早我通过vnpy程序化下了一个CJ305的空单 (simnow仿真交易),在快期中看被拒单了(不合法的数量),如图。但我在快期中手工下单却能成功。不知是和原因?
大侠好。今早我通过vnpy程序化下了一个CJ305的空单 (simnow仿真交易),在快期中看被拒单了(不合法的数量),如图。但我在快期中手工下单却能成功。不知是和原因?
根据《郑州商品交易所期货交易细则》第二十六条规定,经研究决定,自2021年12月16日起,红枣期货合约交易指令每次最小开仓下单量调整为4手,限价指令每次最大下单量调整为100手,市价指令每次最大下单量调整为20手。
特此公告。
郑州商品交易所
2021年12月14日
CTP接口返回到合约信息包括:
struct CThostFtdcInstrumentField
{
///合约代码
TThostFtdcInstrumentIDType InstrumentID;
///交易所代码
TThostFtdcExchangeIDType ExchangeID;
///合约名称
TThostFtdcInstrumentNameType InstrumentName;
///合约在交易所的代码
TThostFtdcExchangeInstIDType ExchangeInstID;
///产品代码
TThostFtdcInstrumentIDType ProductID;
///产品类型
TThostFtdcProductClassType ProductClass;
///交割年份
TThostFtdcYearType DeliveryYear;
///交割月
TThostFtdcMonthType DeliveryMonth;
///市价单最大下单量
TThostFtdcVolumeType MaxMarketOrderVolume;
///市价单最小下单量
TThostFtdcVolumeType MinMarketOrderVolume;
///限价单最大下单量
TThostFtdcVolumeType MaxLimitOrderVolume;
///限价单最小下单量
TThostFtdcVolumeType MinLimitOrderVolume;
///合约数量乘数
TThostFtdcVolumeMultipleType VolumeMultiple;
///最小变动价位
TThostFtdcPriceType PriceTick;
///创建日
TThostFtdcDateType CreateDate;
///上市日
TThostFtdcDateType OpenDate;
///到期日
TThostFtdcDateType ExpireDate;
///开始交割日
TThostFtdcDateType StartDelivDate;
///结束交割日
TThostFtdcDateType EndDelivDate;
///合约生命周期状态
TThostFtdcInstLifePhaseType InstLifePhase;
///当前是否交易
TThostFtdcBoolType IsTrading;
///持仓类型
TThostFtdcPositionTypeType PositionType;
///持仓日期类型
TThostFtdcPositionDateTypeType PositionDateType;
///多头保证金率
TThostFtdcRatioType LongMarginRatio;
///空头保证金率
TThostFtdcRatioType ShortMarginRatio;
///是否使用大额单边保证金算法
TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm;
///基础商品代码
TThostFtdcInstrumentIDType UnderlyingInstrID;
///执行价
TThostFtdcPriceType StrikePrice;
///期权类型
TThostFtdcOptionsTypeType OptionsType;
///合约基础商品乘数
TThostFtdcUnderlyingMultipleType UnderlyingMultiple;
///组合类型
TThostFtdcCombinationTypeType CombinationType;
};
@dataclass
class ContractData(BaseData):
"""
Contract data contains basic information about each contract traded.
"""
symbol: str
exchange: Exchange
name: str
product: Product
size: float
pricetick: float
min_volume: float = 1 # minimum trading volume of the contract —— 这个就是最小交易手数
stop_supported: bool = False # whether server supports stop order
net_position: bool = False # whether gateway uses net position volume
history_data: bool = False # whether gateway provides bar history data
option_strike: float = 0
option_underlying: str = "" # vt_symbol of underlying contract
option_type: OptionType = None
option_listed: datetime = None
option_expiry: datetime = None
option_portfolio: str = ""
option_index: str = "" # for identifying options with same strike price
需要自行设计,因连续的两条交易指令send_order()之间必须有时间间隔,否则前一条会被覆盖,交易所只会收收到后一条。
也就是说,你必须设计一个独立的大单委托管理机制,可以设计类似算法交易的vwap、iceberg这类的东西来支持你的交易策略。
very good