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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      55 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      35 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      19 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      8 views
      0 likes
      Last Post cre8able  
      Working...
      X