.NET Data Plugin - "function-name not available" Exception

Tags: #<Tag:0x00007f8044d34b38>



I'm working on my first (data) plugin for AmiBroker, based on AmiBroker .NET SDK that I found here: https://github.com/kriasoft/amibroker

The plugin is recognized and I can create a new DB with it...it will properly execute the configuration by calling method Configure(string path, IntPtr infoSitePtr) from my DLL. I've also attached Visual studio debugger and all methods except GetQuotesEx() are called by AmiBroker (breakpoints get hit)

However, when (after configuration) I click a symbol name to load the data into chart I get an exception popup, which I think is because AmiBroker can't find some method (function-name not available): https://www.screencast.com/t/iPbyLDAUaE

Could it be that AmiBroker can't find GetQuotesEx()? Or is there any other method it's trying to call? Any hints would be appreciated.

Here is how my GetQuotesEx (added inside Plugin.cs with the rest of the methods) method looks like:

[DllExport(CallingConvention = CallingConvention.Cdecl)]
public static unsafe int GetQuotesEx(string ticker, Periodicity periodicity, int lastValid, int size, Quotation* quotes, GQEContext* context)
    //breakpoint is set on first line, but never hit
    //code to get data here
    //return from method
    AmiBroker.Plugin.Plugin.Status = StatusCode.OK;
    return lastValid + 1;


Forgot to mention, I've also looked at official ADK, and I have all required methods exported in my plugin:
GetPluginInfo() - works since plugin is recognized and visible under plugins
Init() - exported but empty body
Release() - exported but empty body
GetQuotesEx() - not hit

Is there any other method that gets called and could be missing in my plugin (or is AmiBroker in fact complaining about not finding GetQuotesEx())?


This project seems dead - with the last update being 5 years ago. If you really want to use C#, you may consider this commercial software http://www.dotnetforab.com/downloads. I have hired the author to do a couple of projects over the years. He is pretty competent.


There are a lot more users who uses the aforementioned product, e.g. This thread



@Greyleaf, thanks for pointing that out, will try it.

But on the other side the official ADK is also 5 years old (latest post dated August 2010) so I thought .NET version should still work. Were there any changes to AmiBroker API?


There does not need to be update just for update sake and version bumping. The API just works. The only thing that would need an update is element wise matrix operations.

But matrix feature is still young one. And T.J. explains in same thread when update to that will be released.

But again point is just because something is "old" does not mean it is outdated and obsolete. :roll_eyes:

If something just works for a long time then it means someone has done a pretty good job.


@fxshrat , yeah, I agree (Greyleaf made me think I'm really using something outdated)....I think being 5 years old and still working just means that AmiBroker API was well thought and designed.

I'm still using trial version of AmiBroker so I don't think adding Matrix support will effect me for now (want to make sure I can get crypto currencies data into AmiBroker before I purchase it - didn't find any plugins that fit my needs so I'm trying to write my own one).

Any idea what would that exception mean or how can I debug it?


I did not try this myself
Please let us know if it works for you


@PWFores, thanks, but I've already tested that and the plugin (or better cryptocompare.com API) only provides intraday (15 minutes) data for last 7 days, which is not enough to do any proper backtesting. I've also talked with author but he stopped replying, so I decided to try to make my own plugin (getting data directly from exchange).


The ideal is to never need to change the API. Properly designed API works always. Sure we can add features in backward compatible way, but general principle is that API "just works" no matter how old it is and that is the case for AmiBroker.

The exception you are getting is NOT coming from AmiBroker but from .NET thingy.
Sorry, but I don't appreciate all ".NET" framework. It shares all design flaws of Java and both .NET and Java result in bloatware.


@Tomasz, yep, good job on that (that's not always the case with other APIs).

Are you sure exception is from .NET "thingy"? I've just set up breakpoints in all of the files/methods of the plugin and none of the breakpoints gets hit before that exception pops up, which makes me think exception is not coming from plugin. Any suggestion how could I figure out where exactly exception occurs?

P.S.: I've decided to use C# since I have some experience with it, but never used C++.


Yes the exception is generated by the .NET. I am sure. On your screenshot the call stack clearly says MSVCR120_CLR0400.DLL which is .NET Common Language runtime.

Such DLL is NOT used by AmIBroker as AmiBroker does NOT use .NET.

It is only used by 3rd party .NET plugins and call stack clearly points to that.

Besides the exception code is E0434352 which is .NET EXCEPTION: https://stackoverflow.com/questions/6244939/how-do-i-fix-a-net-windows-application-crashing-at-startup-with-exception-code

The 'function-name not available' just means that Microsoft DBGHELP library could not find the function name (because the plugin or some other code was compiled without debug information).


@Tomasz thanks for explanation, makes sense now. Will look into it and post here if I find a solution.


SOLVED: The problem was with plugin (.NET) not able to find additional dependencies I included (providing the DLL file and path where to load it from solved the issue).

And yeah, https://github.com/kriasoft/amibroker still works even if it's 5 years old.