设为首页收藏本站

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

空头止赢无效! [复制链接]

Rank: 4

精华
0
UID
188
积分
597
帖子
91
主题
27
阅读权限
50
注册时间
2007-8-24
最后登录
2019-4-5
跳转到指定楼层
1#
发表于 2007-9-14 00:28:38 |只看该作者 |倒序浏览
if (BarStatus <> 2)       
  //多头止赢
{ If(CurrentContracts == 3 && High-AvgEntryPrice>17)
     { Sell(1,Close);}
        Else If(CurrentContracts==2 && High-AvgEntryPrice> 23)
     { Sell(1,Close);}
        Else if(szwy )                   //三只乌鸦形态的时候 在下根K线收盘价平多仓
      {Sell(CurrentContracts,Close,True);}
  //空头止赢  
       
   If(CurrentContracts==3 && AvgEntryPrice-Low>17)
     {  BuyToCover(1,Close);}
        Else If(CurrentContracts==2 && AvgEntryPrice-Low>  23)
     {  BuyToCover(1,Close);}
        Else   if(sly )                  //在三连阳形态的时候 在下根K线收盘价平空仓
         { BuyToCover(Abs(CurrentContracts()),Close,True);}
  }
Else
//多头止赢
{  If(A_BuyPosition==3 && High-A_BuyAvgPrice>17)
     { Sell(1,Close);}
        Else If(A_BuyPosition==2 && High-A_BuyAvgPrice> 23)
     { Sell(1,Close);}
        Else if(szwy )                   //三只乌鸦形态的时候 在下根K线收盘价平多仓
                 {Sell(1,Close,True);}
//空头止赢  
       
If(CurrentContracts==3 && A_SellAvgPrice-Low>17)
     {  BuyToCover(1,Close);}
        Else If(CurrentContracts==2 && A_SellAvgPrice-Low>  23)
     {  BuyToCover(1,Close);}
        Else   if(sly )                  //在三连阳形态的时候 在下根K线收盘价平空仓
         { BuyToCover(Abs(CurrentContracts()),Close,True);}
  }



指令在空头行情中不能有效果的止赢 不知道错在那里了?请帮个忙看看!

Rank: 4

精华
0
UID
188
积分
597
帖子
91
主题
27
阅读权限
50
注册时间
2007-8-24
最后登录
2019-4-5
2#
发表于 2007-9-14 00:39:57 |只看该作者
我明白了!需要在 空头那里加  Abs(CurrentContracts()),



//止赢       
if (BarStatus == 2)       
//多头止赢
{  If(A_BuyPosition==3 && High-A_BuyAvgPrice>17)
     { Sell(1,Close);}
        Else If(A_BuyPosition==2 && High-A_BuyAvgPrice>23)
     { Sell(1,Close);}
        Else if(szwy )                   //三只乌鸦形态的时候 在下根K线收盘价平多仓
                 {Sell(1,Close,True);}
//空头止赢  
       
If(abs(CurrentContracts())==3 && A_SellAvgPrice-Low>17)
     {  BuyToCover(1,Close);}
        Else If(abs(CurrentContracts())==2 && A_SellAvgPrice-Low> 23)
     {  BuyToCover(1,Close);}
        Else   if(sly )                  //在三连阳形态的时候 在下根K线收盘价平空仓
         { BuyToCover(Abs(CurrentContracts()),Close,True);}
  }
Else
//多头止赢
{ If(CurrentContracts == 3 && High-AvgEntryPrice>17)
     { Sell(1,Close);}
        Else If(CurrentContracts==2 && High-AvgEntryPrice> 23)
     { Sell(1,Close);}
        Else if(szwy )                   //三只乌鸦形态的时候 在下根K线收盘价平多仓
      {Sell(CurrentContracts,Close,True);}
  //空头止赢  
       
   If(abs(CurrentContracts())==3 && AvgEntryPrice-Low>17)
     {  BuyToCover(1,Close);}
        Else If(abs(CurrentContracts())==2 && AvgEntryPrice-Low> 23)
     {  BuyToCover(1,Close);}
        Else   if(sly )                  //在三连阳形态的时候 在下根K线收盘价平空仓
         { BuyToCover(Abs(CurrentContracts()),Close,True);}
  }

使用道具 举报

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

bottom

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

GMT+8, 2024-5-1 13:50

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部