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 f.saeidi, Today, 05:56 AM
      1 response
      3 views
      0 likes
      Last Post Jltarrau  
      Started by Jltarrau, Today, 05:57 AM
      0 responses
      4 views
      0 likes
      Last Post Jltarrau  
      Started by Stanfillirenfro, Yesterday, 09:19 AM
      7 responses
      51 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by TraderCro, 04-12-2024, 11:36 AM
      4 responses
      70 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Mindset, Yesterday, 02:04 AM
      1 response
      15 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X