Dukascopy
 
 
Wiki JStore Search Login

Not working procedure to get actual position
 Post subject: Not working procedure to get actual position Post rating: 0   New post Posted: Mon 14 Oct, 2013, 21:06 

User rating: 0
Joined: Thu 25 Jul, 2013, 21:54
Posts: 7
Hi,

in attachment a code that is not working as expected.

Should be quite simple: start, subscribe an instrument and every minutes get actual position on this instrument and print it!
But it's not working!

Here is the log:
"Level Date Message
INFO 14.10.2013 19:46:01 Position: 0.0
INFO 14.10.2013 19:45:01 Position: 0.0
INFO 14.10.2013 19:44:01 Position: 0.0
INFO 14.10.2013 19:43:01 Position: 0.0
INFO 14.10.2013 19:42:08 Strategy "TestGetPosition" Strategy ID: is started at 2013-10-14 19:42:08.081 GMT on the remote server with no parameters"


As you see always say 0.0 position but it's not true! as you can see from the attached printscreen!

I can add that last week the SAME code was working perfectly.

Also I noticed that this code starts working OK if at any time during the execution I manually make a trade. As you can see from this log:
INFO 14.10.2013 20:01:00 Position: 0.048
INFO 14.10.2013 20:00:18 Order FILLED at 1.23433 CHF (#216821299 SELL 0.004 mil. EUR/CHF @ MKT) - Position #646092EUR/CHF
INFO 14.10.2013 20:00:18 Order ACCEPTED: #216821299 SELL 0.004 mil. EUR/CHF @ MKT
INFO 14.10.2013 20:00:01 Position: 0.0
INFO 14.10.2013 19:59:01 Position: 0.0


After I manually made a trade (sold 0.004) the code started to work!! Before was telling me I had 0.0, the I sold 0.004 and is telling me that now I have 0.048, that actually is correct! But why only after I make trade it start working?

Please help me with this because it's a critical issue for my strategies. All my strategies now don't work anymore!

Best regards,
Riccardo

Important Note:
1) Code is NOT working only in "remote run". In "local run" it's perfect
2) My account is a "Global account"
Image


Attachments:
JForex Printscreen.jpg [85.16 KiB]
Downloaded 367 times
TestGetPosition.java [3.22 KiB]
Downloaded 181 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Not working procedure to get actual position Post rating: 0   New post Posted: Tue 15 Oct, 2013, 09:47 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Did you correctly subscribe instruments in the strategy code?

https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=50192


 
 Post subject: Re: Not working procedure to get actual position Post rating: 0   New post Posted: Tue 15 Oct, 2013, 10:13 

User rating: 0
Joined: Thu 25 Jul, 2013, 21:54
Posts: 7
API Support wrote:
Did you correctly subscribe instruments in the strategy code?

https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=50192


Yes! Or at least I think yes, if you look in my code (in attachment of original post) I subscribed the instrument.


 
 Post subject: Re: Not working procedure to get actual position Post rating: 0   New post Posted: Wed 16 Oct, 2013, 12:27 

User rating: 0
Joined: Thu 25 Jul, 2013, 21:54
Posts: 7
Any news on this issue?

It's a critical problem for all my strategies!

Regards


 

Jump to:  

  © 1998-2024 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