MultiCharts基礎篇:下單時四捨五入的成交價位
1-最小跳動點以下無條件捨去
以台指期TX為例
以台指期最小跳動點1點,測試小於1點的價位下單,成交價會是多少。
輸出值:
date = 1130415.00 time = 1135.00 openD(0) = 7763.00 openD(0) * (1 - 0.003) = 7739.71
程式碼:
print("date = " , date, " time = ", time, " openD(0) = ", openD(0), " openD(0) * (1 - 0.003) = ", openD(0) * (1 - 0.003) );
print("date = " , date, " time = ", time, " openD(0) = ", openD(0), " openD(0) * (1 - 0.003) = ", openD(0) * (1 - 0.003) );
date = 1130415.00 time = 1135.00 openD(0) = 7763.00 openD(0) * (1 - 0.003) = 7739.71
以金融期TF為例
以金融期最小跳動點0.2點,測試小於0.2點的價位下單,成交價會是多少。
date = 1130423.00 time = 945.00 openD(0) = 915.00 openD(0) * (1 - 0.003) = 912.26
程式碼:
print("date = " , date, " time = ", time, " openD(0) = ", openD(0), " openD(0) * (1 - 0.003) = ", openD(0) * (1 - 0.003) );
print("date = " , date, " time = ", time, " openD(0) = ", openD(0), " openD(0) * (1 - 0.003) = ", openD(0) * (1 - 0.003) );
輸出值:
date = 1130423.00 time = 945.00 openD(0) = 915.00 openD(0) * (1 - 0.003) = 912.26
以電子期TE為例
以電子期最小跳動點0.05點,測試小於0.0.5點的價位下單,成交價會是多少。
程式碼:
print("date = " , date, " time = ", time, " openD(0) = ", openD(0), " openD(0) * (1 - 0.003) = ", openD(0) * (1 - 0.003) );
print("date = " , date, " time = ", time, " openD(0) = ", openD(0), " openD(0) * (1 - 0.003) = ", openD(0) * (1 - 0.003) );
輸出值:
date = 1130422.00 time = 1345.00 openD(0) = 302.00 openD(0) * (1 - 0.003) = 301.09
date = 1130423.00 time = 850.00 openD(0) = 300.35 openD(0) * (1 - 0.003) = 299.45
程式碼:
print("date = " , date, " time = ", time, " openD(0) = ", openD(0), " openD(0) * (1 - 0.005) = ", openD(0) * (1 - 0.005) );
此版本為MultiChart 7.4.20.400。
0 意見:
張貼留言