以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]关于后台代码的编写问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=155639)

--  作者:Ritter
--  发布时间:2017/7/3 11:14:48
--  [求助]关于后台代码的编写问题

请教各位大神:

 

 

                  麻烦帮我看一下我的后台交易代码有没有什么问题:

 

 

 

IF  BUYCOND THEN BEGIN
  TBUY(THOLDING=0,SS,MKT); 
END

 

IF BUYSHORTCOND THEN BEGIN
 TBUYSHORT(THOLDING=0,SS,MKT);
END

 

zg:=hhv(Tasset,Tenterbars+1);
cs:=ref(Tasset,Tenterbars);
if (zg-cs)/cs>=0.01 and (Tasset-cs)<=(zg-cs)*0.8 then begin
   Tsell(1,0,MKT);
   Tsellshort(1,0,MKT);     
End


多单止损:=Tsell(Tavgenterprice-c>20*mindiff and Tholding>0,0,MKT);
空单止损:=Tsellshort(c-Tavgenterprice>20*mindiff and Tholding<0,0,MKT);

 

 

谢谢!!!!!

 


--  作者:pyd
--  发布时间:2017/7/3 11:25:33
--  

持仓判断最好用

TBUYHOLDING//多仓
TSELLHOLDING//空仓

cs:=ref(Tasset,Tenterbars+1);