你好,我是用這樣的策略 跑1分鐘的頻率,有用過去相關文章中小編建議的進出場條件,但是我有根據需求做微調
//短期均線突破長期均線
input: Shortlength(1); setinputname(1,"短期均線期數");
input: Longlength(3); setinputname(2,"長期均線期數");
input: GAIN(20); setinputname(3,"GAIN");
input: LOSS(20); setinputname(4,"LOSS");
input: _BuyOrSell(1, "進/出場", inputkind:=Dict(["進場",1],["出場",0]));
variable: Forecast_DealPrice(0);
settotalbar(8);
setbarback(maxlist(Shortlength,Longlength,6));
Value1 = Average(Close,Shortlength);
Value2 = Average(Close,Longlength);
if Value1 crosses over Value2 then
begin Forecast_DealPrice = close;
if _BuyOrSell = 1 then ret = 1;
end;
if close > Forecast_DealPrice + GAIN and _BuyOrSell = 0 then ret = 1;
if close < Forecast_DealPrice - LOSS and _BuyOrSell = 0 then ret = 1;
4 評論