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

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 Sparkyboy, Today, 10:57 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by swestendorf, Today, 11:14 AM
        1 response
        3 views
        0 likes
        Last Post swestendorf  
        Started by TheMarlin801, 10-13-2020, 01:40 AM
        21 responses
        3,917 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by timmbbo, 07-05-2023, 10:21 PM
        3 responses
        156 views
        0 likes
        Last Post grayfrog  
        Started by Lumbeezl, 01-11-2022, 06:50 PM
        30 responses
        812 views
        1 like
        Last Post grayfrog  
        Working...
        X