Page 1 of 1

Debug Assertion Failed

Posted: Mon Dec 21, 2015 6:41 pm
by t56
Here's my code:

char buff[1000];
sprintf(buff, "%d;0;0;%s;Close", 60, StrMAType(ma_EMA));
IndMA = CreateIndicator("EURUSD", 120, "MovingAverage", buff);
SetIndicatorBuffStyle(IndMA, 0, psSolid, 1, clYellow);

But running that in FT2, directly after code "IndMA = CreateIndicator(.." the following error-box occures.
Any idea???

attachment.jpg
attachment.jpg (41.71 KiB) Viewed 28942 times

Re: Debug Assertion Failed

Posted: Tue Dec 22, 2015 8:47 am
by FX Helper
Hello,

You need to set this code in ResetStrategy function:

For example:

EXPORT void __stdcall ResetStrategy()

{

IndMACD = CreateIndicator("EURUSD", 15, "MACD", "8;20;12;Close");



char buff[1000];

sprintf(buff, "%d;0;0;%s;Close", MATrendPeriod, StrMAType(ma_EMA));

IndMA = CreateIndicator("USDJPY", 60, "MovingAverage", buff);

}

After this, everything should work properly

You can find all necessary info in Forex Tester program, Help -> Stategies API menu, click on CreateIndicator at the bottom of the window.

Re: Debug Assertion Failed

Posted: Wed Dec 23, 2015 4:27 am
by t56
Hi,

thanks for the immediate reply, but unfortunally this not helps. Seem's to be a bug in forextester.exe!?
In the attachment you can find my complete (extremely simple) VS-project: The only real code there is "int IndMACD = CreateIndicator("EURUSD", 15, "MACD", "8;20;12;Close");"

But this code now produces only that:

attachment2.jpg
attachment2.jpg (40.78 KiB) Viewed 28925 times

Any solution?

Re: Debug Assertion Failed

Posted: Wed Dec 23, 2015 4:44 am
by t56
The next resulting question could be:

How to access inbuilt indicator programmatically, importing it directly from it's DLL (for example: MovingAverage.dll)?

Any documentation about? If not, could you provide the sources for those DLL's please? This should help to make there buffers available from outside ... .