Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Symbol Watermark

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

    Chart Symbol Watermark

    I love the watermark on tradestation charts that allows me to see at a glance what instrument and timeframe I'm looking at. Is there a way to add this to ninjatrader?

    example:


    #2
    Hello,

    Thank you for contacting us.

    This is not a feature of NinjaTrader by default however this effect could be added to a chart with custom programming. If you are not a programmer yourself NinjaTrader Ecosystem is partnered with a number of NinjaScript consultants who could create this at your direction. For more information regarding NinjaScript consultants please contact me at Info [AT] NinjaTraderEcosystem [DOT] com.
    KyleNinjaTrader Customer Service

    Comment


      #3
      Originally posted by reach4thelasers View Post
      I love the watermark on tradestation charts that allows me to see at a glance what instrument and timeframe I'm looking at. Is there a way to add this to ninjatrader?

      example:

      https://www.tradestation.com/trading...Watermark.ashx
      Look up DrawTextFixed(). Use a light color and locate it at "center".

      Comment


        #4
        Here's my attempt at using DrawTextFixed for the watermark. Unfortunately this is currently drawn in front on the chart - which is obviously too obtrusive. My code is here, I have left comments in with the various properties I have tried to set to force the watermark to appear behind the bars, but I just can't seem to get it. Any ideas?

        (attached a pic also)


        [Description("Chart Symbol Watermark")]
        public class Watermark : Indicator
        {
        #region Variables
        // Wizard generated variables
        private string myInput0 = @""; // Default setting for MyInput0
        // User defined variables (add any user defined variables below)
        #endregion


        protected override void Initialize()
        {
        ZOrder = -1;
        this.Panel = 0;
        this.Overlay = true;
        this.ZOrder = -99999999;
        }

        protected override void OnStartUp()
        {
        var instrumentName = this.Instrument.FullName;
        var chartPeriod = this.BarsPeriod;

        Font instrumentFont = new Font("Helvetica", 72f, FontStyle.Regular);
        Font periodFont = new Font("Helvetica", 32f, FontStyle.Regular);
        ITextFixed obj1 = DrawTextFixed("Instrument", instrumentName + "\n", TextPosition.Center, Color.LightGray, instrumentFont, Color.Transparent, Color.Transparent, 0);
        ITextFixed obj2 = DrawTextFixed("Period", "\n\n"+ chartPeriod.ToString(), TextPosition.Center, Color.LightGray, periodFont, Color.Transparent, Color.Transparent, 0);

        // obj1.SeparateZOrder = true;
        // obj1.AutoScale = true;
        // obj2.SeparateZOrder = true;
        // obj1.Locked = false;
        // obj2.AutoScale = true;
        // obj2.Locked = false;
        // this.ZOrder = -9999999;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {

        }
        Attached Files

        Comment


          #5
          If anyone knows a way of making DrawTextFixed appear in the background please let me know - until then here is what I have settled on.
          Attached Files

          Comment


            #6
            Originally posted by reach4thelasers View Post
            Here's my attempt at using DrawTextFixed for the watermark. Unfortunately this is currently drawn in front on the chart - which is obviously too obtrusive. My code is here, I have left comments in with the various properties I have tried to set to force the watermark to appear behind the bars, but I just can't seem to get it. Any ideas?

            (attached a pic also)
            The ZOrder specification is not really supported, and does seem to be kind of dodgy. You may have to manually send the text to the back.

            ref: http://ninjatrader.com/support/helpG...ng_a_chart.htm. It is the 7th video on the page.

            You could also try setting the SeparateZOrder property on the IText to true.

            Comment


              #7
              Originally posted by reach4thelasers View Post
              If anyone knows a way of making DrawTextFixed appear in the background please let me know - until then here is what I have settled on.
              Hello..I'm also looking to get a watermark of the stock symbol in the background of my charts. I'm using NT8 with IB and I tried to import reach4thelasers Watermark.cs into Documents\NinjaTrader 8\bin\Custom\Indicators but when I go Tools>Import>NinjaScript Add-on, it says the NinjaScript file has programing errors.

              Also I tried adding the same .cs file to a zip file with the proper folder structure and when I import it, I don't receive any errors. However, the indicator cannot be found in the Indicator list.
              I'm a complete newbie to this stuff. Thanks.

              Comment


                #8
                Hello,

                I am unsure of a good way to use the DrawTextFixed or any DrawingObject in general for 7 in this case as mentioned the ZOrder is kind of strange in NT7. This is one of the items addressed in the NT8 update.

                For this, I would likely suggest to use the Plot override instead and control the Indicators ZOrder. This would assume that the indicator doesn't specifically need to plot over the bars. This also seemed to work when reloading the workspace, I would have to say that basing logic on the ZOrder in NT7 is flaky at best so there may be cases where this does not work as I had expected.

                This appears behind the bars initially in my tests and is also affected by changing the charts ZOrder as expected. I would likely suggest opting for using the Plot Override to draw the water mark as close as possible to the X Axis or in the gap between the scale and the bar. Controlling the Min/Max autoscale may be a better approach than relying on controlling ZOrder in nt7.

                For NT8, please ensure to use the NT8 sub forums for questions. You would likely need to post what you are trying in the NT8 section as the syntax between platforms is different.

                I look forward to being of further assistance.
                Attached Files
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by adeelshahzad, Today, 03:54 AM
                4 responses
                25 views
                0 likes
                Last Post adeelshahzad  
                Started by merzo, 06-25-2023, 02:19 AM
                10 responses
                823 views
                1 like
                Last Post NinjaTrader_ChristopherJ  
                Started by frankthearm, Today, 09:08 AM
                5 responses
                17 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                43 views
                0 likes
                Last Post jeronymite  
                Started by yertle, Today, 08:38 AM
                5 responses
                16 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X