掘金社区

看不懂啥意思Pinned highlighted

赵飞 发表在问题反馈 2021-12-13 23:44:38

问题反馈
93
1
0

Inputs:Initial_Risk_Limit(4000);

Vars:Donchian_Entry(50), Upper_Band(0), Lower_Band(0), Flag(0);

Value1=Average(Close,100);

Value2=Highest(Close,Donchian_Entry)[1];

Value3=Lowest(Close,Donchian_Entry)[1];

Value4=Average(Close,25);

Value5=Average(Close,50);

Value6=Average(Close,75);

Value7=(Close - Value1) * BigPointValue;

Value8=(Value1 - Close) * BigPointValue;

Upper_Band = Value1 + stddev(Close,100);

Lower_Band = Value1 - stddev(Close,100);

If (MarketPosition = 0) and

Close > Value2 and Close > Upper_Band and

Value7 < Initial_Risk_Limit then begin

Buy ("LE") Next Bar  at Market;

Flag = +1;

End;

If (MarketPosition = 0) and

Close < Value3 and Close < Lower_Band and

Value8 < Initial_Risk_Limit then begin

Sell Short ("SE") Next Bar  at Market;

Flag = -1;

End;

If (MarketPosition = +1) and

((Close - EntryPrice) * BigPointValue) > 10000 then

Sell ("LX 10K") Next Bar  at Market;

If (MarketPosition = +1) and

BarsSinceEntry(0) > 99 and Close < Value4 then

Sell ("LX 25MA") Next Bar  at Market;

If (MarketPosition = +1) and

BarsSinceEntry(0) > 74 and Close < Value5 then

Sell ("LX 50MA") Next Bar  at Market;

If (MarketPosition = +1) and

BarsSinceEntry(0) > 49 and Close < Value6 then

Sell ("LX 75MA") Next Bar  at Market;

If (MarketPosition = +1) and

Close < Value1 then

Sell ("LX 100MA") Next Bar  at Market;

If (MarketPosition = -1) and

((EntryPrice - Close) * BigPointValue) > 10000 then

评论: 1

Looks like your connection to 掘金量化社区 - 量化交易者的交流社区 was lost, please wait while we try to reconnect.