📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    指定货币及订单识别码的持仓单数量统计

    老周 LV16
    2017-03-20 · 2006 阅读

    该函数获取指定货币及订单识别码的持仓单总数量。可以自行设定统计条件。

    1. int CountAll(string a_symbol_0, int a_magic_8, int a_magic_12, int a_magic_16, bool ai_20, int
    2. ai_24) {
    3. int l_count_28 = 0;
    4. for (int l_pos_32 = OrdersTotal() - 1; l_pos_32 >= 0; l_pos_32--) {
    5. OrderSelect(l_pos_32, SELECT_BY_POS, MODE_TRADES);
    6. if (!ai_24 || OrderSymbol() == a_symbol_0) {
    7. if (!ai_20) l_count_28++;
    8. else {
    9. if (a_magic_16 != 0) {
    10. if (a_magic_16 == OrderMagicNumber()) l_count_28++;
    11. else
    12. if (OrderMagicNumber() == a_magic_8 || OrderMagicNumber() ==
    13. a_magic_12) l_count_28++;
    14. }
    15. }
    16. }
    17. }
    18. return (l_count_28);
    19. }
    复制代码


    ""
    还没有人打赏,支持一下
    回复

    举报

     
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服