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


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

   

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


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

主题:DEBUGFILE问题

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


加好友 发短信
等级:论坛游侠 帖子:194 积分:0 威望:0 精华:0 注册:2020/2/11 13:06:09
  发帖心情 Post By:2020/3/5 15:40:32    Post IP:144.123.5.122[只看该作者]

那我贴代码吧。
globalvariable:n=1000000;
GLOBALVARIABLE:dd=0;
GLOBALVARIABLE:f=1;
GLOBALVARIABLE:a=0;

jia:=20;
hui:=10;
da:=5;
追踪止盈点数:=10;

if TREMAINQTY(0,'','')>0 and  tenterbars(1)>1 then begin
TCANCEL(1,0);
END

   


if TBUYHOLDINGEX('','',1)>0 and TBUYHOLDINGEX('','',1)<da  AND TENTERPRICE>0 then 
BEGIN
      if f=3 AND TENTERPRICE>0 then
begin
if c<=Tenterprice+5*mindiff and c>=Tenterprice-5*mindiff  then begin
       TBUY(1,1,MKT);
       f:=2;
       if islastbar then
                 DEBUGFILE('D:\35.TXT',' Tenterprice:%.2f',Tenterprice);//输出开仓价格
       end  
        
    if c<=Tenterprice-(jia+hui)*mindiff  THEN begin
     TSELL(1,0,MKT);
     f:=1;
     end
     
  if c>=Tenterprice+(hui+jia)*mindiff  then begin
     TBUY(1,1,MKT);
             f:=1;
             if islastbar then
                 DEBUGFILE('D:\35.TXT',' Tenterprice:%.2f',Tenterprice);//输出开仓价格
     end   
end
 
if f=2 AND TENTERPRICE>0 then
BEGIN
  if c>=Tenterprice+hui*mindiff  then begin
    TSELL(1,1,MKT);
    f:=3;
     end
  if c<=Tenterprice-(jia+hui)*mindiff  THEN begin
     TSELL(1,0,MKT);
     f:=1;
     end
     
  if c>=Tenterprice+(hui+jia)*mindiff  then begin
     TBUY(1,1,MKT);
             f:=1;
             if islastbar then
                 DEBUGFILE('D:\35.TXT',' Tenterprice:%.2f',Tenterprice);//输出开仓价格
     end 
end 
 
   if f=1 AND TENTERPRICE>0 then
     BEGIN
         if c<=Tenterprice-jia*2*mindiff  THEN begin
            TSELL(1,0,MKT);
            f:=1;
            end
            
         if c>=Tenterprice+jia*mindiff  then begin
TBUY(1,1,MKT);
f:=1;
if islastbar then
                 DEBUGFILE('D:\35.TXT',' Tenterprice:%.2f',Tenterprice);//输出开仓价格
            end
if c<=Tenterprice-hui*mindiff  then BEGIN
TBUY(1,1,MKT);    
f:=2;
if islastbar then
                 DEBUGFILE('D:\35.TXT',' Tenterprice:%.2f',Tenterprice);//输出开仓价格
end
end                  
end
if TBUYHOLDINGEX('','',1)=da  THEN BEGIN
     if f=3 AND TENTERPRICE>0 then
begin
if c<=Tenterprice+5*mindiff and c>=Tenterprice-5*mindiff  then begin
       TBUY(1,1,MKT);
       f:=2;
       if islastbar then
                 DEBUGFILE('D:\35.TXT',' Tenterprice:%.2f',Tenterprice);//输出开仓价格
       end  
        
    if c<=Tenterprice-(jia+hui)*mindiff  THEN begin
     TSELL(1,0,MKT);
     f:=1;
     end
     
  if c>=Tenterprice+(hui+jia)*mindiff  then begin
     TBUY(1,1,MKT);
             f:=1;
             if islastbar then
                 DEBUGFILE('D:\35.TXT',' Tenterprice:%.2f',Tenterprice);//输出开仓价格
                 
     end   
end
       
    if f=2 AND TENTERPRICE>0 then BEGIN
       if c>=Tenterprice+hui*mindiff  then begin
    TSELL(1,1,MKT);
    f:=3;
     end
   if c<=Tenterprice-(jia+hui)*mindiff  THEN begin
     TSELL(1,0,MKT);
     f:=1;
     end   
END
 
if f=1  AND TENTERPRICE>0 then begin
if a=0 then 
    a:=Tenterprice;     
if a>0 THEN BEGIN
if c-追踪止盈点数*mindiff >a  THEN
a:=c-追踪止盈点数*mindiff;
if c<=a then
begin
TSELL(1,0,MKT);
f:=1;
end
END
end      
end

if TBUYHOLDINGEX('','',1)=0 AND TREMAINQTY(0,'','')=0  THEN begin
    TBUY(1,1,MKT);
    if islastbar then
       DEBUGFILE('D:\35.TXT',' Tenterprice:%.2f',Tenterprice);//输出开仓价格
    END

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