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!
See more
See less

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Johnny Santiago, 10-11-2019, 09:21 AM
    95 responses
    6,193 views
    0 likes
    Last Post xiinteractive  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    2 responses
    11 views
    0 likes
    Last Post xiinteractive  
    Started by Irukandji, Today, 09:34 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by RubenCazorla, Today, 09:07 AM
    1 response
    5 views
    0 likes
    Last Post RubenCazorla  
    Started by TraderBCL, Today, 04:38 AM
    3 responses
    25 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X