o rders ควรถูกนับก่อนสิ่งใดๆ และควรนับใหม่ทุกครั้งที่มีการเปิดหรือปิดการซื้อขาย ซึ่งอยู่ด้านบน รหัสที่แทรก int buys,sells,buy_pending,sell_pending; double buy_lots, sell_lots; p ใช้สิ่งนี้ในฟังก์ชั่น start() คำสั่งแทรกรหัส (); ใช้สิ่งนี้ที่ด้านล่างสุด รหัสคำสั่งที่แทรกเป็นโมฆะ () { ซื้อ = 0; ขาย=0; buy_lots=0; sell_lots=0; buy_pending=0; ขาย_รอดำเนินการ=0; int totalorders = OrdersTotal(); สำหรับ (int i=totalorders-1;igt;=0;i--) { OrderSelect(i, SELECT_BY_POS); ถ้า ( OrderType() == OP_BUY OrderSymbol()==Symbol()) {buys ;buy_lots=buy_lots OrderLots();} ถ้า ( OrderType() == OP_SELLOrderSymbol()==Symbol() ) {sells ;sell_lots= sell_lots OrderLots();} if (OrderSymbol()==Symbol()){ if (OrderType() == OP_BUYLIMIT||OrderType() == OP_BUYSTOP) buy_pending ; ถ้า (ประเภทการสั่งซื้อ() == OP_SELLLIMIT||ประเภทการสั่งซื้อ() == OP_SELLSTOP) ขาย_pending ; } } } ชั่วโมง นี่คือสิ่งที่คุณควรมี ใส่รหัส/ --------------------------------------- ------------------------------ /| count_orders.mq4 |/| ลิขสิทธิ์ © 2010, thomas liles, [email protected] |/| http://www.trendchaser.org |/ ---------------------------------------------- ------------------- #ทรัพย์สินลิขสิทธิ์ ลิขสิทธิ์ © 2010, thomas liles, [email protected] #property link http://www.trendchaser.org int buys, ขาย,buy_pending,sell_pending; double buy_lots, sell_lots;/ ---------------------------------------------- ------------------- //| ฟังก์ชั่นการเริ่มต้นของผู้เชี่ยวชาญ |/ ---------------------------------------------- ------------------- int init() {/----/---- กลับ (0); }/ ---------------------------------------------- -------------------- /| ฟังก์ชัน deinitialization ผู้เชี่ยวชาญ |/ ---------------------------------------------- ------------------- int deinit () {/----/---- กลับ (0); }/ ---------------------------------------------- -------------------- /| ฟังก์ชั่นเริ่มต้นผู้เชี่ยวชาญ |/ ---------------------------------------------- ------------------- int start () {/---- คำสั่งซื้อ ();/---- กลับ (0); }/ ---------------------------------------------- -------------------- คำสั่งซื้อที่เป็นโมฆะ () { ซื้อ = 0; ขาย=0; buy_lots=0; sell_lots=0; buy_pending=0; ขาย_รอดำเนินการ=0; int totalorders = OrdersTotal(); สำหรับ (int i=totalorders-1;igt;=0;i--) { OrderSelect(i, SELECT_BY_POS); ถ้า ( OrderType() == OP_BUY OrderSymbol()==Symbol()) {buys ;buy_lots=buy_lots OrderLots();} ถ้า ( OrderType() == OP_SELLOrderSymbol()==Symbol() ) {sells ;sell_lots= sell_lots OrderLots();} if (OrderSymbol()==Symbol()){ if (OrderType() == OP_BUYLIMIT||OrderType() == OP_BUYSTOP) buy_pending ; ถ้า (ประเภทการสั่งซื้อ() == OP_SELLLIMIT||ประเภทการสั่งซื้อ()== OP_SELLSTOP) ขาย_pending ; } } }