Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Error on closing a position
 Post subject: Error on closing a position Post rating: 0   New post Posted: Thu 04 Nov, 2010, 17:17 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
Hi Support,
I'm testing a strategy with demo account. The strategy opens a position then when it tries to close the position it receives the following message:

2010-11-04 16:04:46   Position #190915EUR/USD order close REJECTED, REASON: can't send request to fully close order more than once in a second
2010-11-04 16:04:46   com.dukascopy.api.JFException: Cannot close orders on global accounts. Please open opposite order instead


and doesn't close the position, could you explain it ?

Best regards,
Frank


 
 Post subject: Re: Error on closing a position Post rating: 0   New post Posted: Thu 04 Nov, 2010, 17:33 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
Frank wrote:
Hi Support,
I'm testing a strategy with demo account. The strategy opens a position then when it tries to close the position it receives the following message:

2010-11-04 16:04:46   Position #190915EUR/USD order close REJECTED, REASON: can't send request to fully close order more than once in a second
2010-11-04 16:04:46   com.dukascopy.api.JFException: Cannot close orders on global accounts. Please open opposite order instead


and doesn't close the position, could you explain it ?

Best regards,
Frank



I corrected the code and now the strategy receives only the message:
2010-11-04 16:04:46   com.dukascopy.api.JFException: Cannot close orders on global accounts. Please open opposite order instead
[/code]

and doesn't close the position, could you explain it ?


 
 Post subject: Re: Error on closing a position Post rating: 0   New post Posted: Thu 25 Nov, 2010, 10:26 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
If you use global account, please open opposite position with the same amount to close the position.


 
 Post subject: Re: Error on closing a position Post rating: 0   New post Posted: Thu 25 Nov, 2010, 11:12 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
Support wrote:
Hi,
If you use global account, please open opposite position with the same amount to close the position.


Hi,
for testing the strategy I'm using a demo account, what does mean "global account" ?

Best regards,
Frank


 
 Post subject: Re: Error on closing a position Post rating: 0   New post Posted: Thu 25 Nov, 2010, 13:14 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
Support wrote:
Hi,
If you use global account, please open opposite position with the same amount to close the position.


Hi,
for testing the strategy I'm using a demo account, what does mean "global account" ?
To close a Long position I even tried to open an opposite Sell position, but the server doesn't close the first Long position and open a new Short position.

Best regards,
Frank


 
 Post subject: Re: Error on closing a position Post rating: 0   New post Posted: Fri 26 Nov, 2010, 09:28 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
To close the order on the Demo account you need use the IOrder.close() method. For details please take a look at the following JForex Wiki page: https://www.dukascopy.com/wiki/index.php ... ose_Orders


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com