Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

method "setHistogramTwoColor()" in JForex3 fail
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=85&t=54528
Page 1 of 1

Author:  ivan_taranov [ Thu 08 Dec, 2016, 10:57 ]
Post subject:  method "setHistogramTwoColor()" in JForex3 fail

Dear support!

In new JForex 3 the method

setHistogramTwoColor(boolean histogramTwoColor)
(If set to true and drawing style is histogram, then it will be shown in two colors, positive values with green and negative with red)


doesn't works in indicator. Still operates well in old good JForex.

Some source code from my indicator:

public void onStart(IIndicatorContext context)
{
console = context.getConsole();
this.context = context;
this.history = context.getHistory();

indicatorInfo = new IndicatorInfo("Simple", "Simple", "MyIndicators", false, false, false, 1, 0, 1);
indicatorInfo.setRecalculateOnNewCandleOnly(true);

inputParameterInfos = new InputParameterInfo[]
{
new InputParameterInfo("Input data", InputParameterInfo.Type.BAR)
};

outputParameterInfos = new OutputParameterInfo[]
{

new OutputParameterInfo("out", OutputParameterInfo.Type.DOUBLE, OutputParameterInfo.DrawingStyle.HISTOGRAM) {{ setHistogramTwoColor(true); }}
};

}


Would be grateful for help!
Image
Image

Attachments:
JFOREX_Chart_EUR_USD_Daily_snapshot.png [16.45 KiB]
Downloaded 531 times
JFOREX3_Chart_EUR_USD_Daily_snapshot.png [17.92 KiB]
Downloaded 552 times

Author:  Platform Support [ Tue 03 Jan, 2017, 13:14 ]
Post subject:  Re: method "setHistogramTwoColor()" in JForex3 fail

"Trend down" color on histograms are used for values that are less than the previous in JForex 3 now. It used to be applied to negative values, but we do not find it correct.

User can create two outputs for positive and negative values with different colors instead.

  Page 1 of 1