相关标签:
//波动区间突破交易,根据昨天波动幅度的一定百分比,来触发当日的趋势交易,
//如果昨天的波动幅度是异常的,应当对该波动幅度进行必要的调整,以保持合理性。
金字塔公式 金字塔模型策略源码:
//------------------------------------------------------------------------
// 简称: OpenRangBreak
// 名称: 开盘区间突破策略
// By: 财富游戏
//------------------------------------------------------------------------
input:PercentOfRange(0.5,0,1,0.1); //多头突破波动比例
input:LOTS(1,0,9,1);
HighD:=callstock(stklabel,vthigh,6,-1);
LowD:=callstock(stklabel,vtlow,6,-1);
OpenD:=valuewhen(date<>REF(date,1),open);
RangeT:= HighD-LowD;
UpperBand: OpenD +PercentOfRange*RangeT;
LowerBand: OpenD -PercentOfRange*RangeT;
If (holding=0) THEN BEGIN
If (High>=UpperBand) THEN BEGIN
Buy(holding=0,lots,LIMITR,Max(Open,UpperBand));
END
If (Low<=LowerBand) THEN BEGIN
BuyShort(holding=0,lots,LIMITR,Min(Open,LowerBand));
END
END
If (holding<0) THEN BEGIN
If (High>=UpperBand) THEN BEGIN
SellShort(holding<0,lots,LIMITR,Max(Open,UpperBand));
Buy(holding=0,lots,LIMITR,Max(Open,UpperBand));
END
END
If (holding>0) THEN BEGIN
If (Low<=LowerBand) THEN BEGIN
Sell(holding>0,lots,LIMITR,Min(Open,LowerBand));
BuyShort(holding=0,lots,LIMITR,Min(Open,LowerBand));
END
END
持仓:holding,noaxis ,linethick0 ;
盈亏:asset-1000000,noaxis,coloryellow,linethick2;
//1、RANGE BREAK www.gszb.com
//波动区间突破交易,根据昨天波动幅度的一定百分比,来触发当日的趋势交易,
//如果昨天的波动幅度是异常的,应当对该波动幅度进行必要的调整,以保持合理性。