Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
GetYByValue returning unexpected values
Collapse
X
-
GetYByValue returning unexpected values
i have two indicators MyRegressionChannelIndicator (RCI) and MyRegressionFramesIndicator (RFI). RCI is a modified version of the RegressionChannel indicator by NT. An RCI instance is referenced in RFI. When rendered RCI functions on its own correctly when added to the chart. However, the RFI does not render due to wierd values coming from the call to GetYByValue() which is executed in both RCI and RFI when called from OnRender. The core logic of RCI has to be separated from the presentation logic in both indicators, hence each has a similar implementation of the OnRender method. My goal is to have multiple instances of the RCI within the RFI each corresponding to a different data series type/period. I have attached my scripts. Any help is appreciated!Tags: None
-
Hello love2code2trade,
Are the values in the script which is not working valid and within the visible range on the chart? To use GetYByValue the price needs to be a valid price which you can see within the chart panel, if you are using a value which is outside the panel that may be why the values are not as expected.
-
hi Jesse,
Thanks for the prompt reply. Below is a sample of the debug output. The prices are all within the visible range. However, for the same price that is correctly being passed to RCI and the correct y-value returned from GetYPos, that is not the case for the RFI.
RCI GetYPos price: 5544.8880952381
RCI GetYPos price: 5547.76904761905
RCI OnRender bi: 9869 startVector: X:1303 Y:634 endVector: X:1823 Y:595 Width: 2
RFI GetYPos price: 5544.8880952381
RFI GetYPos price: 5547.76904761905
RFI OnRender bi: 9869 startVector: X:1303 Y:-3326048 endVector: X:1823 Y:-3327776 Width: 2
RCI GetYPos price: 5544.875
RCI GetYPos price: 5547.79642857143
RCI OnRender bi: 9869 startVector: X:959 Y:652 endVector: X:1479 Y:612 Width: 2
RFI GetYPos price: 5544.875
RFI GetYPos price: 5547.79642857143
RFI OnRender bi: 9869 startVector: X:959 Y:-3425030 endVector: X:1479 Y:-3426835 Width: 2
Comment
-
-
It seems to be an issue with using the RCI as an instance within the RFI i.e.
else if (State == State.Configure) {
ClearOutputWindow();
_10s = MyRegressionChannelIndicator(Period);
}
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment