HTS程式交易語法大全-Stop Order


Stop Order處理方法
Stop訂單已指定的話,把條件達成與否作為即時的方式繼續做監控的動作,在滿足於最初的條件的價格中,一定要執行訂單。

所利用歷史資料的Back Testing如下處理:
對股價變動的假定,很重要
OpenPriceClosePriceOpenPriceLowPriceHighpriceClosePrice
OpenPriceClosePriceOpenPriceHighPriceLowPriceClosePrice
OpenPrice == ClosePrice 時,
 If ClosePrice>=ClosePrice[1]OpenPriceLowPriceHighPriceClosePrice
 If ClosePrice> ClosePrice[1]OpenPriceHighPriceLowPriceClosePrice

在一個峰中股價的時間別來表示變動如上述假定,並適用訂單,因此無庫存時,一定不會執行另外的Stop order
比如說:
買入價格101.001個契約,股價為(101.00, 103.50, 100.25, 103,00)的情況下,若已設定SetStopLoss( 0.50, Point)SetProfitTarget(2.00, Point)的訂單,這表示“OpenPrice < ClosePrice”,因此假定的股價從101.00開始到100.25,以SetStopLoss(0.50, Point)訂單在101.000.50=100.50執行來判斷成交,因此SetProfitTarget(2.00, Point)會自動刪除,買賣結果為0.50point損失。

買入價格101.001個契約,股價為(101.00, 103.50, 100.25, 103,00)的情況下,若已設定SetStopLoss( 0.50, Point)SetProfitTarget(2. 70, Point)的訂單,這表示“OpenPrice >ClosePrice”,因此假定的股價從102.50開始到103.90,以SetProfitTarget (2.70, Point)訂單在101.002.70103.70執行來判斷成交,因此SetStopLoss (0.50, Point)會自動刪除,買賣結果為2.70point利益。


沒有留言:

張貼留言

《HTS程式交易教學》[教學信號]KD買賣訊號範例[免費訊號教學]

Parameters : HighLowTerm(9), kLength(3), dLength(3), OverSold(20), OverBought(80) variables:value(0),value2(0); 1.系統平台僅供參考,投資人仍需自行判斷負責,本人...