請教各位老師,這個加減倉代碼程序為何不執行呢?
作者:開拓者 TB 來源:cxh99.com 發布時間:2019年05月06日
-
咨詢內容:
本帖最后由 ad434005 于 2018-10-20 22:10 編輯
if(MarketPosition==0)
{? ? ? ?
? ? ? ? if(High>high[1] and high>junxian ) buy(2,max(open,high[1]));//junxian為均線;
? ? ? ? if(Low<low[1] and??low<junxian ) SellShort(2,min(open,low[1]));? ? ? ?
??
? ?? ?else if(MarketPosition==1 and BarsSinceEntry>1 )
? ?? ?? ?{
? ?? ?? ?? ? While( high>high[1]??and CurrentEntries<3)
? ?? ?? ?? ???{
? ?? ?? ?? ?? ???if(zdfy>2000??and abs(currentcontracts)==2 )Buy(2,open);//zdfy為最大浮盈;
? ?? ?? ?? ?? ???if(zdfy>4000??and abs(currentcontracts)==4) Buy(2,open);
? ?? ?? ?? ???
? ?? ?? ?? ?? ?}? ?
? ?? ?? ?? ?? ?? ?While(??low<low[1] and CurrentEntries>0)
? ?? ?? ?? ?? ?? ???{
? ?? ?? ?? ?? ?? ?? ?if( zdfy<-100 and abs(currentcontracts)==2) sell(2,open);? ?
? ?? ?? ?? ?? ?? ?? ?if( zdfy<1000 and abs(currentcontracts)==4) sell(4,open);
? ?? ?? ?? ?? ?? ?? ?if( zdfy<2000 and abs(currentcontracts)==6) sell(6,open);??
? ?? ?? ?? ?? ?? ?? ?}
? ?? ?? ?? ?}
}
?
?來源:CXH99.COM
-
TB技術人員:
活用 plot 、commentary 函數來找問題~
?
-
TB客服:
找不到啊,輸出后對照條件完全符合,就是不執行。我覺得肯定是哪個函數用的方法不對了。
?
-
網友回復:
ad434005 發表于 2018-10-24 20:02
找不到啊,輸出后對照條件完全符合,就是不執行。我覺得肯定是哪個函數用的方法不對了。 ...
使用哪個方式來輸出的?
如果是使用的commentary,請將顯示輸出值的K線注釋信息截圖,以及全局交易設置的截圖都貼上看一下。
?
-
網友回復:
小米 發表于 2018-10-25 09:55
使用哪個方式來輸出的?
如果是使用的commentary,請將顯示輸出值的K線注釋信息截圖,以及全局交易設置的 ...
搞明白了,zdfy是個序列值,序列值不能作為if的判定條件來進行比較。
不過我還是不明白,為什么呢?為什么序列值不能作為if的判定條件來進行比較? |