請教一下大家,我想表達開倉條件為前四根K線發生KD金叉或死叉
作者:開拓者 TB 來源:cxh99.com 發布時間:2016年07月22日
- 咨詢內容:
For i= 0 to 4
{
buycon=CrossOver(KValue[i],DValue[i]);
sellcon=CrossUnder(KValue[i],DValue[i]);
}
for while if else 中包含序列函數,可能存在潛在的邏輯錯誤!
這樣好像不行,可以怎么修改呢
編譯了說
- TB技術人員:
buycon=CrossOver(KValue,DValue);
SellCon=CrossUnder(Kvalue,Dvalue);
if((Buycon )
{
MyBar=CurrentBar;
}
if(CurrentBar<=MyBar+4)
{
Buy(0,Open);
}
if(SellCon)
MyBar=CurrentBar;
if(CurrentBar<=Mybar+4)
{
Sell(0,Open);
}