Dukascopy
 
 
Wiki JStore Search Login

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

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

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

IChartObjectFactory.createChartWidget causes security prompt to appear
 Post subject: IChartObjectFactory.createChartWidget causes security prompt to appear Post rating: 2   New post Posted: Fri 25 Apr, 2014, 16:17 
User avatar

User rating: 3
Joined: Wed 18 Sep, 2013, 23:40
Posts: 13
Location: SloveniaSlovenia
Since last update of JForex Api I noticed that calling IChartObjectFactory.createChartWidget, when no ICustomWidgetChartObject has been displayed before the call, causes security prompt to appear. Then, regardless of clicking Ok or Cancel, it often hangs the platform for 10 or so seconds.

One workaround is to always have at least one open chart with OHLC index on it.

Steps to reproduce the problem (tested on Windows 7 with Java 7 55):
1. Close all charts.
2. Open single EUR/USD chart and remove all custom chart widgets (OHLC index, ...)
3. Close and reopen the platfom (to make sure that no ICustomWidgetChartObject was displayed before running the strategy).
4. Run attached strategy (Eval.java).

Image

package jforex;

import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IChart;
import com.dukascopy.api.IConsole;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IEngine;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;
import com.dukascopy.api.drawings.IChartObjectFactory;
import com.dukascopy.api.drawings.ICustomWidgetChartObject;

public class Eval implements IStrategy {

    private IContext context;
    private IConsole console;

    @Override
    public void onStart(IContext context) throws JFException {
        this.context = context;
        this.console = context.getConsole();
       
        IChartObjectFactory factory = context.getLastActiveChart().getChartObjectFactory();
        ICustomWidgetChartObject widget = factory.createChartWidget();
    }

    @Override
    public void onStop() throws JFException {
    }

    @Override
    public void onAccount(IAccount account) throws JFException {
    }

    @Override
    public void onMessage(IMessage message) throws JFException {
    }

    @Override
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    }

    @Override
    public void onTick(Instrument instrument, ITick tick) throws JFException {
    }
}


Attachments:
capture.png [75.89 KiB]
Downloaded 357 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: IChartObjectFactory.createChartWidget causes security prompt to appear Post rating: 0   New post Posted: Tue 06 May, 2014, 14:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Fixed with JForex-API 2.9.10


 
 Post subject: Re: IChartObjectFactory.createChartWidget causes security prompt to appear Post rating: 0   New post Posted: Mon 02 Jun, 2014, 16:33 
User avatar

User rating: 3
Joined: Wed 18 Sep, 2013, 23:40
Posts: 13
Location: SloveniaSlovenia
API Support wrote:
Fixed with JForex-API 2.9.10

Just tested it and it works, thank you.


 

Jump to:  

cron
  © 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