下边的思路希望各位老师帮忙修改成简单的金字塔模型,好让我学习学习,谢谢!!
Params
Numeric offset(0);
Numeric funds(10000);
Numeric lotPercent(0.25);
Vars
NumericSeries HighLine_yesterday;
NumericSeries LowLine_yesterday;
Numeric lots;
Begin
lots = 0;//IntPart(lotPercent * (funds + NetProfit) / (Close[1] * ContractUnit * MarginRatio));
//PlotNumeric("lots",lots);
//PlotNumeric("ContractUnit",ContractUnit);
HighLine_yesterday = HighD(1);
LowLine_yesterday = LowD(1);
PlotNumeric("HighLine_yesterday",HighLine_yesterday);
PlotNumeric("LowLine_yesterday",LowLine_yesterday);
If(High > HighLine_yesterday And MarketPosition <= 0)
{Buy(lots , HighLine_yesterday + offset);
}
If(Low < LowLine_yesterday And MarketPosition >= 0 )
{SellShort(lots , LowLine_yesterday - offset);}
End
引用了昨天的 H 和 L 在一分钟周期里边 只有价格突破昨天的H 就做多 突破昨天的L就追空 都是平仓反手操作
h_zuori:=callstock(stklabel,vthigh,6,-1);
l_zuori:=callstock(stklabel,vtlow,6,-1);
if h>h_zuori then begin
sellshort(holding<0,0,thisclose);
buy(holding=0,1,thisclose);
end
if l<l_zuori then begin
sell(holding>0,0,thisclose);
buyshort(holding=0,1,thisclose);
end