警示程式回測時無法抓到最後一天交易日15分K線符合條件的k線組合

  •   191 
  • 最後發表   Henry_Lin  2017 四月 26
Henry_Lin 發文於   2017/04/22

Dear XQ小幫手,

我寫一支15分K線警示小程式
只要15分k出現往上的2支小紅K後 我就去做空它
4/22日我以商品4551智伸科 去回測它時發現
最後一天(4/21)的15分K線有3處符合我的條件(附圖畫黃圈處)
卻都沒在回測時被找出來, 拜託幫忙我看一下
原因到底是甚麼, 感恩.

程式as following:

condition1=false; 
condition2=false;
condition7=false; 

value1=0;
value2=0;

if barfreq <>"Min" or barinterval <>15
then raiseruntimeerror("本腳本只限15分鐘線");

value1=(close-open)*100/open;
value2=(close[1]-open[1])*100/open[1];

if value1<=0.6 and close>open
then condition1=true; //小紅1 

if value2<=0.6 and close[1]>open[1]
then condition2=true;//小紅2

if close>close[1]
then condition7=true;

if condition1 and condition2 and condition7 
then ret=1;

排序方式: 標準 | 最新
Henry_Lin 發文於   2017/04/22

以上是我的程式附圖

XQ小幫手 發文於   2017/04/25

你好:

  程式看起來沒問題喔,有問題的是回測設定勾選了最大同時進場次數"1",因為2017/02/13 那筆還未出場,所以不會有下一筆進場,"不勾選"最大同時進場次數,就會對了,以上說明。

附加文件

Henry_Lin 發文於   2017/04/26

太感謝您了, tks again

發表回覆
Close