I am using 2 TSF indicators, both with different Periods, one with 20 and the other is 18. I am trying to create a bracket for the TSF indicator with the 18 period. The 18 period will have it's value, so I'm trying to be able to have the option to that value to calculate +300 amd -300 points and show it on the chart. I am using tick data. Would really appreciate any help. thanks!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Ninja Script Indicator help (TSF + AddOns)
Collapse
X
-
Ninja Script Indicator help (TSF + AddOns)
I am actually trying to do this with the time series forecast (TSF) indicator.
I am using 2 TSF indicators, both with different Periods, one with 20 and the other is 18. I am trying to create a bracket for the TSF indicator with the 18 period. The 18 period will have it's value, so I'm trying to be able to have the option to that value to calculate +300 amd -300 points and show it on the chart. I am using tick data. Would really appreciate any help. thanks!
Tags: None
-
Hello skywalkers,
The easiest way to do this would be to create two plots for those values. Each plot could then be set to the original indicator value plus or minus 300.
Plots have the same number of slots as the bars on the chart so you could make a consistent plot by setting the value for each OnBarUpdate call.
-
Thanks Jesse,
Since I have no coding experience at all, given I looked over the link you had included above, I am not sure where to begin. Additional help if you can. Thanks very much
Comment
-
Hello skywalkers,
The easiest way to get a script set up with plots would be to use the NinjaScript editor and generate a new indicator, in the dialog that comes up you can set up plots which will generate the code from the page I linked.
To set a plot you can then use the plots name like this:
To get the code for any indicator you want to use you can use the Strategy Builder to generate that code. To do that you would need to make a condition that uses the indicator and then click View Code. That will show the code which is structured very similar to an indicator. You would only need to copy the parts of the code related to using the custom indicator.Code:PlotName[0] = your value;
After doing that you would have a indicator that can plot and the code to use your custom indicator to get values. The next step would be to use math to add or subtract from that value.
The TSF looks like the following to get its value:
To offset that you can make another variable like this:Code:double tsfValue= TSF(3, 20)[0];
Then all that is needed is to set those values to the plot:Code:double offsetTsfValueMinus = tsfValue - 300 * TickSize; double offsetTsfValuePlus = tsfValue -+300 * TickSize;
Code:PlotName[0] = offsetTsfValueMinus; OtherPlotName[0] = offsetTsfValuePlus;
Comment
-
-
Hello Jesse,
Looks more like I will need help writing the code, I have tried and cannot get it to work. Can you provide a template, would be greatly appreciated. Thanks.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
600 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment