设为首页收藏本站

 找回密码
 注册
查看: 5069|回复: 0
打印 上一主题 下一主题

如何编写加仓命令! [复制链接]

Rank: 10Rank: 10Rank: 10

精华
20
UID
4
积分
22709
帖子
4802
主题
64
阅读权限
255
注册时间
2007-7-20
最后登录
2024-1-15
1#
发表于 2007-9-14 09:27:52 |显示全部楼层
看起来代码没有问题,您用FileAppend函数调试一下,确认是否执行到加仓的代码
代码如下:

  1. if (BarStatus == 2 and MarketPosition == -1)
  2. {
  3.         extryLots=A_FreeMargin /(Q_AskPrice*ContractUnit*MarginRatio);
  4.         extryLots  = IntPart(extryLots );
  5.         if(condtion and Time<0.144500 )
  6.         {
  7.                FileAppend("C:\\Formula.log","Date_lastbar="+Text(Date)+",Time_lastbar="+Text(100*Time)+",extryLots="+Text(extryLots));
  8.                SellShort( extryLots  ,Close,True);
  9.         }
  10. }Else If(BarStatus <> 2 and MarketPosition == -1 )
  11. {
  12.         extryLots=CurrentCapital/(Close*ContractUnit*MarginRatio);
  13.         extryLots  = IntPart(extryLots ); // 取整
  14.         if(condtion and Time<0.144500 )                       
  15.         {
  16.                FileAppend("C:\\Formula.log","Date="+Text(Date)+",Time="+Text(100*Time)+",extryLots="+Text(extryLots));
  17.                SellShort( extryLots  ,Close,True);
  18.         }
  19. }
复制代码

[ 本帖最后由 nopain 于 2007-9-14 12:07 编辑 ]

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-22 10:45

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部