|
除了 order update, Tick 恐怕是trading platform 裡最基本要做的事,當然要給他最高優先權!
從一個完整的trading platform 眼光來看,必須要有完整的event 處理模式。下面是Ninjatrader 第一層的event handlers: 這些event hooks 可以讓你控制你的策略,細到, Level 2 bid/ask 改變都可以做動作,因為,可能bid/ask 變了,但是還沒有成交的ticks.
另外,如果你下單,任何order 狀況的改變 (partial fill, rejected, etc) 都是從 OnOrderUpdate 處理。 成交了 是由 OnExecution 處理,這裡你可以加你的 停損 order, 或是 trail stop order.
OnConnectionStatus() - Called when a connection state changes
OnExecution() - Called when a strategy generated order is filled <---- 1
OnFundamentalData() - Called on any change in fundamental data
OnMarketData() - Called on any change in a level 1 market data stream
OnMarketDepth() - Called on any change in a level 2 market data stream
OnBarUpdate()- Called when the price bar changes with incoming data <---- 1
OnOrderUpdate() - Called when a strategy generated order changes state <--- 1
OnPositionUpdate() - Called when a strategy generated position changes
OnStartUp() - Called once when a script first starts up
OnTermination() - Called once when a script is terminated
|
評分
-
查看全部評分
|