|
JFOREX-1960 : Draw built-in indicators through API |
API Support
|
Post subject: JFOREX-1960 : Draw built-in indicators through API |
Post rating: 0
|
Posted: Tue 15 Sep, 2009, 10:19
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
How to draw an indicator through API-functionality: package jforex;
import java.util.*;
import com.dukascopy.api.*; import com.dukascopy.api.indicators.*;
public class Strategy1156 implements IStrategy { private IEngine engine; private IConsole console; private IHistory history; private IContext context; private IIndicators indicators; private IUserInterface userInterface; private IChart chart; private IIndicator indicator; public void onStart(IContext context) throws JFException { this.engine = context.getEngine(); this.console = context.getConsole(); this.history = context.getHistory(); this.context = context; this.indicators = context.getIndicators(); this.userInterface = context.getUserInterface(); chart = context.getChart(Instrument.EURUSD);
chart.addSubIndicator(indicators.getIndicator("ALLIGATOR")); indicator = indicators.getIndicator("VOLUME"); chart.addSubIndicator(1, indicator); }
public void onAccount(IAccount account) throws JFException { }
public void onMessage(IMessage message) throws JFException { }
public void onStop() throws JFException { chart.removeIndicator(indicator); }
public void onTick(Instrument instrument, ITick tick) throws JFException { } public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException { } }
Attachments: |
Strategy1156.java [1.31 KiB]
Downloaded 644 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.
|
|
|
|
|
|
nicofr0707
|
Post subject: Re: Draw built-in indicators through API |
Post rating: 0
|
Posted: Mon 21 Jun, 2010, 18:15
|
|
User rating: 5
Joined: Fri 02 Sep, 2011, 10:08 Posts: 157 Location: FranceFrance
|
Thanks, please how do you set and get the parameters for the indicator loaded with getIndicator() ?
For exemple for stDev : (Instrument instrument, Period period, OfferSide side,IIndicators.AppliedPrice appliedPrice, int timePeriod, double nbDev, int shift)
Thanks.
|
|
|
|
|
[d3m0traider]
|
Post subject: Re: Draw built-in indicators through API |
Post rating: 0
|
Posted: Mon 28 Jun, 2010, 09:00
|
|
User rating: 0
Joined: Mon 28 Jun, 2010, 08:19 Posts: 4
|
nicofr0707 wrote: Thanks, please how do you set and get the parameters for the indicator loadedwith getIndicator() ? Good question, i would like to find that out as well.
|
|
|
|
|
API Support
|
Post subject: Re: Draw built-in indicators through API |
Post rating: 0
|
Posted: Mon 28 Jun, 2010, 09:09
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Sorry, at the moment this functionality is not available, but we will implement it in a near future.
|
|
|
|
|
[d3m0traider]
|
Post subject: Re: JFOREX-1960 : Draw built-in indicators through API |
Post rating: 0
|
Posted: Mon 28 Jun, 2010, 11:03
|
|
User rating: 0
Joined: Mon 28 Jun, 2010, 08:19 Posts: 4
|
Support wrote: Sorry, at the moment this functionality is not available, but we will implement it in a near future. Thanks for the info. Also, when I add indicator with getIndicator() method (stochastic for example) - both lines are black for some reason. Do I need to set indicator colors manually? Thanks.
|
|
|
|
|
API Support
|
Post subject: Re: JFOREX-1960 : Draw built-in indicators through API |
Post rating: 0
|
Posted: Thu 15 Jul, 2010, 14:05
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
This is our bug. It will be fixed.
|
|
|
|
|
buyandhold
|
Post subject: Re: JFOREX-1960 : Draw built-in indicators through API |
Post rating: 0
|
Posted: Sun 01 Aug, 2010, 04:51
|
|
User rating: 0
Joined: Wed 18 May, 2011, 23:26 Posts: 40 Location: Switzerland,
|
Has this been fixed? If so, is there sample code available?
Thanks Duka support!
|
|
|
|
|
MoneyMechanics
|
Post subject: Re: JFOREX-1960 : Draw built-in indicators through API |
Post rating: 0
|
Posted: Sun 01 Aug, 2010, 04:58
|
|
User rating: 0
Joined: Thu 16 Jun, 2011, 21:37 Posts: 98 Location: SwitzerlandSwitzerland
|
Hi, I'd like to also second the request for being able to editing the parameter info for loaded Indicators.
Has this been added as setInputParameter(int index, Object array) for IIndicator? Could you use an example please...
thanks in any case, jForexUser
|
|
|
|
|
MoneyMechanics
|
Post subject: Re: JFOREX-1960 : Draw built-in indicators through API |
Post rating: 0
|
Posted: Fri 15 Oct, 2010, 00:39
|
|
User rating: 0
Joined: Thu 16 Jun, 2011, 21:37 Posts: 98 Location: SwitzerlandSwitzerland
|
I just noticed that this has been updated. thanks for doing this edit://just realized that on the API documentation site this has been marked although the API I have downloaded does not have this. Any idea when this API will be released? Using JForex-API 2.6.17 and jForex 2.5.1 Thanks!
|
|
|
|
|
|
Pages: [
1
]
|
|
|
|
|