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!
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
NinjaTrader
Floating image or text indicator
Collapse
X
-
Floating image or text indicator
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?Tags: None
-
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 FilesBrandon H.NinjaTrader Customer Service
-
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
-
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 Barry Milan, Yesterday, 10:35 PM
|
5 responses
16 views
0 likes
|
Last Post Today, 05:37 PM | ||
Started by DanielSanMartin, Yesterday, 02:37 PM
|
2 responses
13 views
0 likes
|
Last Post Today, 05:26 PM | ||
Started by DJ888, 04-16-2024, 06:09 PM
|
4 responses
12 views
0 likes
|
Last Post
by DJ888
Today, 04:28 PM
|
||
Started by terofs, Today, 04:18 PM
|
0 responses
11 views
0 likes
|
Last Post
by terofs
Today, 04:18 PM
|
||
Started by nandhumca, Today, 03:41 PM
|
0 responses
8 views
0 likes
|
Last Post
by nandhumca
Today, 03:41 PM
|
Comment