接口 IModuleContext
public interface IModuleContext
extends IModuleStrategyContext, MergedBarListener, TickDataAware, BarDataAware, TransactionAware
-
方法概要
修饰符和类型方法说明voidcancelOrder(String originOrderId) 撤单获取模组getRuntimeDescription(boolean fullDescription) 获取模组状态voidinitData(List<CoreField.BarField> barData) 预热模组boolean获取运行状态booleanisOrderWaitTimeout(String originOrderId, long timeout) 判断订单是否已经超时 该方法用于撤单场景booleanisReady()是否已完成初始化voidonReady()完成初始化voidsetEnabled(boolean enabled) 设置运行状态void设置模组submitOrderReq(CoreField.ContractField contract, SignalOperation operation, PriceType priceType, int volume, double price) 委托下单(精简接口)从接口继承的方法 org.dromara.northstar.common.BarDataAware
onBar从接口继承的方法 org.dromara.northstar.strategy.IModuleStrategyContext
disabledModule, explain, getAccount, getContract, getDefaultVolume, getLogger, getMessageSender, getModuleAccount, getState, numOfMinPerMergedBar, registerIndicator, setOrderRequestFilter, submitOrderReq从接口继承的方法 org.dromara.northstar.strategy.MergedBarListener
onMergedBar从接口继承的方法 org.dromara.northstar.common.TickDataAware
endOfMarket, onTick从接口继承的方法 org.dromara.northstar.common.TransactionAware
onOrder, onTrade
-
方法详细资料
-
initData
预热模组- 参数:
barData-
-
getRuntimeDescription
获取模组状态- 返回:
-
setModule
设置模组- 参数:
module-
-
getModule
IModule getModule()获取模组- 返回:
-
submitOrderReq
Optional<String> submitOrderReq(CoreField.ContractField contract, SignalOperation operation, PriceType priceType, int volume, double price) 委托下单(精简接口)- 参数:
contract- 交易合约operation- 操作信号priceType- 价格类型volume- 手数price- 委托价(市价为0)- 返回:
- originOrderId 订单ID
-
isOrderWaitTimeout
判断订单是否已经超时 该方法用于撤单场景- 参数:
originOrderId- 订单IDtimeout- 超时毫秒数- 返回:
-
cancelOrder
撤单- 参数:
originOrderId- 订单ID
-
setEnabled
void setEnabled(boolean enabled) 设置运行状态- 参数:
enabled-
-
isEnabled
boolean isEnabled()获取运行状态- 返回:
-
isReady
boolean isReady()是否已完成初始化- 返回:
-
onReady
void onReady()完成初始化
-