Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2623 Set chart/indicator params in Java platform/API
 Post subject: JFOREX-2623 Set chart/indicator params in Java platform/API Post rating: 0   New post Posted: Wed 15 Dec, 2010, 19:27 

User rating: -
see code below;

TradedInstrumentChart = this.DukasContext.getChart ( this.TradedInstrument );

TradedInstrumentChartMaIndicatorFast = this.DukasIndicators.getIndicator ( "SMA" );
TradedInstrumentChart.addSubIndicator ( 1 , TradedInstrumentChartMaIndicatorFast );

TradedInstrumentChartMaIndicatorSlow = this.DukasIndicators.getIndicator ( "SMA" );
TradedInstrumentChart.addSubIndicator ( 1 , TradedInstrumentChartMaIndicatorSlow );

questions;

1. How do i set indicator parameters like Price, Time Period, Color, Width, etc. ?
2. Can I force the indicator to show a different period (i.e., days) when displaying a 10-min chart ?
3. Can I force the Chart to open in a specific period (e.g., 5-min) ?

Thanks


 
 Post subject: Re: How to set chart/indicator parameters via Java platform/ Post rating: 0   New post Posted: Fri 17 Dec, 2010, 12:08 

User rating: 0
Joined: Mon 11 Oct, 2010, 13:42
Posts: 8
Hello,

I'm certainly not a member of Duka's Support, but in the meanwhile, maybe these informations can help you:

1. Have a look here https://www.dukascopy.com/wiki/index.php ... Indicators
2. Yes, that is definitely possible. You could set a configurable parameter, for example:

    @Configurable(value = "TimeFrame")
    public Period period = Period.FIVE_MINS;
    @Configurable(value = "Indicators")
    public Period indiPeriod = Period.FIVE_MINS;


or just change the period directly in the indicator's code.

3. Please elaborate.


 
 Post subject: Re: How to set chart/indicator parameters via Java platform/ Post rating: 0   New post Posted: Sat 18 Dec, 2010, 18:37 

User rating: -
Thanks for the reply, but I guess I wasn't clear ... #1 I am talking about code in a strategy (with visual turned on during develop,ment) ... As you can probably tell, my example uses a fast and a slow MA to make extry/exit decisions ... I would like to be able to see these indicators while developing the startegy, but the code I included always brings up the indicators with a default period ... I want to be able to set them in my startegy code to show say a 50-day and a 250-day MA on the chart associated with the strategy ... to make matters worse, the slow MA maybe in days and the fast in hours ... It appears that there is a way to do this by setting non-optional and/or optional indicator parameters from my sw, but I haven't been able to get that to work ... any help appreciated


 
 Post subject: Re: How to set chart/indicator parameters via Java platform/ Post rating: 0   New post Posted: Sat 08 Jan, 2011, 11:37 

User rating: 0
Joined: Sun 02 Jan, 2011, 00:54
Posts: 2
Dear support - con you please make this issue a priority

this is a common topic, that has appeared since at least 2007 where you have said each time this will be implemented in the near future!

June 2010
viewtopic.php?f=19&t=11040
"Sorry, at the moment this functionality is not available, but we will implement it in a near future."


August 2007
https://www.swfx-market.com/swiss/englis ... 40&start=0
"Sorry, at the moment this functionality is not available, but we will implement it in a near future."

Is it yet implemented, Is it planned, if so then you will know when it is to be expected? Cna you share a little more detail please?

*************************************
It's very difficult to debug strategies without being able to see the indicators that they are working with.
You have a good base in JForex, such a relief to get away from the MT4 universe - but things like this begin to make me look else where.
*************************************


Please give a reasonable expectation of when this will be implemented. It really puts people of when you say "near future" and it is now 3 years later...

Thanks


 
 Post subject: Re: How to set chart/indicator parameters via Java platform/ Post rating: 0   New post Posted: Tue 11 Jan, 2011, 14:12 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Quote:
that has appeared since at least 2007


Posted: Mon 28 Jun, 2010, 09:09

In any case, we are doing our best.


 
 Post subject: Re: JFOREX-2623 Set chart/indicator params in Java platform/ Post rating: 0   New post Posted: Mon 07 Feb, 2011, 11:19 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
1. You can use IChart.addIndicator(IIndicator indicator, Object[] optParams) method to specify optional parameters for the indicator you attach to a chart e.g.
            IIndicator ind = indicators.getIndicator("SMA");
            //setting-up the applied price
            for (int i = 0; i < ind.getIndicatorInfo().getNumberOfInputs(); i++) {
                InputParameterInfo inputParameterInfo = ind.getInputParameterInfo(i);
                inputParameterInfo.setAppliedPrice(AppliedPrice.LOW);
            }                                                   
            chart = context.getChart(Instrument.EURUSD);
            //setting-up time period, color, drawing style and line width
            chart.addIndicator(ind, new Object[]{100}, new Color[]{Color.RED}, new DrawingStyle[]{DrawingStyle.LINE}, new int[]{3});

2. You can achieve this by adding an additional input for a different period to your custom indicator.
3. No, you can't.


 

Jump to:  

  © 1998-2025 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