|
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.
| Indicator to display data ahead of the current bar |
|
[daytraderozinuk]
|
| Post subject: Indicator to display data ahead of the current bar |
Post rating: 0
|
Posted: Thu 02 Dec, 2010, 11:43
|
|
User rating: 0
Joined: Thu 02 Dec, 2010, 11:35 Posts: 2
|
|
Hi,
I am working on a predictive indicator that I would like to test. Basically I would like to be able to draw a chart line that includes data points ahead of the current bar.
Eg, if I have an Indicator that simply returns the close price, this will always display a chart output with the leading edge having the same time stamp as the current bar. My indicator predicts the future x step (eg for 10 min data it predicts the next 10 min bar data in advance) so I need to draw the indicator result 1 time step ahead of the current bar time.
I cannot seem to do this in jforex as I always get index out of bounds errors, can you tell me if it is supported?
Many thanks.
|
|
|
|
|
 |
|
tspeicher
|
| Post subject: Re: Indicator to display data ahead of the current bar |
Post rating: 0
|
Posted: Thu 02 Dec, 2010, 13:46
|
|
User rating: 0
Joined: Wed 18 May, 2011, 11:25 Posts: 60 Location: DE
|
|
perhaps you can use the shift-parameter of the OutputParameterInfo with e.g. +1 to move your indicator 1 step forward.
|
|
|
|
|
 |
|
[daytraderozinuk]
|
| Post subject: Re: Indicator to display data ahead of the current bar |
Post rating: 0
|
Posted: Fri 03 Dec, 2010, 17:39
|
|
User rating: 0
Joined: Thu 02 Dec, 2010, 11:35 Posts: 2
|
|
Ok, thanks, I was looking in the wrong spot.
This example snippet will shift the output 2 bars ahead of the current bar.
public OptInputParameterInfo getOptInputParameterInfo(int index) { if (index <= optInputParameterInfos.length) {
// move the output forward 2 bars outputParameterInfos[index].setShift(2);
return optInputParameterInfos[index]; } return null; }
|
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|