Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
New Trendline indicator NT8
Collapse
X
-
New Trendline indicator NT8
Well... it might just be new to me. That's neither here nor there. I'm currently trying to practice writing strategies using the indicator trendline but I cannot get it to trigger for some reason. In every scenario that I try to type I get an error message saying error on calling on bars update method on bar 21. You are accessing an index with a value that is invalid since it is.... I cant see the rest. Does anyone have a simple sample strategy in which it triggers either when the price crosses through the trendline or even just painting the background when the trendline appears -
Hello rwest30379,
I'm not aware of any existing strategies that call the Trend line indicator.
This thread will remain open for any community members that would like to provide you with a strategy script.
The Trendline indicator draws a Ray object on the chart. It would be necessary to loop through all of the drawing objects on the chart. If the count of DrawObjects is greater than one, then there is a drawing object on the chart.
For each ray on the chart, you may try using a sub-string of the Tag to see if it starts with "Trend line high" or "Trend line low".
Alternatively, you could make a copy of the Trend line indicator and have this set a plot value to 1, 0, or -1 when an object is drawn so that this could easily be detected by a calling script.
Regarding indexing errors, below is a link to a forum post that discusses indexing errors.
Hello, I want to create an indicator that show data in a chart but calculate in other charttime different to the time of the chart where is showed. For example:
What is the line of code that is causing an indexing error?
(You can use prints to find the line and index that is invalid)
Chelsea B.NinjaTrader Customer Service
- Likes 1
-
ChelseaB-
Thanks for your post.
How do I get the Trendlines indicator to populate a column in the Market Analyzer and enable alerts when crosses take place?
Comment
-
-
Hello rwest30379,
The Trend lines indicator is not designed for use with the Market Analyzer.
You could make a copy of the Trend line indicator and have this set a plot value to 1, 0, or -1 when an object is drawn so that this could easily be detected by a calling script.
Below is a link to an example that sets a plot value for use with the Market Analyzer (or calling from a host script).
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, 04-17-2024, 06:40 PM
|
3 responses
26 views
0 likes
|
Last Post Today, 07:41 AM | ||
Started by bmartz, 03-12-2024, 06:12 AM
|
3 responses
27 views
0 likes
|
Last Post Today, 07:38 AM | ||
Started by Aviram Y, Today, 05:29 AM
|
2 responses
8 views
0 likes
|
Last Post
by Aviram Y
Today, 07:38 AM
|
||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
1 response
8 views
0 likes
|
Last Post Today, 07:30 AM | ||
Started by cls71, Today, 04:45 AM
|
1 response
7 views
0 likes
|
Last Post Today, 07:25 AM |
Comment