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.

custom candlesticks indicator
 Post subject: custom candlesticks indicator Post rating: 0   New post Posted: Sun 16 Feb, 2014, 17:33 

User rating: 3
Joined: Mon 05 Nov, 2012, 11:56
Posts: 80
Location: Germany,
Dear Support,

I'm going to write an indicator to paint my own customized candlesticks on the jforex chart based on the CustomCandleIndicator as example. I need to calculate my own Open, Close, Low, High (an IBar object) based on an algorithm from both Offerside.ASK and Offerside.BID IBar objects. The problem is that the CustomCandleIndicator works with either OfferSide.ASK or OfferSide.BID IBar objects only.

Question: how can I get both the Offerside.ASK and Offerside.BID IBar objects in the drawOutput method of CustomCandleIndicator at the same time ? The InputParameterInfo method offers only one option for the OfferSide settings.

Any example available? if not possible, any workaround?

Thanks in advance!


 
 Post subject: Re: custom candlesticks indicator Post rating: 0   New post Posted: Tue 18 Feb, 2014, 10:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You simply need to add an additional input that would use the needed offer side, see:
https://www.dukascopy.com/wiki/#Indicator_with_multiple_inputs


 
 Post subject: Re: custom candlesticks indicator Post rating: 0   New post Posted: Wed 19 Feb, 2014, 09:56 

User rating: 0
Joined: Thu 07 Jun, 2012, 15:09
Posts: 5
API Support wrote:
You simply need to add an additional input that would use the needed offer side, see:
https://www.dukascopy.com/wiki/#Indicator_with_multiple_inputs


Dear Support,

I modified the CustomCandleIndicator's calculate method by adding both ASK and BID inputs to it, but no candles are shown on the screen now, it seems the method hangs somewhere..

could you please have a look at it? (see the attachment.)


Attachments:
File comment: my modified custom candle indicator
CustomCandleIndicator.java [11.44 KiB]
Downloaded 97 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: custom candlesticks indicator Post rating: 0   New post Posted: Thu 20 Feb, 2014, 15:00 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
For us the indicator does work - it draws candles on chart but after a couple seconds. If you could elaborate on your algorithm maybe we could suggest you how to go about implementing it. Another example which draws custom candles is HeikenAshiIndicator, SentimentIndexBar indicator draws its bars on a separate panel.


 
 Post subject: Re: custom candlesticks indicator Post rating: 0   New post Posted: Thu 20 Feb, 2014, 16:37 

User rating: 0
Joined: Thu 07 Jun, 2012, 15:09
Posts: 5
Dear Support,

Thanks a lot for your kindness in helping me! It works indeed now ;) I would have still two questions to you if possible:

1. Is there any special function available to color the body of the candles(like g.fillRect) within the drawCandle method ?

2. Would it be possible somehow to draw candles of 200 Tickbars each with this modified indicator? I know that Jforex is currently limited to 100 Tickbars, but I would like to take out this limitation with an indicator.

Thanks again !


 
 Post subject: Re: custom candlesticks indicator Post rating: 0   New post Posted: Thu 20 Feb, 2014, 17:12 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
ccadar2 wrote:
1. Is there any special function available to color the body of the candles(like g.fillRect) within the drawCandle method ?

You can have a look at how HeikenAshiIndicator and SentimentIndexBar go about the rectangle filling.
ccadar2 wrote:
2. Would it be possible somehow to draw candles of 200 Tickbars each with this modified indicator? I know that Jforex is currently limited to 100 Tickbars, but I would like to take out this limitation with an indicator.
If you wish to construct your own tick bars then you would need to work with the IHistory methods, because indicators don't work with tick feed - when you select tick feed they actually calculate over 1-sec bars.


 
 Post subject: Re: custom candlesticks indicator Post rating: 0   New post Posted: Thu 20 Feb, 2014, 21:20 

User rating: 3
Joined: Mon 05 Nov, 2012, 11:56
Posts: 80
Location: Germany,
One more issue: If I put the mouse on my custom candles the original candlesticks in the background are being highlighted as shown in the screenshot attached, this results in a mess....

How can I get rid of the original jforex candlesticks completely? For the time being they are not visible in the background until I put the mouse on them.

Thanks in advance.


Image


Attachments:
candles.jpg [83.49 KiB]
Downloaded 359 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: custom candlesticks indicator Post rating: 0   New post Posted: Fri 21 Feb, 2014, 10:29 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It is not the original candles, but rather the handles of the indicator's candles. Simply don't put any values to the handles map and there will not be any "highlightings".


 

Jump to:  

cron
  © 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