Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to set PlotBrushes in hosted indicator?

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

    Is it possible to set PlotBrushes in hosted indicator?

    Hello.
    I made a strategy. And I want to set PlotBrushes propertie of hosted indicator:
    PHP Code:
    
    MACD Macd = MACD( 10, 20, 30);
    
    AddChartIndicator( Macd );
    
    
    OnBarUpdate{}
    {
       Macd.PlotBrushes[0][0] = Brushes.Green;
    
       TriggerCustomEvent( (o) => {Macd.PlotBrushes[0][0] = Brushes.Green;}, null );
    
       Macd.TriggerCustomEvent( (o) => {Macd.PlotBrushes[0][0] = Brushes.Green;}, null );
    } 
    
    Any of these ways not work.
    Is it possible?
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello,

    I show that this syntax would work, is there a need for TriggerCustomEvent in this case?

    Also, have you correctly stored the instance of the macd as a variable?

    Code:
    private MACD Macd;
    protected override void OnStateChange()
    {
    	if (State == State.DataLoaded)
        {
    		Macd = MACD( 10, 20, 30); 
            AddChartIndicator( Macd ); 
    	
        }
    }
    
    protected override void OnBarUpdate()
    {
    	Macd.PlotBrushes[0][0] = Brushes.Pink;
    }

    I look forward to being of further assistance.

    Comment


      #3
      I am sorry, my fault.
      Just, return triggered before color setting.

      Thank You, and sorry again.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      132 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X