Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Remaining time on current bar

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

    Remaining time on current bar

    I found an indicator that shows the remaining current bar time but it displays lower right hand corner only.
    Is there an indicator that does the same job but displays right next to the current bar's price?
    Please look at the attached picture which I created. I would like to see the remaining time right next to the current price.

    I would appreciate any comments or help.

    Thank you.

    #2
    Hello jjanguda,

    The BarTimer indicator included with NinjaTrader can be used as an example as you develop your custom indicator.

    Draw.TextFixed() can use TextPosition.BottomLeft, TextPosition.BottomRight, TextPosition.Center, TextPosition.TopLeft, or TextPosition.TopRight.
    https://ninjatrader.com/support/help..._textfixed.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello jjanguda,

      The BarTimer indicator included with NinjaTrader can be used as an example as you develop your custom indicator.

      Draw.TextFixed() can use TextPosition.BottomLeft, TextPosition.BottomRight, TextPosition.Center, TextPosition.TopLeft, or TextPosition.TopRight.
      https://ninjatrader.com/support/help..._textfixed.htm
      Hi, ChelseaB , NinjaTrader_PatrickH :

      Currently the Bar Timer Flash coded by Patrick here: https://ninjatraderecosystem.com/use...sound-alert-2/

      renders the two values for the clock timer and the remaining time with the same brush.

      Is it possible to ask rendering the clock and the remining timer with two different optional brushes to provide better visibility for alarm purposes? If not, maybe provide a code snippet or point to some example to accomplish this.

      Many thanks.

      Comment


        #4
        Hello aligator,

        The indicator you have linked is open source. You can make any changes you would like. I recommend making a copy of the script first and changing any enum names.

        The text is custom rendered with RenderTarget.DrawTextLayout() on lines 159, 198 and 202 using the textLayout1 holding the text and textBrushDx the brush of the text.

        textLayout1 is created from the timeLeft string variable set when the timer ticks on lines 237 through 246. You can create two strings, one for the current time, one for the timeLeft, create two textLayout objects using each string, and render the two objects, with one setting the x to include the width of the first.

        textBrushDx is created from the TextBrush input on line 153. You can create two brush inputs, and use two variables for each brush when generating a SharpDX brush, and use these for each DrawTextLayout() call.


        Below are links to some examples that simplify what is needed for rendering.
        https://ninjatrader.com/support/foru...606#post789606
        https://ninjatraderecosystem.com/use...bol-watermark/
        Last edited by NinjaTrader_ChelseaB; 01-19-2021, 02:27 PM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          You may find this example, from Big Mike's futures.io site, of interest. I have not used it (nor even installed it), but looking at the documentation and the code it seems to have some useful features and informative code. Worth a look, at least.

          And with no purpose other than to promote worthwhile resources for enhancing one's ability to use NinjaTrader 8, I recommend becoming familiar with Big Mike's excellent forum and resources. He's had a great friendship with NinjaTrader for a long time, and I've found many useful things on his site. There's a lot that's free and open-source. There's also his Elite Traders group (a small once-off fee to join) that provides access to some additional very useful code. Purely FYI. I have no association with BM or the site other than as a satisfied user.

          Comment


            #6
            Originally posted by jeronymite View Post
            You may find this example, from Big Mike's futures.io site, of interest. I have not used it (nor even installed it), but looking at the documentation and the code it seems to have some useful features and informative code. Worth a look, at least.

            And with no purpose other than to promote worthwhile resources for enhancing one's ability to use NinjaTrader 8, I recommend becoming familiar with Big Mike's excellent forum and resources. He's had a great friendship with NinjaTrader for a long time, and I've found many useful things on his site. There's a lot that's free and open-source. There's also his Elite Traders group (a small once-off fee to join) that provides access to some additional very useful code. Purely FYI. I have no association with BM or the site other than as a satisfied user.
            Thanks. Elite member there for many years with so much contributions as "aligator". You just can't get the same level of NT support there as with knowledgeable people here.

            Comment


              #7
              I agree, aligator. And thanks for your contributions there and here. (Was merely pointing to a potential source of additional information for you.)

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by southpacific001, 02-26-2021, 09:25 PM
              12 responses
              56 views
              0 likes
              Last Post REI140205  
              Started by punkiy2111, Today, 05:22 PM
              0 responses
              2 views
              0 likes
              Last Post punkiy2111  
              Started by secrettrader, Today, 03:36 PM
              0 responses
              8 views
              0 likes
              Last Post secrettrader  
              Started by t3chn0, Today, 01:03 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by jleira, Today, 02:27 PM
              0 responses
              25 views
              0 likes
              Last Post jleira
              by jleira
               
              Working...
              X