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 smartromain, Today, 10:50 PM
    0 responses
    3 views
    0 likes
    Last Post smartromain  
    Started by popecapllc, 08-09-2023, 07:42 PM
    10 responses
    1,366 views
    0 likes
    Last Post BartMan
    by BartMan
     
    Started by jbays87, Today, 09:46 PM
    0 responses
    6 views
    0 likes
    Last Post jbays87
    by jbays87
     
    Started by ETFVoyageur, 04-30-2024, 02:04 PM
    11 responses
    102 views
    0 likes
    Last Post ETFVoyageur  
    Started by bubblegum, 03-18-2024, 10:41 AM
    3 responses
    48 views
    0 likes
    Last Post vjsworld  
    Working...
    X