金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 2534|回复: 3

为什么这个后台引用图表交易的模型下不了单子

[复制链接]

8

主题

26

帖子

26

积分

Rank: 1

等级: 新手上路

注册:
2021-6-24
曾用名:
发表于 2021-7-1 23:04 | 显示全部楼层 |阅读模式
runmode:0;
Globalvariable:hold=drawnull;
cc13552719027:=holding;//???????????????????????????????????????K??????????????????
KD:=time=2300;         
Buy(KD,1,MARKET);

drawtextex(1,1,800,0,'虚拟持仓为:'+numtostr(cc13552719027,0));//在图表上输出虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;
xiadan13552719027:=cc13552719027-hold;
if xiadan13552719027>0.5 then begin//为什么不是xiadan13552719027>1?
   cang:=min(xiadan13552719027,abs(hold));
   if hold<0 then tsellshort(1,cang,mkt,0,0,'13552719027'),allowrepeat;
   cang:=xiadan13552719027+min(hold,0);
   if cang>0 then tbuy(1,cang,mkt,0,0,'13552719027'),allowrepeat;
end
if xiadan13552719027<-0.5 then begin
   cang:=min(abs(xiadan13552719027),abs(hold));
   if hold>0 then tsell(1,cang,mkt,0,0,'13552719027'),allowrepeat;
   cang:=abs(xiadan13552719027)-max(hold,0);
   if cang>0 then tbuyshort(1,cang,mkt,0,0,'13552719027'),allowrepeat;
end
hold:=cc13552719027;


程序的想法是当时间等于11点就下单  用的一分钟  品种选的白银   但是后台程序没有下单
回复

使用道具 举报

8

主题

26

帖子

26

积分

Rank: 1

等级: 新手上路

注册:
2021-6-24
曾用名:
 楼主| 发表于 2021-7-1 23:27 | 显示全部楼层
runmode:0;
Globalvariable:hold=drawnull;

cc13552719027:=holding;//???????????????????????????????????????K??????????????????

KD:c>o;  
pd:c<o;        
Buy(KD,1,MARKET);
sell(pd,1,market);


drawtextex(1,1,800,0,'虚拟持仓为:'+numtostr(cc13552719027,0));//在图表上输出虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;
xiadan13552719027:=cc13552719027-hold;
if xiadan13552719027>0.5 then begin//为什么不是xiadan13552719027>1?
   cang:=min(xiadan13552719027,abs(hold));
   if hold<0 then tsellshort(1,cang,mkt,0,0,'13552719027'),allowrepeat;
   cang:=xiadan13552719027+min(hold,0);
   if cang>0 then tbuy(1,cang,mkt,0,0,'13552719027'),allowrepeat;
end
if xiadan13552719027<-0.5 then begin
   cang:=min(abs(xiadan13552719027),abs(hold));
   if hold>0 then tsell(1,cang,mkt,0,0,'13552719027'),allowrepeat;
   cang:=abs(xiadan13552719027)-max(hold,0);
   if cang>0 then tbuyshort(1,cang,mkt,0,0,'13552719027'),allowrepeat;
end
hold:=cc13552719027;






回复

使用道具 举报

8

主题

26

帖子

26

积分

Rank: 1

等级: 新手上路

注册:
2021-6-24
曾用名:
 楼主| 发表于 2021-7-1 23:27 | 显示全部楼层
第一个用图表也下不了单   第二个图表正常下单  但是后台下不了
回复

使用道具 举报

8

主题

26

帖子

26

积分

Rank: 1

等级: 新手上路

注册:
2021-6-24
曾用名:
 楼主| 发表于 2021-7-1 23:32 | 显示全部楼层
可以用了  不好意思 我自己的失误
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2025-2-6 14:30 , Processed in 0.247690 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表