Errors with backtesting of custom strategy

Moderator: admin

Errors with backtesting of custom strategy

Postby xEeCVcZzNVHnNlol » Fri Nov 18, 2016 9:19 am

Hi all,

in the past, I have done automatic trading with custom Expert Advisors in MetaTrader 4, but now have switched to Trading Station. Currently, I am trying to rewrite my EAs in lua / IndiCore SDK. Thereby, I have run into problems:

When backtesting my strategy, nothing happens; the strategy tries to open trades, but this obviously fails every time. To debug, I have set a breakpoint in the first code line in AsyncOperationFinished(). The debugger hits that breakpoint as expected, but the success parameter is false, meaning that the trade could not be opened, and the msg parameter is "Specified account is not found".

When hitting the breakpoint, there is only one row in the Accounts table. I have ckecked that row's AccountID field against against Valuemap.AccountID of the Valuemap which is used for opening the trades; they are the same (in my case, they are both TESTACCT).

Could anybody please explain what is happening here?

Thank you very much,

Peter
xEeCVcZzNVHnNlol
 
Posts: 3
Joined: Fri Nov 18, 2016 8:54 am

Re: Errors with backtesting of custom strategy

Postby xEeCVcZzNVHnNlol » Sun Nov 20, 2016 3:08 am

To answer my own question: It is not valuemap.AccountID, but valuemap.AcctID, so no wonder that it didn't find the account. The problem is solved now, it was my own fault.

But now I am having another problem (Trading Station crashes when sending an automatic trade), but I'll open a separate post for that.

Regards,

Peter
xEeCVcZzNVHnNlol
 
Posts: 3
Joined: Fri Nov 18, 2016 8:54 am


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 12 guests