Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
draw between 2 averages
Collapse
X
-
draw between 2 averages
so I'm trying to have a green area where the slope of the 2 moving averages is both up, and a red area where the slope of the 2 moving averages is down. The slope being defined as just the value of the moving average now, currently, compared to the value at close of last bar. This is not working out well.... code attached. Right now both red and green are drawing at the same time I think. I'm sure I'm not seeing something obvious... any help would be appreciated. Thanks.Tags: None
- Likes 1
-
Hello tvaughan4,
Thanks for your post.
As is your code will error out (check the "Log" tab of the control center for the error message).
You have public outputs but have not created them (the addplots are commented out). If you uncomment them and recompile the indicator will produce plots in the indicator panel and the draw.region will draw the region on the price panel.
The draw region can only ever be one color at a time because you are using the same tag name for the red and for the green and you are drawing the region from the first bar of the series to the current bar each time, therefore which ever condition last draws the region, that is the color it will be from beginning to end.
If you want to region to be colored as the conditions occur and to retain their colors then you will need to add much more logic to be able to draw separate regions. This would involve using unique tag names for each separate region and saving/using specific start/end bars for the regions. You can find an example of the type of logic needed in the NT user apps indicator: https://ninjatraderecosystem.com/use...plestate_v4-2/ Please note: The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
- Likes 1
-
would you mind attaching that indicator here? the downloads don't seem to be working in the ecosystem right now.
ya, I tried the different tag names. I had a feeling it was the start/stop times and tag names. not as easy as I would have hoped it seems...
- Likes 1
Comment
-
Hello tvaughan4,
Thanks for your reply.- I am having no difficulty downloading from the link. We'll need more information to find out why you're unable to download from our Ecosystem site. Please answer all of the following questions:
- What version of Windows are you using?
- What web browser are you using?
- Does this symptom persist if your clear your browser's cache?
- What about if you use a different web browser?
- What about after you turn off your PC, turn off your modem/router for at least 30 seconds, then restart your PC?
Comment
- I am having no difficulty downloading from the link. We'll need more information to find out why you're unable to download from our Ecosystem site. Please answer all of the following questions:
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