Announcement

Collapse
No announcement yet.

Problem in hot trading

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in hot trading

    Hi, would you please tell us the problem of our programming :

    1¡B Variable declaration¡G
    IHooksPtr *m_piHooks = NULL¡F

    2¡BCOM initialization¡G
    try
    {
    m_piHooks = new IHooksPtr("IESignal.Hooks.1");

    m_pEvents = new EventSink(this);
    LPUNKNOWN ****=m_pEvents->GetIDispatch(FALSE);

    /*establish the connection*/
    if(!AfxConnectionAdvise(*m_piHooks,__uuidof(_IHook sEvents),****,FALSE,&m_dwCookie))
    {
    // something bad happened
    return FALSE;
    }

    }
    catch (_com_error &e)
    {
    dump_com_error(e);
    return FALSE;
    }

    3¡Bevent response connection
    DISP_FUNCTION_ID(EventSink, "OnQuoteChanged", 2, OnQuoteChanged, VT_ERROR, VTS_BSTR)
    DISP_FUNCTION_ID(EventSink, "OnBarsChanged", 3, OnBarsChanged, VT_ERROR, VTS_I4)
    DISP_FUNCTION_ID(EventSink, "OnBarsReceived", 4, OnBarsReceived, VT_ERROR, VTS_I4)

    4¡Bevent response
    SCODE EventSink::OnQuoteChanged(LPTSTR symbol)
    {
    if(m_pListener) {
    m_pListener->ES_OnQuoteChanged(symbol);
    }
    return S_OK;
    }

    5¡Bfunction body
    void CBartchEsignalDlg::ES_OnQuoteChanged(LPCTSTR pszSymbol)
    {
    BasicQuote tBasicQuote = (*m_piHooks)->GetGetBasicQuote(pszSymbol);
    }
    Then the application throw exception and run down;

    We use about 640 symbol, the exception always occurs at the time that the market is opening, the trading is very hot

  • #2
    Hello,

    This would actually be expected with that many symbols at a high volume time. An application developed with the Desktop API should be able to make and process requests for about 50-100 symbols at a time. This depends on system resources, internet connection and the types of symbols you are requesting. You might, for example, be able to track 100 pink sheets, but only 25 or fewer symbols with the volume of MSFT or the Qs.

    Comment

    Working...
    X