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 Aviram Y, Today, 05:29 AM
      0 responses
      3 views
      0 likes
      Last Post Aviram Y  
      Started by quantismo, 04-17-2024, 05:13 PM
      3 responses
      27 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by ScottWalsh, 04-16-2024, 04:29 PM
      7 responses
      34 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cls71, Today, 04:45 AM
      0 responses
      6 views
      0 likes
      Last Post cls71
      by cls71
       
      Started by mjairg, 07-20-2023, 11:57 PM
      3 responses
      218 views
      1 like
      Last Post PaulMohn  
      Working...
      X