Dec-23-2018, 09:44 PM
(This post was last modified: Dec-23-2018, 10:09 PM by Gribouillis.)
Hey guys!
Anyone can help me, I'm trying to write this C code in python, but I don't know how to do.
I'm stuck in this code I loose a lot of hours.
Anyone can help me, I'm trying to write this C code in python, but I don't know how to do.
I'm stuck in this code I loose a lot of hours.
///////////////////////////////////////////////////////////////////////////// // WARNING: Não utilizar funções da dll dentro do CALLBACK //////////////////////////////////////////////////////////////////////////////// //Callback do stado das diferentes conexões typedef void (__stdcall *TStateCallback)(int nResult, int result); //////////////////////////////////////////////////////////////////////////////// //Callback com informações marketData typedef void (__stdcall *TNewTradeCallback)(TAssetID assetId, wchar_t* date, float price, float vol, int qtd, int buyAgent, int sellAgent, int tradeType); typedef void (__stdcall *TNewDailyCallback)(TAssetID TAssetIDRec, wchar_t* date, float sOpen, float sHigh, float sLow, float sClose, float sVol, float sAjuste, float sMaxLimit, float sMinLimit, int sVolBuyer, int sVolSeller, int nQtd, int nNegocios, int nContratosOpen, int nQtdBuyer, int nQtdSeller, int nNegBuyer, int nNegSeller); typedef void(__stdcall *TNewHistoryCallback)(TAssetID assetId, wchar_t* date, float price, float vol, int qtd, int buyAgent, int sellAgent, int tradeType); typedef void(__stdcall *TProgressCallBack)(TAssetID assetId, int nProgress); typedef void(__stdcall *TNewTinyBookCallBack)(TAssetID assetId, float price, int qtd, int side); //////////////////////////////////////////////////////////////////////////////// // Functions From ProfitDLL extern "C" { typedef signed char (__stdcall *InitializeMarket)(const wchar_t *activationKey, TStateCallback stateCallback, TNewTradeCallback newTradeCallback, TNewDailyCallback newDailyCallback, TNewHistoryCallback newHistoryCallback, TProgressCallBack progressCallBack, TNewTinyBookCallBack newTinyBookCallBack); typedef signed char (__stdcall *Finalize)(); typedef signed char (__stdcall *SubscribeTicker)(const wchar_t *ticker, const wchar_t *bolsa); typedef signed char (__stdcall *UnsubscribeTicker)(const wchar_t *ticker, const wchar_t *bolsa); typedef wchar_t* (__stdcall *GetAgentNameByID)(int nID); typedef wchar_t* (__stdcall *GetAgentShortNameByID)(int nID); typedef signed char(__stdcall *GetHistoryTradesInInterval)(const wchar_t *pwcTicker, const wchar_t *bolsa, wchar_t* dateStart, wchar_t* dateTimeStart); } // #Functions // Error Codes const signed char NL_OK = 0; // OK //const signed char NL_LOGIN_INVALID = [1..4]; // LOGIN INVALID const signed char NL_ERR_INIT = 80; // Not initialized const signed char NL_ERR_INVALID_ARGS = 90; // Invalid arguments const signed char NL_ERR_INTERNAL_ERROR = 100; // Internal error bool g_Activated = false; ////////////////////////////////////////////////////////////////////////////// // DLL Functions InitializeMarket g_initialize; Finalize g_finalize; SubscribeTicker g_subscribe; UnsubscribeTicker g_unsubscribe; GetAgentNameByID g_getAgentName; GetAgentShortNameByID g_getAgentShortName;