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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 老师,设置为轮询1秒模式,平仓想设为走完1根K线但提前1秒下单?开仓想保持信号出现马上下单。麻烦老师帮下忙!谢了

   

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


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

主题:老师,设置为轮询1秒模式,平仓想设为走完1根K线但提前1秒下单?开仓想保持信号出现马上下单。麻烦老师帮下忙!谢了

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


加好友 发短信
等级:新手上路 帖子:24 积分:0 威望:0 精华:0 注册:2013/9/22 14:24:24
老师,设置为轮询1秒模式,平仓想设为走完1根K线但提前1秒下单?开仓想保持信号出现马上下单。麻烦老师帮下忙!谢了  发帖心情 Post By:2017/9/13 11:02:23    Post IP:117.44.100.150[只看该作者]

//老师,设置为轮询1秒模式,平仓想设为走完1根K线但提前1秒下单?开仓想保持信号出现马上下单
DMA5: MA(high,5);                                                  
KMA5: MA(low,5);                                                  
DMA10:MA(high,10);                                                
KMA10:MA(Low,10);                                                
B1:=CROSS(DMA5,DMA10);
B2:=CROSS(KMA10,KMA5);
if date<>ref(date,1) then begin
count1:=1;
count2:=1;
end
lots:=1;
//亏损平仓(想设为走完1根K线但提前1秒下单)
if holding>0  and  l<=ENTERPRICE-10  then  begin
sell(1,holding,NEXTOPEN),IGNORECHECKPRICE;
 end
if holding<0  and  h>=ENTERPRICE+10   then   begin
sellshort(1,holding,NEXTOPEN),IGNORECHECKPRICE;
 end
//开仓(设为固定1秒轮询想保持信号出现马上下单)
if  holding=0  and count2=1 then  begin
if B1 then   begin
 buy(1,lots,limitr,open),IGNORECHECKPRICE;
 HigherAfterEntry:=enterprice;
 LowerAfterEntry:=enterprice;
end
 end
 if holding=0  and count2=1  then   begin
if B2 then
  begin
  buySHORT(1,lots,limitr,open),IGNORECHECKPRICE;
 HigherAfterEntry:=enterprice;
 LowerAfterEntry:=enterprice;
   end
end 
 //盈利平仓(想设为走完1根K线但提前1秒下单)
 if holding>0 and enterbars>0  then  begin
 if  enterbars>=1  and HigherAfterEntry>=enterprice*1  then  begin
 price:=EnterPrice+(HigherAfterEntry-EnterPrice)*1;
 if low<=price then  begin
sell(1,holding,NEXTOPEN),IGNORECHECKPRICE;
count2:=1;
end
 end;
  end;
 if holding<0 and enterbars>0  then  begin
 if  enterbars>=1    and lowerAfterEntry<=enterprice*1   then begin
 price:=EnterPrice - (EnterPrice-LowerAfterEntry)*1;
 if high>=price then  begin
 sellshort(1,holding,NEXTOPEN),IGNORECHECKPRICE;
  count2:=1;
  end;

 回到顶部