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

TextFixed on the back of the chart?

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

    TextFixed on the back of the chart?

    Can I somehow put TextFixed object to the back of the chart?


    SetZOrder(-99999999);
    this.ZOrder = -99999999;

    doesn't help(

    #2
    Hello elixirtrip,

    Thanks for writing in.

    This would be the expected behavior since the TextFixed DrawingTool uses DrawingToolZOrder.AlwaysDrawnLast.

    You could change this value directly from OnRender() in an indicator or a strategy by changing the ZOrder property for the ChartObject. This is different from the ZOrder property set for strategies and indicators. For example:

    Code:
    private TextFixed myTextFixed;
    private TextFixed myTextFixed2;
    		
    protected override void OnBarUpdate()
    {
    	myTextFixed = Draw.TextFixed(this, "tag1", "                         Text1", TextPosition.Center);
    	myTextFixed2 = Draw.TextFixed(this, "tag2", "Text2                         ", TextPosition.Center);
    }
    			
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
    	base.OnRender(chartControl, chartScale);
    	
    	myTextFixed.ZOrder = -1;
    	myTextFixed2.ZOrder = int.MaxValue;
    }
    I'll include a link to the ZOrder index for indicators and strategies documentation page as it also explains the ZOrder range for Chart Bars, NinjaScript Objects, Global Draw Objects, and Draw Objects.

    ZOrder - https://ninjatrader.com/support/help...art_zorder.htm

    Please let me know if I can be of further assistance.
    Last edited by NinjaTrader_Jim; 12-15-2017, 09:57 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thank you vary match for ur help!

      Its let me go to the right direction!

      Code:
      myTextFixed.ZOrderType = DrawingToolZOrder.AlwaysDrawnFirst;
      Did the trick for me!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by chbruno, Today, 04:10 PM
      0 responses
      3 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      6 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by frslvr, 04-11-2024, 07:26 AM
      9 responses
      127 views
      1 like
      Last Post caryc123  
      Working...
      X