Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Background color in strategy builder ninja 8

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Attached Files

    #2
    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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    556 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X