Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Display numbers on screen

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

    Display numbers on screen

    Hi,

    How can I display numbers on the screen for the indicators?
    I have 4 plots in an indicator panel (panel 2 for example) and want to plot only one of them as a line but other three of them to display as numbers for the last bar instead of lines. I could not do that with the DrawText().

    Any help will be greatly appreciated.

    #2
    Hello Dowhk,

    Thank you for your post.

    For a non-programming solution, consider setting the lines to transparent and setting Price Markers to true.

    Otherwise using DrawText() is one way to do it. Let us know what you have so far.

    Below are some snippets for checking if the bar is the last bar. Different code is used depending on whether CalculateOnBarClose is set to true or false.

    When CalculateOnBarClose == false, then OnBarUpdate() is being called for the last bar on the chart:


    Code:
    if (CurrentBar == Bars.Count - 1)
    // Is last bar on chart

    When CalculateOnBarClose == true, then OnBarUpdate() is being called for the last closed bar on the chart, not the in-process bar:


    Code:
    if (CurrentBar== Bars.Count -2)
    // Is last bar on chart
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan, Thank you very much.

      I understand the LastBarOnChart.
      I am very new to NT and I don't know how to convert numbers to strings and display them on screen. I could not use the DrawText().

      Here is the chart to help my explanation:
      There are 4 indicator lines in the panel 2. I want to convert the magenta, cyan, and yellow lines to numbers and disply them on the upper right corner of the panel 2. I want to keep the green line as is but display numbers for others.

      Please, give me right directions.
      Attached Files
      Last edited by dowhk; 03-01-2010, 02:53 PM.

      Comment


        #4
        Hello Dowhk,

        You can use ToString() to convert a double value into a string.

        myDouble.ToString()

        The reference sample below provides more help on working with String objects:

        Manipulating String Objects
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Renejm, Today, 06:17 AM
        0 responses
        3 views
        0 likes
        Last Post Renejm
        by Renejm
         
        Started by kazisl, Yesterday, 06:41 PM
        2 responses
        9 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by impactX, 05-04-2021, 01:07 AM
        1 response
        6 views
        0 likes
        Last Post Lancer
        by Lancer
         
        Started by op1031, Yesterday, 05:51 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by aaadetos, 05-04-2021, 09:28 AM
        2 responses
        10 views
        0 likes
        Last Post aaadetos  
        Working...
        X