- 精华
- 0
- 在线时间
- 171 小时
- UID
- 32158
- 积分
- 731
- 帖子
- 176
- 阅读权限
- 60
- 注册时间
- 2011-4-5
- 最后登录
- 2023-1-17
- 精华
- 0
- UID
- 32158
- 积分
- 731
- 帖子
- 176
- 主题
- 53
- 阅读权限
- 60
- 注册时间
- 2011-4-5
- 最后登录
- 2023-1-17
|
几个交易逻辑:
1; 在开盘一定时间内取其波动区间
2; 突破此波动区间后,代表波动区间变大,向上突破买进,向下突破卖出
3; 止损采用动态止损,获利值减少一定额度后出场
4; 收盘时出场,不留仓- inputs:
- Factor(1),
- endtime(1455),
- stopLongPoint(50),
- stopShortPoint(50);
- vars:
- DateH(0),DateL(0),BrkR(0),canTradeTime(false),lo(0),hi(0);
- If date > Date[1] then begin
- BrkR = HighD(1)-LowD(1);
- DateH = H;
- DateL = L;
- end;
- lo = dailyLowest;
- hi = dailyHighest;
- canTradeTime = time>915 and time<1400;
- If canTradeTime and marketposition=0 and EntriesToday(date)=0 then begin
- if c > DateL + Factor*BrkR then Buy ("Larry_L") next bar at market;
- if C < DateH - Factor*BrkR then Sellshort ("Larry_S") next bar at market;
- tl_new(date,time,DateL + Factor*BrkR,date,1330,DateL + Factor*BrkR);
- tl_new(date,time,DateH - Factor*BrkR,date,1330,DateH - Factor*BrkR);
- end;
- {Exit before market close}
- if time>=endtime then begin
- if marketposition=1 then
- sell("DayTrade_L") this bar at close;
- if marketposition=-1 then
- buytocover("DayTrade_S") this bar at close;
- end;
复制代码 |
|