Dukascopy Support Board http://www.dukascopy.com/swiss/english/forex/jforex/forum/ |
|
CustomCandleIndicator for 100 Tickbars - help needed http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=51616 |
Page 1 of 1 |
Author: | ccadar [ Sun 31 Aug, 2014, 11:21 ] | ||
Post subject: | CustomCandleIndicator for 100 Tickbars - help needed | ||
Dear Support, I'm trying to modify the code of the "CustomCandleIndicator.java" (attached) from jforex API in order to be able to draw custom Tickbars candles on the chart. Could you please give me some hints? I'm totally lost in rewriting the "calculate" function. On the other hand I think I must use the history.getTickBar(Instrument, OfferSide.ASK, TickBarSize.valueOf(100), i);function to get the tickbars candles if I'm not wrong. Thank you.
|
Author: | API Support [ Tue 02 Sep, 2014, 14:57 ] | ||
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed | ||
The task would be much easier to be done from a strategy, consider the following example:
|
Author: | ccadar [ Tue 02 Sep, 2014, 19:11 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
wow fantastic code! thanks a lot Support!! One more question, I'm thinking of defining another TickBarFeedDescriptor for the BID price as well, would it be possible to get both the BID and ASK bars at the same time into onFeedData function so that both BID and ASK bars would be available in sync as an input for the drawCandle function? something like this :
I have a little algo which combines both BID and ASK prices into one price. Thank you |
Author: | API Support [ Wed 03 Sep, 2014, 08:35 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
ccadar wrote: that both BID and ASK bars would be available in sync as an input for the drawCandle function? Both of the ITimedData elements will arrive in the IFeedListener.onFeedData almost simultaneously, but they will be in 2 different listener calls, thus:
|
Author: | ccadar [ Wed 03 Sep, 2014, 10:15 ] | ||
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed | ||
Thanks again! Another small problem... I cannot get rid of the text with numbers close to rectangle objects which makes the chart pretty ugly. Is there a function to disable that label ? (see attachement)
|
Author: | API Support [ Wed 03 Sep, 2014, 13:20 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
Consider replacing the rectangle with a poly-line, but the disadvantage is that you can't fill the poly-line. If the coordinate label is really disturbing, please create a feature request in our forum. |
Author: | ccadar [ Wed 03 Sep, 2014, 14:12 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
API Support wrote: Consider replacing the rectangle with a poly-line, but the disadvantage is that you can't fill the poly-line. If the coordinate label is really disturbing, please create a feature request in our forum. Thanks but I have had another idea: - set rectangle color to the background color(making it invisible) and set its opacity to zero. - use IFillableChartObject to fill the rectangle with RED/GREEN color and set its opacity to 1: for(IChartDependentChartObject obji : new IChartDependentChartObject[]{rectangle}){ P.S: I still don't understand why we cannot use a rectangle with a clear body only with those labels..that should be changed IMO. Thanks once again for your help! |
Author: | ccadar [ Wed 21 Oct, 2015, 16:01 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
Hello Support, Could you please describe me how you draw the candelsticks on the Jforex Tickbar chart? This solution with polylines are not working because the Tickbar candlesticks are popping up at irregular time intervals as opposed to 1 minute candlesticks for instance, thus their bodies will have a certain variations in the width. Your tickbar candlesticks are too perfect in Jforex chart. Can I find somewhere the java code for drawing Tickbar candlesticks in Jforex? Thank you |
Author: | API Support [ Thu 05 Nov, 2015, 08:49 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
It is now possible to use rectangles without labels: IRectangleChartObject.setSizeLabelEnabled(false); |
Author: | ccadar [ Sun 08 Nov, 2015, 07:47 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
API Support wrote: It is now possible to use rectangles without labels: IRectangleChartObject.setSizeLabelEnabled(false); thanks for the info! I got another problem, could you please let me know how to insert some white space (pixels) between two consecutive candlesticks (rectangles) ? Thank you |
Author: | API Support [ Mon 09 Nov, 2015, 09:26 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
That can be solved by adding time padding before and after each bar:
|
Author: | ccadar [ Mon 11 Jan, 2016, 14:41 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
Hi Support, Could you please give me a hint how to call the CustomCandleIndicator within this strategy in order to make use of its drawCandle function instead of drawing rectangles which have scaling problems and look pretty ugly. Perhaps I need to adjust the CustomCandleIndicator as well a little bit.... Thanks |
Author: | API Support [ Tue 12 Jan, 2016, 09:08 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
Could you, please, rephrase the question? |
Author: | ccadar [ Tue 12 Jan, 2016, 10:41 ] |
Post subject: | Re: CustomCandleIndicator for 100 Tickbars - help needed |
The "CustomCandleIndicator.java" indicator makes use of Graphics2D class so that I don't have scaling problems with the candlestick drawn by this indicator but this indicator does not work with 100 Tickbars input. I would like to extend this indicator to work with 100 Tickbars as well. Could you please give me some hints how to do that? Thank you |
Page 1 of 1 |