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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 如何实现这种平仓方式

   

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


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

主题:如何实现这种平仓方式

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


加好友 发短信
等级:新手上路 帖子:92 积分:0 威望:0 精华:0 注册:2017/10/10 14:37:01
  发帖心情 Post By:2017/11/24 18:56:38    Post IP:49.71.46.131[只看该作者]

temp:=c-ENTERPRICE;
if holding>0 then Profit:=temp;else if holding<0 then Profit:=(-temp);
if holding=0 then Profit:=0;

if Profit>40*MINDIFF and Profit<80*MINDIFF and C<WU then sell(holding>0,1,MARKET);
if Profit>40*MINDIFF and Profit<80*MINDIFF and C>WB then sellshort(holding<0,1,MARKET);

if Profit>80*MINDIFF and c<上 then sell(holding>0,1,MARKET);
if Profit>80*MINDIFF and c>下 then sellshort(holding<0,1,MARKET);

if Profit>150*MINDIFF then 
begin
sell(holding>0,1,MARKET);
sellshort(holding<0,1,MARKET);
end

VARIABLE:isProfit=0;
if Profit>10*MINDIFF and isProfit=0 then isProfit:=1;
if ISProfit and Profit<=2*MINDIFF then
begin
sell(holding>0,1,MARKET);
sellshort(holding<0,1,MARKET);
isProfit:=0;//平仓后全局变量重置为0
end

这样写可以吗?

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