|
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.
custom indicator in strategy |
lifon
|
Post subject: custom indicator in strategy |
Post rating: 0
|
Posted: Thu 22 Nov, 2012, 13:32
|
|
User rating: 1
Joined: Mon 27 Feb, 2012, 22:49 Posts: 119 Location: Czech Republic,
|
I’d like to picture some values from my strategy in desktop JForex chart like as an indicator (RSI, ..). I can open chart and add Dukascopy indicator (IChartPanel rmiPanel = Chart.add( indicators.getIndicator("RMI"), new Object[]{15, 1}); )
But if I take source code RMI indicator (from SDK) and put it into my strategy as a class ÏndicatorRMI, I can NOT add this indicator to chart. I use this code: IndicatorRMI ind = new IndicatorRMI(); IChartPanel indPanel = Chart.add( ind, new Object[]{ 15, 1 } ); I receive NullPointerException. But both objects are not null. I tried it on live account. On demo it doesn't work too. It is very important for me. Could you advise me?
Thanks very much.
|
|
|
|
 |
API Support
|
Post subject: Re: custom indicator in strategy |
Post rating: 0
|
Posted: Thu 22 Nov, 2012, 16:44
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please provide both the indicator and the example program that is plotting it on the chart.
|
|
|
|
 |
lifon
|
Post subject: Re: custom indicator in strategy |
Post rating: 0
|
Posted: Thu 22 Nov, 2012, 19:58
|
|
User rating: 1
Joined: Mon 27 Feb, 2012, 22:49 Posts: 119 Location: Czech Republic,
|
Here is example code for testing. I have tested it this afternoon only on demo account. Live account was not accessible.
Attachments: |
CheckChartAddInd.java [8.1 KiB]
Downloaded 302 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.
|
|
|
|
|
 |
API Support
|
Post subject: Re: custom indicator in strategy |
Post rating: 0
|
Posted: Fri 23 Nov, 2012, 08:23
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
lifon
|
Post subject: Re: custom indicator in strategy |
Post rating: 0
|
Posted: Fri 23 Nov, 2012, 11:08
|
|
User rating: 1
Joined: Mon 27 Feb, 2012, 22:49 Posts: 119 Location: Czech Republic,
|
I don't understand. Strategy opens chart. I see it.You can check it too.
Links solve chart open for standalone API and don't solve adding indicator. It implements IClient.
My strategy is not standalone. I run it under JForex desktop. I implement IStrategy direct.
|
|
|
|
 |
API Support
|
Post subject: Re: custom indicator in strategy |
Post rating: 0
|
Posted: Fri 23 Nov, 2012, 11:53
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
lifon
|
Post subject: Re: custom indicator in strategy |
Post rating: 0
|
Posted: Fri 23 Nov, 2012, 13:09
|
|
User rating: 1
Joined: Mon 27 Feb, 2012, 22:49 Posts: 119 Location: Czech Republic,
|
But registration get JFException: Cannot create indicator...
Attachments: |
CheckChartAddInd.java [8.44 KiB]
Downloaded 313 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.
|
|
|
|
|
 |
API Support
|
Post subject: Re: custom indicator in strategy |
Post rating: 0
|
Posted: Fri 23 Nov, 2012, 14:11
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
The indicator has to be an inner public static class, as it is given in the example under the above given link.
|
|
|
|
 |
lifon
|
Post subject: Re: custom indicator in strategy |
Post rating: 0
|
Posted: Fri 23 Nov, 2012, 14:41
|
|
User rating: 1
Joined: Mon 27 Feb, 2012, 22:49 Posts: 119 Location: Czech Republic,
|
Now it works. Thanks very much. Have a nice weekend.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|