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
Background color in strategy builder ninja 8
Collapse
X
-
Background color in strategy builder ninja 8
I have created a simple EMA 8/21 crossover strategy in strategy builder of ninjatrader 8 with stops and target of 20/30 ticks, I wanted to color the background of the chart until next opposite crossing but instead it only does it for current cross then revert back to normal chart color background.color. Other problem is it squeezes the chart at current candle but if i scroll back a little it shows correct scaling. How do i correct that. I attached screenshots. can somebody help me. Thx.Tags: None
-
Hello trader333,
For the coloring you would need to use a variable and another few sets for this to work. An Int variable would likely work best to represent 3 states or Off and your two colors.
After creating an int variable, in each set where you have the crossing condition set the variable to a specific value. For example set it to 1 for long, and 2 for short.
In another separate set you could add a condition to check if the variable is 1, if so draw the color you want. The same would go for a second set checking if the variable is 2 to draw a second color.
A third set could be used to control the on/off, for example checking if the Position is flat set it back to 0.
The squeeze looks like it is caused by something being -500, are you drawing any objects or plots at -500?
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Aviram Y, 08-09-2023, 09:04 AM
|
10 responses
298 views
0 likes
|
Last Post
by MrHump
Today, 07:53 AM
|
||
Started by jpapa, Today, 07:22 AM
|
1 response
5 views
0 likes
|
Last Post Today, 07:34 AM | ||
Started by kevinenergy, 02-17-2023, 12:42 PM
|
116 responses
2,758 views
1 like
|
Last Post
by kevinenergy
Today, 07:23 AM
|
||
Started by franatas, 12-04-2023, 03:43 AM
|
7 responses
106 views
0 likes
|
Last Post Today, 07:23 AM | ||
Started by Jltarrau, Today, 05:57 AM
|
3 responses
9 views
0 likes
|
Last Post
by Jltarrau
Today, 07:22 AM
|
Comment