只開一倉,為什么
作者:開拓者 TB 來源:cxh99.com 發布時間:2016年11月29日
- 咨詢內容:
Params
Numeric ALength(4);
Numeric BLength(9);
Numeric CLength(18);
Vars
NumericSeries AMA;
NumericSeries BMA;
NumericSeries CMA;
Bool Condition1;
Bool Condition2;
Begin
If(!W_CallAuctionFilter()) Return;
AMA = Average(Close, ALength);
BMA = Average(Close, BLength);
CMA = Average(Close, CLength);
PlotNumeric("短線",AMA);
PlotNumeric("中線",BMA);
PlotNumeric("長線",CMA);
Condition1 = CrossOver(AMA[1],BMA[1]) AND AMA[1]>CMA[1] AND BMA>CMA;
Condition1 = CrossUnder(AMA[1],BMA[1]) AND AMA[1]<CMA[1] AND BMA<CMA;
if (MarketPosition != 1 And Condition1)
{
Buy(0,Open);
}Else
if (MarketPosition != -1 And Condition2)
{
SellShort(0,Open);
}
End
- TB技術人員:
2個 Condition1
- TB客服:
Condition1 = CrossUnder(AMA[1],BMA[1]) AND AMA[1]<CMA[1] AND BMA<CMA; 應該寫成: Condition2 = CrossUnder(AMA[1],BMA[1]) AND AMA[1]<CMA[1] AND BMA<CMA;