- 精华
- 0
- 在线时间
- 96 小时
- UID
- 66209
- 积分
- 128
- 帖子
- 78
- 阅读权限
- 40
- 注册时间
- 2011-9-18
- 最后登录
- 2020-12-20
- 精华
- 0
- UID
- 66209
- 积分
- 128
- 帖子
- 78
- 主题
- 19
- 阅读权限
- 40
- 注册时间
- 2011-9-18
- 最后登录
- 2020-12-20
|
求问,上下这两段,逻辑上有没有区别?有什么区别?
一个是在if里面算,一个在if外面算。
——————————————————————————————————————
If(MarketPosition<>1 && CrossOver(High,bh))
{
MyPriceB=Highest(High[1],n)+offset*minpoint;
MyPriceB = Max(Open,MyPriceB);
Buy(Lots,MyPriceB);
}
If(MarketPosition<>-1 && CrossUnder(Low,bl))
{
MyPriceS=Lowest(Low[1],n)-offset*minpoint;
MyPriceS = Min(Open,MyPriceS);
SellShort(Lots,MyPriceS);
}
——————————————————————————————————————
MyPriceB=Highest(High[1],n)+offset*minpoint;
MyPriceS=Lowest(Low[1],n)-offset*minpoint;
If(MarketPosition<>1 && CrossOver(High,bh))
{
MyPriceB = Max(Open,MyPriceB);
Buy(Lots,MyPriceB);
}
If(MarketPosition<>-1 && CrossUnder(Low,bl))
{
MyPriceS = Min(Open,MyPriceS);
SellShort(Lots,MyPriceS);
}
|
|