|
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 |
SimonS
|
Post subject: CPU load will be 100% when call JforexSDK functions to connect JForex servers |
Post rating: 0
|
Posted: Sun 07 Jun, 2015, 16:02
|
|
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.
|
|
|
|
 |
API Support
|
Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers |
Post rating: 0
|
Posted: Mon 08 Jun, 2015, 08:10
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please describe what is the problem exactly?
|
|
|
|
 |
SimonS
|
Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers |
Post rating: 0
|
Posted: Mon 08 Jun, 2015, 15:49
|
|
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?
|
|
|
|
 |
API Support
|
Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers |
Post rating: 0
|
Posted: Fri 12 Jun, 2015, 12:23
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
We would need code example that can reproduce this problem.
|
|
|
|
 |
SimonS
|
Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers |
Post rating: 0
|
Posted: Sun 14 Jun, 2015, 15:45
|
|
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()); }
|
|
|
|
 |
API Support
|
Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers |
Post rating: 0
|
Posted: Mon 15 Jun, 2015, 15:20
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
We were unable to reproduce this.
|
|
|
|
 |
SimonS
|
Post subject: Re: CPU load will be 100% when call JforexSDK functions to connect JForex servers |
Post rating: 0
|
Posted: Tue 16 Jun, 2015, 16:43
|
|
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)
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|