示例#1
0
        public bool reqCloseAll(string sComment = "")
        {
            int        nPosCnt = m_site.getPosCount_vt(m_sSymbol, m_sLogicID);
            ETRADER_OP nCmd    = ETRADER_OP.NONE;
            double     dPrice  = 0;
            double     dLots   = 0;

            for (int i = 0; i < nPosCnt; i++)
            {
                nCmd = m_site.getPosCmd_vt(m_sSymbol, i, m_sLogicID);
                if (nCmd == ETRADER_OP.BUY)
                {
                    nCmd = ETRADER_OP.BUY_CLOSE;
                }
                if (nCmd == ETRADER_OP.SELL)
                {
                    nCmd = ETRADER_OP.SELL_CLOSE;
                }

                dPrice = m_site.getPosClosePrice_req(m_sSymbol, i, m_sLogicID);
                dLots  = m_site.getPosLots_exc(m_sSymbol, i, m_sLogicID);
                m_site.reqOrder(m_sSymbol, nCmd, ref dLots, ref dPrice, EORDER_TYPE.MARKET, m_sLogicID, sComment);
            }

            return(true);
        }