以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  求老师帮忙  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=64665)

--  作者:zm71212302
--  发布时间:2014/5/6 10:05:32
--  求老师帮忙

//为什么我的后台止赢不好用,是哪里写错了?

//如果持仓盈利大于50点则开始移动止赢
持仓:=holding;
持仓1:=THOLDING2;
VARIABLE:biaoji=0;
VARIABLE:zuigao=0;
VARIABLE:zuidi=0;
if h-tenterprice>50 and tbuyholding(0)>0 and biaoji=0 then begin
     zuigao:=HIGH;
     biaoji:=1;
end
if HIGH>zuigao and tbuyholding(0)>0 then zuigoa:=HIGH;
if LOW<zuigao-1 and tbuyholding(0)>0 then begin
 tsell(1,0,mkt);
 biaoji:=0;
end
if tenterprice-l>50 and TSELLHOLDING(0)>0 and biaoji=0 then begin
 zuidi:=LOW;
 biaoji:=1;
     end
 if LOW<zuidi and TSELLHOLDING(0)>0 then zhuidi:=LOW;
 if HIGH>zuidi-1 and tbuyholding(0)>0 then begin
 tsellshort(1,0,mkt);
 biaoji=0;
 end


--  作者:jinzhe
--  发布时间:2014/5/6 10:18:50
--  

后台不要用图表全局变量variable

后台的全局变量是用extgbdataset或者GLOBALVARIABLE
GLOBALVARIABLE用法和variable一样,extgbdataset用法看函数说明,比GLOBALVARIABLE复杂一点


--  作者:zm71212302
--  发布时间:2014/5/6 11:33:05
--  

好的,我具体研究一下

谢谢!