Dukascopy
 
 
Wiki JStore Search Login

JForex completely hangs some times (caused by P/L indicator?)
 Post subject: JForex completely hangs some times (caused by P/L indicator?) Post rating: 0   New post Posted: Wed 20 Sep, 2017, 12:01 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
I noticed strange deadlocks in JForex this week - typically this occurs when I switch time interval of the chart (e.g. 1h -> 5min), some time - right after focusing to another chart window. During 'deadlock' UI is completely unresponsive and task manager shows CPU usage of 13% (this is approximately 1/8th of my 8 core i7 CPU) - these are the symptoms of endless cycle somewhere in UI thread.

The only way to handle the problem - kill JForex process from task manager (on Windows). The last time I was waiting for 10 minutes or so before killing the process - this definitely looks like deadlock, not like some lengthy lag.

After some experiments I noticed that problem is most probably caused by Profit/Loss indicator. Below are the experiments I've done to diagnose the problem:
- 4 restarts ended with the same deadlock - after switching 1h -> 5min, strange thing - switching from 1h to some other intervals causes freezes (few seconds), but UI finally restores
- after removing P/L indicator from chart - no deadlock upon switching between any intervals and switching is performed noticeably faster
- i tried re-adding P/L indicator - UI deadlocked immediatelly

Please fix P/L indicator.


 
 Post subject: Re: JForex completely hangs some times (caused by P/L indicator?) Post rating: 0   New post Posted: Tue 31 Oct, 2017, 10:11 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
I could not repeat the problem.

Please attach your workspace to help in replicating the problem.


 
 Post subject: Re: JForex completely hangs some times (caused by P/L indicator?) Post rating: 0   New post Posted: Tue 31 Oct, 2017, 18:39 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
Right now I do not have a workspace which reproduces hanging JForex and i do not have a "stable way" to create it :(

Though I believe that root of the problem is somewhere in the code evaluating the P/L indicator. May we start with the P/L problem described here?
https://www.dukascopy.com/swiss/english ... 618#p91618

I just reproduced it once again on freshly created demo account:
Login DEMO2PTfTG
Password PTfTG

Attached is the workspace i see on screen and screenshot where P/L indicator is present, but is not rendered.
Image


Attachments:
test-pl-screenshot.png [78.5 KiB]
Downloaded 262 times
JForex-test-pl.xml [131.5 KiB]
Downloaded 232 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: JForex completely hangs some times (caused by P/L indicator?) Post rating: 0   New post Posted: Mon 06 Nov, 2017, 13:45 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
We will take care of this problem.


 
 Post subject: Re: JForex completely hangs some times (caused by P/L indicator?) Post rating: 0   New post Posted: Tue 14 Nov, 2017, 00:10 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
One more thing regarding P/L indicator - it seems it fails to initialize properly when added programmatically from plugin into already existing sub-panel with VOLUME indicator, i receive such message
23:02:31 Error in indicator: java.lang.NullPointerException @ com.dukascopy.indicators.ProfitLossIndicator.calculate(ProfitLossIndicator.java:184)

Here is my code
            IIndicator indicator = context.getIndicators().getIndicator("P/L");

            List<IIndicatorPanel> panels = chart.getIndicatorPanels();
            if( panels.isEmpty())
                chart.add(indicator,
                        null, new Color[] {Color.RED}, new DrawingStyle[] {DrawingStyle.LINE}, new int[] {2});
            else
                panels.get(0).add(indicator,
                        null, new Color[] {Color.RED}, new DrawingStyle[] {DrawingStyle.LINE}, new int[] {2});


 

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