A_Sendorderex函数信号净仓为0,账户净仓为2,why,谢谢!

hi,老师好 ,代码是我照着视频老师的代码豆二3600以下网格价格每下跌20布买单各1手,即3600-580-3560-----每下跌20布买单1手A_Sendex函数信号净仓为0(最高价为3583 应该会成交1手),账户净仓为2,委托价3600/3580 成交价3570/3570 相差太多了(详见下图) 我设置的委托-滑点-5跳 相差太大了 请问什么原因、怎么解决Params Numeric GridStartPrice(3600); // 网格起始价格 在此价格以下买 Integer GridStep(20); // 网格的大小 Integer GridLength(15); // 网格格数 Vars series<Numeric> BS(1); // 交易方向,1-多,-1空 Global Integer flag(0); // 老师写的 Global Integer flag(0); series<Numeric> CurGridPrice; series<Numeric> tpprice; series<Numeric> reprice; EventsOnBar(ArrayRef<Integer> indexs){ If(AccountDataExist() && IsTradingTime(SystemDateTime) && BarStatus==2 && flag==0) //下面flag==1 锁住了 只循环一次 //布单仅布1次 下一次for循环 不仅这个 { Print("-----------------------------------------"); Print(timetostring(SystemDateTime)); //Print(timetostring(Date+Time)); Print("网格交易启动, BarStatus="+Text(BarStatus)); // LogFile报错说函数没有被声明 ("网格交易启动, BarStatus="+Text(BarStatus)); Numeric i; // 网格布单 不定成交 先挂单 for i = 1 to GridLength { // 做多往下网格价格计算 CurGridPrice = GridStartPrice - (i-1) * GridStep * BS; //前面BS是说明书原码 BS=IIF(BS,1,-1) 老师是这样打印 array<Integer> orderids; if(A_SendOrderEx(symbol,iif(BS==1,Enum_Buy,Enum_Sell),Enum_Entry,1,CurGridPrice,orderids)) //合约用symbol 手工设置 在什么合约上加载就好了 { Print("---------------网格抄底布单---------------"); Print("网格抄底布单,第"+text(i)+"格...."); //LogFile报错说函数没有被声明 Print("网格布单价CurGridPrice= "+text(CurGridPrice)); //LogFile报错说函数没有被声明 flag = 1; //flag = 1不能等于0 无法再次布单了 控制布单次数 只做1次 } } }}

那3600这个价格不是你填的吗? 你填低点不就好了