|
Error message |
Eric
|
Post subject: Error message |
Post rating: 0
|
Posted: Sun 29 Jul, 2012, 12:03
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
Hi All,
After converting a MT4 indicator, I get 2 errors which I can't figure out :
10:44:31 Error in indicator: java.lang.NullPointerException @ jforex.converted.Chart_Infos.start(Chart_Infos.java:98)
10:44:31 WARNING: selected Instrument is null, take: EURUSD
If someone can help me to solve these errors.
Thank you very much. Eric
|
|
|
|
 |
API Support
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Mon 30 Jul, 2012, 07:12
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please provide the indicator mq4 file.
|
|
|
|
 |
Eric
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Mon 30 Jul, 2012, 10:47
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
Here is attached.
Thank you.
Attachments: |
Chart_Infos.mq4 [11.42 KiB]
Downloaded 336 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: Error message |
Post rating: 0
|
Posted: Mon 30 Jul, 2012, 12:49
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Launch the script as a strategy, not an indicator, because there is no trading data available from an indicator. For launch instructions see "Convert a strategy" section in the description topic viewtopic.php?f=16&t=47063
|
|
|
|
 |
Eric
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Tue 31 Jul, 2012, 07:29
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
Thank you.
Will look at this and will let you know.
|
|
|
|
 |
Eric
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Tue 31 Jul, 2012, 14:53
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
When I open it as a strategy, it gives error at compile :
13:41:57 public class Chart_Infos extends MQL4ConnectorIndicator { 13:41:57 ^^^^^^^^^^^ 13:41:57 The public type Chart_Infos must be defined in its own file 13:41:57 ----------
Thank you for your support.
|
|
|
|
 |
API Support
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Tue 31 Jul, 2012, 15:17
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please delete the .java and .jfx files and repeat the conversion.
|
|
|
|
 |
Eric
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Tue 31 Jul, 2012, 16:50
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
Compiled fine. Thank you.
Once applied, the display on chart doesn't respect the proper corner, color, font size ... etc ... of the original mq4 coding. Is that due to a convertion issue ?
|
|
|
|
 |
API Support
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Tue 31 Jul, 2012, 17:01
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
It's because there is no such Label object in JForex-API which can be plotted in a relative distance from a chart corner. Therefore the visualization that you see is a workaround, which makes use of the chart comment.
|
|
|
|
 |
Eric
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Tue 31 Jul, 2012, 18:09
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
So why if I apply the mq4 converted in an indicator, the display (the part with no error) respect perfectly the original mq4 display ?
|
|
|
|
 |
API Support
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Wed 01 Aug, 2012, 08:40
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Because an indicator has a direct access to chart, whilst strategies can create their objects only through determined API methods (i.e. IChartObjectFactory).
|
|
|
|
 |
Eric
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Wed 01 Aug, 2012, 09:26
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
Ok. Thank you.
Will try to manage this ...
|
|
|
|
 |
Eric
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Fri 03 Aug, 2012, 07:16
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
API Support wrote: Because an indicator has a direct access to chart, whilst strategies can create their objects only through determined API methods (i.e. IChartObjectFactory). I'm back on this answer. Does that mean that there's no way to create an object (for strategy) with settable Font, FontSize, Corner, etc ... ? I didn't figure out how to do. If this is possible, it would be great to have just an example of code for an object with defined Font, FontSize, Corner, etc ... Or even just a link in the forum pointing to a strategy already coded with objects plotted on chart. Thank you again for your support.
|
|
|
|
 |
API Support
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Fri 03 Aug, 2012, 07:30
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Eric wrote: I'm back on this answer. Does that mean that there's no way to create an object (for strategy) with settable Font, FontSize, Corner, etc ... ? From strategy one can plot only objects in time-price coordinate system (also with font, font size properties); a single comment (see IChart methods setComment, setCommentFont, setCommentHorizontalPosition, setCommentVerticalPosition); ohlc object, one can't, however, plot a label in a certain pixel distance from a corner. See the text object: https://www.dukascopy.com/wiki/#Chart_object_catalog/TextYou can try out plotting the comment within the template: https://www.dukascopy.com/wiki/#Chart_object_catalog
|
|
|
|
 |
Eric
|
Post subject: Re: Error message |
Post rating: 0
|
Posted: Fri 03 Aug, 2012, 11:51
|
|
User rating: 0
Joined: Tue 24 Jul, 2012, 12:38 Posts: 41
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|