老师你好
我通过onposition获取当前多空持仓量
vars
Numeric lots1(0);
Numeric lots2(0);
OnPosition(PositionRef pos)
{
lots1==pos.longCanSellVolume;
lots2==pos.shortCanCoverVolume;
}
然后这个lots1和lots2可以直接放在IF里面用吗?
假如
if(lots1>0 and close<ma5)//多仓持有情况下收盘价破 5均线卖出
{
sell(lots1,open);
}
我这样写有没有问题?实践过没反应
lots1==pos.longCanSellVolume; ==表示判断等于
你的问题太多了,事件域可能不适合你
请用图表函数的持仓操作