如题
ea经常出现failed market sell 0.01 USDCAD [Market closed]
或是failed market sell 0.01 USDJPY [No prices]
看没人回复,说说我近期的解决方案吧,抛砖引玉吧
MarketBookAdd(main) //打开市场深度
- MqlBookInfo main_price_array[];
- bool main_get_book=MarketBookGet(main, main_price_array);//再查看市场深度
- if(main_get_book){
- int size = ArraySize(main_price_array);
-
- bool has_buy = false;
- bool has_sell = false;
- for(int i=0;i < size; i++){
- if(main_price_array.type == BOOK_TYPE_BUY){
- has_buy = true;
- }else if(main_price_array.type == BOOK_TYPE_SELL){
- has_sell = true;
- }
-
- }
-
- if(!has_buy || !has_sell){//买价卖价其中之一没有就retrun,看个人需要
- return;
- }
-
- }else{
-
- return;
- }
复制代码
[No prices]还是没解决,以市价发送的订单,没理由啊 |