Error opening a trade

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Error opening a trade

Postby robocod » Thu Apr 06, 2017 5:53 pm

I have a custom strategy, which in some scenarios can close an existing trade and open in the reverse direction. For example, close an existing long and open a short.

The close is using market close using "netting" order (i.e. NetQtyFlag="Y"). It is for a FIFO account.

In some case, the new trade (i.e. the one after the close) fails to open. I get the following error:

"The account is locked. Trading is not available."

I have no idea what causes this. The strategy seems to recover from this, and later trades work again.

The strategy works ok on back-tester. Could the use of netting order to close all positions somehow prevent the new open order for working?

(PS: Sorry if this is a duplicate post, the forum locked-me out during posting the 1st time, and I'm not sure if it was submitted or not. You may delete the duplicate).
User avatar
robocod
FXCodeBase: Graduate
 
Posts: 298
Joined: Thu May 10, 2012 4:25 pm



Return to Discussions

Who is online

Users browsing this forum: No registered users and 8 guests