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: 292
Joined: Thu May 10, 2012 4:25 pm

Re: Error opening a trade

Postby Apprentice » Tue Apr 11, 2017 4:13 am

User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 17415
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Discussions

Who is online

Users browsing this forum: No registered users and 1 guest