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.

How to create a plugin to view the dynamic real-time price
 Post subject: How to create a plugin to view the dynamic real-time price Post rating: 0   New post Posted: Wed 17 Dec, 2014, 20:11 
User avatar

User rating: 0
Joined: Sat 02 Aug, 2014, 10:12
Posts: 23
Location: China, Shijiazhuang
Excuse me!

I saw a plugin which would draw the dynamic real-time price of market on the charts.
It is very much close to what I need to develop recently, just because I need to get the real-time data.

My question are:
1.There is not a method like OnTick(...), so how can the plugins get the real-time datas of the markets?
2.I saw that this plugin is a .jfx, so how to compile a plugin with a expanded-name as ".jfx" ?

Please forgive my simple questions, I am new to plugins, Could someone help me?

Best regards.

N.S.
Image


Attachments:
pic.png [4.36 KiB]
Downloaded 243 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.
 
The Best Answer  Post subject: Re: How to create a plugin to view the dynamic real-time price Post rating: 1   New post Posted: Thu 18 Dec, 2014, 10:10 
User avatar

User rating: 7
Joined: Tue 28 Feb, 2012, 09:45
Posts: 45
Location: JapanJapan
How about this?
Answer 1:
IContext.subscribeToTicksFeed(Instrument instrument, ITickFeedListener listener)
(https://www.dukascopy.com/client/javadoc ... ntext.html)

Sample code,
package Sample;

import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.feed.ITickFeedListener;
import com.dukascopy.api.plugins.IPluginContext;
import com.dukascopy.api.plugins.Plugin;

public class Sample extends Plugin implements ITickFeedListener {

    private IPluginContext context;
   
   @Override
    public void onStart(final IPluginContext context) throws JFException {
      this.context = context;
      context.subscribeToTicksFeed(Instrument.AUDCAD, this);
   }
   

    @Override
    public void onStop() throws JFException {
       context.unsubscribeFromTicksFeed(this);
    }


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



Answer 2:

Image


Attachments:
createjfx.png [10.57 KiB]
Downloaded 226 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: How to create a plugin to view the dynamic real-time price Post rating: 0   New post Posted: Fri 19 Dec, 2014, 03:26 
User avatar

User rating: 0
Joined: Sat 02 Aug, 2014, 10:12
Posts: 23
Location: China, Shijiazhuang
Thank you very much for your perfect answer and help! :D


 

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