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


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.

1 Like

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.

1 Like

@theanimalix is there any reference application I can refer too? I am trying to create data plug in using SDK but getting errors and not able to understand how should I start?

Any demo app or anything that will help me to understand is really appreciated.


Which SDK? You need to be specific.

This one, C# version.

This is 3rd party development not supported by AmiBroker (like all other .NET).

AmiBroker Development Kit (ADK) is for C/C++ and is available from http://www.amibroker.com/download.html and it is the ONLY development kit that is supported.

1 Like

Yes I got it. But I am not good in C/C++. I am working in C#.NET using Visual Studio community edition. I am interested in fetching the intraday data from following url using C# SDK plugin

There is absolutely no point in doing that as this intraday data from NSE are already available via AmiQuote:

Also, I want to reiterate that: .NET is NOT supported.

Don't use it. All those third party .NET SDKs are known to create problems with AmiBroker. Plugins should NOT be created using .NET.

.NET itself is a result of lost battle with Sun when Microsoft lost their case in court so they could not use Sun's Java. Microsoft's .NET was attempt on create "better Java" but it failed. .NET design is flawed from the very beginning (the same way as Java design is flawed).

When you write the plugin with C++ it is just say 20-100KB (yes kilobytes) and no extra runtimes needed. If you write with .NET you need 50MB of extra executables / runtime. And program that uses .NET automatically needs 100-500x more RAM than equivalent C/C++.NET is bloated beyond all measures.

Did you see our own plugins written in C++? Largest one is IB plugin (161KB) - mainly because we had to incorporate some TWS API code - it is bloated as well. But our IQFeed plugin is just 55KB, eSignal plugin 67KB, Metastock plugin 21KB, QuoteTracker plugin 23KB. They don't need any extra runtime. That is what plugins should look like. They should be tiny and not consume RAM.

It is not possible to do that with .NET