public DataApiImpl(IntPtr handle, bool is_owner) { this.is_owner = is_owner; this.handle = handle; on_quote = (quote) => { if (OnMarketQuote != null) { OnMarketQuote(quote); } }; on_bar = (cycle, bar) => { if (OnBar != null) { OnBar(cycle, bar); } }; TqapiDll.dapi_set_callback(this.handle, on_quote, on_bar); }