Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:浮盈加仓

1楼
qq代人发帖 发表于:2016/9/14 16:40:24

1、程序里写入满足条件浮盈加仓,但是如何设置加仓的次数

 

 

 

2、请问 每次收盘前30分钟 不开仓 怎么写

2楼
jinzhe 发表于:2016/9/14 16:46:18

1比如你要加仓3次

variable:n=0;

//定义全局变量,用来计算加仓次数

if n<3 and 加仓条件  and 持仓判断 then begin

    加仓语句;

    n:=n+1;

end

//加仓语句

if time=closetime(0) then n:=0;

//最后收盘时重置变量为0

if

2

(1)首先是要在开仓条件加入一个时间条件

  tt:=time0<timetot0(closetime(0))-60*30;限定开仓在收盘前30分钟

(2)然后写收盘平仓代码

 if time0>=timetot0(closetime(0))-60*30 then begin

  sell(1,0,market);

  sellshort(1,0,market);

 end

 

共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01660 s, 3 queries.