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

Floating image or text indicator

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

    Floating image or text indicator

    Click image for larger version

Name:	sample image.JPG
Views:	40
Size:	89.3 KB
ID:	1175763 I would like to create a simple indicator that is essentially a floating message, with an x/y coordinate away from the closing price so that the message moves with price and never moves out of view like a static text block would do. Does something like this already exist as an indicator? ...or can someone point me in the right direction as far as creating it within NT8?

    #2
    Hello BullyWig Trader,

    Thanks for your post.

    I am not aware of an existing indicator that accomplishes your goal.

    That said, this could be accomplished using SharpDX DrawTextLayout to custom render text on a chart in a static location using x and y coordinates.

    See the help guide documentation below for detailed information about using SharpDX methods for custom rendering.

    Using SharpDX For Custom Rendering: https://ninjatrader.com/support/help...sharpdx_for_cu stom_chart_rendering.htm

    SharpDX DrawTextLayout: https://ninjatrader.com/support/help...textlayout.htm

    Also, see the attached example script, SharpDXDrawTextLayout, which demonstrates this.

    And, see the SampleCustomRender indicator which comes default with NinjaTrader.

    To view the code of a script, you would open a New > NinjaScript Editor window, open the Indicators folder, and select the script you would like to view.

    Let us know if we may assist further.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Most importantly, can the static x/y points be anchored to price so that it actually floats along with price? That's what i am looking for; not sure if that was clear or not. thanks for your response.

      Comment


        #4
        Hello BullyWig Trader,

        Thanks for your note.

        Yes, it would be possible for the text to move along with the price of the current bar.

        You would use ChartControl.GetXByBarIndex(ChartBars, CurrentBar) to get X coordinate of the last bar and use that for the 'float x' value in the previously attached script. For the 'float y' value in the previously attached script, you would use chartScale.GetYByValue(Bars.GetClose(Bars.Count - 1) to move the text along the Y-axis.

        See the help guide documentation below for more information.
        ChartControl.GetXByBarIndex() - http://ninjatrader.com/support/helpG...bybarindex.htm
        ChartScale.GetYByValue() - http://ninjatrader.com/support/helpG...etybyvalue.htm

        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by AlessioCianini12, Today, 01:38 AM
        0 responses
        27 views
        0 likes
        Last Post AlessioCianini12  
        Started by nandhumca, Yesterday, 11:54 PM
        0 responses
        29 views
        0 likes
        Last Post nandhumca  
        Started by nandhumca, Yesterday, 11:51 PM
        0 responses
        28 views
        0 likes
        Last Post nandhumca  
        Started by ezrollin, Yesterday, 11:48 PM
        2 responses
        29 views
        0 likes
        Last Post ezrollin  
        Started by jjanguda, Yesterday, 10:15 PM
        1 response
        29 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Working...
        X