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

BackBrush

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

    BackBrush

    Hello

    Say I load different data series in my strategy. Then, load the strategy on the primary data series in my chart. I also, load all the secondary appropriate data series on the chart as well. How can I BackBrush of the secondary data series and their chart regardless of what is happening on the primary data series.

    [CODE] else if (State == State.Configure)
    {

    AddDataSeries("AUDUSD", new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, "Forex");//9
    AddDataSeries("NZDUSD", new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, "Forex");//10
    }

    i'm setting a bool to true after XYZ happens. AUDUSD and NZDUSD bools are independent. I'd like to color the appropriate backbrush when the bool is set to true. Is that possible?

    Code:
    				if(EnvironmentIsLong_CAD==true)
    					
    				{
    		//			BackBrush = Brushes.Aqua;						
    				}
    					
    				if(EnvironmentIsShort_CAD==true)
    				{
    		//			BackBrush  = Brushes.Coral;		
    				}

    I'm able to use the above but that is only for the primary data series. is it possible to color a backbrush on secondary data series independently? IsGlobal is not an option for me b/c each bool is independent and I only want to appropriate chart to have it's own backbrush.

    I did look under this and didnt find an answer:


    #2
    Originally posted by staycool3_a View Post
    Hello

    Say I load different data series in my strategy. Then, load the strategy on the primary data series in my chart. I also, load all the secondary appropriate data series on the chart as well. How can I BackBrush of the secondary data series and their chart regardless of what is happening on the primary data series.

    [CODE] else if (State == State.Configure)
    {

    AddDataSeries("AUDUSD", new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, "Forex");//9
    AddDataSeries("NZDUSD", new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, "Forex");//10
    }

    i'm setting a bool to true after XYZ happens. AUDUSD and NZDUSD bools are independent. I'd like to color the appropriate backbrush when the bool is set to true. Is that possible?

    Code:
    				if(EnvironmentIsLong_CAD==true)
    					
    				{
    		//			BackBrush = Brushes.Aqua;						
    				}
    					
    				if(EnvironmentIsShort_CAD==true)
    				{
    		//			BackBrush  = Brushes.Coral;		
    				}

    I'm able to use the above but that is only for the primary data series. is it possible to color a backbrush on secondary data series independently? IsGlobal is not an option for me b/c each bool is independent and I only want to appropriate chart to have it's own backbrush.

    I did look under this and didnt find an answer:

    https://ninjatrader.com/support/help...s/?drawing.htm
    I just ended up creating an indicator so my problem is solved but would be nice to know the answer.

    Thanks

    Comment


      #3
      Hello staycool3_a,

      Thank you for the question.

      In this situation, the extra series you manually add to the chart are not associated with the strategy so you have used the correct solution to add an indicator to those series to have them be "individual".

      Currently, the only way to have extra panels that are associated with the strategy would be IsOverlay = false indicators the strategy adds but those do not contain a bar series to BackBrush.

      I could put in a feature request for an AddDataSeries overload that specifies to append a visual Bar series to the chart, would this be an acceptable solution to your question?

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AaronKoRn, Today, 09:49 PM
      0 responses
      1 view
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      6 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      8 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,975 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X