肿瘤康复网,内容丰富有趣,生活中的好帮手!
肿瘤康复网 > 海龟交易系统和程式码(2) - 交易逻辑及策略探讨 - 策略交易高峰会 EasyLangu...

海龟交易系统和程式码(2) - 交易逻辑及策略探讨 - 策略交易高峰会 EasyLangu...

时间:2023-08-04 10:26:21

相关推荐

input: InitialBalance(500000);

vars: N(0), StopLoss(1), DV(0), BB(0), AccountBalance(0), DollarRisk(0), LTT(0), Tracker(0), LastTrade(0), HBP(0),

LBP(0);

if marketposition = 0 then begin BB = 0;

N = AvgTrueRange(20); DV= N*BigPointValue; AccountBalance =InitialBalance;

DV = N * BigPointValue; AccountBalance =InitialBalance + netprofit;

DollarRisk =AccountBalance * .01; LTT =IntPortion(DollarRisk/DV);

StopLoss = 2 * DV * LTT;

if LastTrade = -1 then begin

buy LTT shares next barhighest(h,20) or higher;

buy LTT shares next barhighest(h,20) + (0.5*N) or higher;

buy LTT shares next barhighest(h,20) + (1.0*N) or higher;

buy LTT shares next barhighest(h,20) + (1.5*N) or higher;

sellshort LTT shares nextbar lowest(l,20) or lower;

sellshort LTT shares nextbar lowest(l,20) - (0.5*N) or lower;

sellshort LTT shares nextbar lowest(l,20) - (1.0*N) or lower;

sellshort LTT shares nextbar lowest(l,20) - (1.5*N) or lower;

end;

// LONG 20

if LastTrade = -1 and marketposition =1 then begin

BB = BB + 1;

if currentshares = LTT then begin

buy LTT shares next barhighest(h,20)[BB] + (0.5*N) or higher;

buy LTT shares next barhighest(h,20)[BB] + (1.0*N) or higher;

buy LTT shares next barhighest(h,20)[BB]+ (1.5*N) or higher;

end;

if currentshares = LTT * 2 then begin

buy LTT shares next barhighest(h,20)[BB] + (1.0*N) or higher;

buy LTT shares next barhighest(h,20)[BB] + (1.5*N) or higher;

end;

if currentshares = LTT * 3 then

buy LTT shares next barhighest(h,20)[BB] + (1.5*N) or higher;

end;

sell ("out-S") next barlowest(l,10) or lower;

// SHORT 20

if LastTrade = -1 and marketposition =-1 then begin

BB = BB + 1; if currentshares = LTTthen begin

sellshort LTTshares next bar lowest(l,20)[BB] - (0.5*N) or lower;

sellshort LTTshares next bar lowest(l,20)[BB] - (1.0*N) or lower;

sellshort LTTshares next bar lowest(l,20)[BB] - (1.5*N) or lower;

end;

if currentshares = LTT * 2 then begin

sellshort LTT shares nextbar lowest(l,20)[BB] - (1.0*N) or lower;

sellshort LTT shares nextbar lowest(l,20)[BB] - (1.5*N) or lower;

end;

if currentshares = LTT * 3 then

sellshort LTT shares nextbar lowest(l,20)[BB] - (1.5*N) or lower;

end;

如果觉得《海龟交易系统和程式码(2) - 交易逻辑及策略探讨 - 策略交易高峰会 EasyLangu...》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。