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.

CPU load will be 100% when call JforexSDK functions to connect JForex servers
 Post subject: CPU load will be 100% when call JforexSDK functions to connect JForex servers Post rating: 0   New post Posted: Sun 07 Jun, 2015, 16:02 
User avatar

User rating: 0
Joined: Mon 09 Feb, 2015, 13:40
Posts: 11
Location: China,
Hello,

Recently I noticed CPU load will be 100% when call JforexSDK functions to connect JForex servers.
Any suggestion for this ? Is this a sync call?

Thanks.


 
 Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers Post rating: 0   New post Posted: Mon 08 Jun, 2015, 08:10 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please describe what is the problem exactly?


 
 Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers Post rating: 0   New post Posted: Mon 08 Jun, 2015, 15:49 
User avatar

User rating: 0
Joined: Mon 09 Feb, 2015, 13:40
Posts: 11
Location: China,
My question is :
when my program call call JforexSDK functions (remotely), the CPU will be 100%.
e.g.IEngine.submitOrder()
This is not a shared CPU,it is a dedicated CPU , why this happend? Any comments to optimize?


 
 Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers Post rating: 0   New post Posted: Fri 12 Jun, 2015, 12:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We would need code example that can reproduce this problem.


 
 Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers Post rating: 0   New post Posted: Sun 14 Jun, 2015, 15:45 
User avatar

User rating: 0
Joined: Mon 09 Feb, 2015, 13:40
Posts: 11
Location: China,
It is a very simple example to call "m_Engine.submitOrder" serveral times to submit my orders, while "m_Engine.submitOrder" sometimes causes high CPU load , which leads to long call latency.

...
try{
double Price = tick.getAsk();
double SLPrice;
double ratio = instrument.getPipValue();
int ratio1 = ( int)( 1 / ratio);
Price = Math.floor( Price * 0.9 * ratio1) / ratio1;
SLPrice = Math.floor( Price * 0.5 * ratio1) / ratio1;
double Amounts;
if ( Price > 300)
Amounts = 10 * 1e-6;
else
Amounts = 1000 * 1e-6;
String orderLabel = "Opt_" + gDateFormatYMDHMSLabel.format( tick.getTime());
m_Engine.submitOrder(
orderLabel, // label
instrument, // instrument
IEngine.OrderCommand.BUYLIMIT,
Amounts,
Price, // price
0, // slippage
SLPrice,
0 // takeprofitprice
);
}
catch( JFException e){
this.m_LogPrintWriter.println( gDateFormatYMDHMS.format( time) + ";TraderLogic;Block_JForexAPIEffeciencyInitialization;submitOrder() JFException;" + e.getMessage());
}


 
 Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers Post rating: 0   New post Posted: Mon 15 Jun, 2015, 15:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We were unable to reproduce this.


 
 Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers Post rating: 0   New post Posted: Tue 16 Jun, 2015, 16:43 
User avatar

User rating: 0
Joined: Mon 09 Feb, 2015, 13:40
Posts: 11
Location: China,
could you leave me your email, so I can send the whole project to you?
(I don't want the attach my project here in public)


 

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