|
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.
Support / Resistance indicator returns NaN |
Carbunkle
|
Post subject: Support / Resistance indicator returns NaN |
Post rating: 0
|
Posted: Tue 20 Nov, 2012, 21:35
|
|
User rating: 0
Joined: Sun 11 Nov, 2012, 17:50 Posts: 2
|
Hi Support,
Not sure what happened but the supportResitance indicator now returns "NaN". There was no problem before and I didn't change my code. Here is the code I used.
public void onTick(Instrument instrument, ITick tick) throws JFException { double[] SR = indicators.supportResistance(instrument.EURUSD, Period.ONE_MIN, OfferSide.BID, 0); double currentRes = SR[0]; double currentSup = SR[1]; console.getOut().println(currentSup); }
Thanks
|
|
|
|
 |
API Support
|
Post subject: Re: Support / Resistance indicator returns NaN |
Post rating: 0
|
Posted: Wed 28 Nov, 2012, 17:03
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Support and resistance indicator uses the fractal indicator in its calculations with the default value of 2 for the 'Number of bars on sides' parameter which is the value used for Fractal's lookforward. Indicator will return Double.NaN when calculated for the in-progress bar as well as for the bar previous to the in-progress bar. Consider the following: indicators.supportResistance(instrument.EURUSD, Period.ONE_MIN, OfferSide.BID, 2); Notice the value of shift parameter equals 2.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|