LinearReg=LinReg(Highs[1],Length)[0];
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Indicators on Multi Time Frame
Collapse
X
-
Indicators on Multi Time Frame
I cannot seem to get this working properly. I am calculating an indicator off of the highs/lows of a second data series. I am using the following code...
When I input Highs[1] it seems to be interpreting it as 1 bar ago instead of accessing my second data stream. Am I doing this correctly?Code:Tags: None
-
I've done that and no joy. I noticed something interesting. The following code gives me a plot, but has a 1 bar lag.
The following code gives me no plot...Code:If (BarsInProgress==1) LinearReg=LinReg(High,Length); StrategyPlot(0).Value.Set(LinearReg)
This may provide the explaination. Does StrategyPlot run on secondary datastream?Code:If (BarsInProgress==1) { LinearReg=LinReg(High,Length); StrategyPlot(0).Value.Set(LinearReg) }
Comment
-
Remember that StrategyPlot is provided with limited functionality. This may be one of its limitations.
I am surprised that this worked for you though: LinearReg=LinReg(High,Length);
I would suspect LinearReg to be a double and that you would need to actually set a value to it instead of a DataSeries. If you are using them as DataSeries maybe try changing it to double and doing LinearReg=LinReg(High,Length)[0]; and then set it to the StrategyPlot that way.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
67 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
36 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
59 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment