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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    134 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    75 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    119 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    114 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    90 views
    0 likes
    Last Post CarlTrading  
    Working...
    X