欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 怎样向前赋值

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有2897人关注过本帖平板打印复制链接

主题:怎样向前赋值

帅哥哟,离线,有人找我吗?
yin8jun
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:503 积分:1033 威望:0 精华:0 注册:2011/11/18 10:56:56
  发帖心情 Post By:2015/1/9 17:15:44    Post IP:222.71.107.219[只看该作者]

请看如下,假如我开了6手多单,然后平了3手,手上还有3手,我要引用当初开第3手的价格。

variable:izhisun=0;
variable:kdcs=0;//kd次数
variable:kkcs=0;//kk次数
variable:dfjb=0;


starttime:=093500;
endtime:=143000;
ss:=1;
zs:=6;

资产:asset-1000000,noaxis,colorred,linethick2;
胜率:percentwin,linethick0;
交易次数:totaltrade,linethick0;
持仓:holding,linethick0;

dfj:=date>ref(date,1);
dfjb:=barslast(dfj)+1;


if dfj {or time>151000} then begin
izhisun:=0.001*o*zs;
kdcs:=0;
kkcs:=0;
end

refc:=ref(c,1);
refo:=ref(o,1);

if time>=starttime and time<=143000 then begin

if mod(minute,5)=0 and refc>refo  then begin
if holding>=0 and kdcs<15 and totaldaytrade<10 then begin
buy(1,ss,limitr,c);
kdcs:=kdcs+1;
holdh:=h;
end
end
end


//时间平仓

if time>=150800 then 
begin
  if holding>0 then sell(1,holding,limitr,o);
  if holding<0 then sellshort(1,holding,limitr,o);
end

if holding>0 and enterprice-l>=izhisun then begin
sell(1,1,limitr,enterprice-izhisun);//止损
end


 回到顶部
总数 11 1 2 下一页