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
Using Graphics.DrawString to Print Volume at Price
Collapse
X
-
Hello MercuryScripter,
Thank you for your note.
While using the graphics library is not supported by NinjaTrader, one tip would be to create an indicator to do this drawing instead of doing the drawing from the strategy.
From the strategy, call the indicator and it will use the same information available to the strategy to do calculations and make drawings.
-
Thanks sledge. All of the reference I have found thus far refer to overwriting the Plot method inside an indicator. However, I am trying to accomplish the custom print inside of a strategy. Unfortunately, I have not been able to figure it out just yet :-(
I'm still not sure how to plug in the X & Y values ... X would be a fixed location with a offset from the right margin and Y would be a price level.
Leave a comment:
-
Using Graphics.DrawString to Print Volume at Price
Hello,
NT7's DrawText method does not offer the ability to draw text in a fixed location using an offset from the right margin.
Studying the CustomPlotSample indicator I see that custom location prints on the chart may be performed via the Graphics.DrawString method.
I am trying to do this directly from my strategy. I'm calculating volume at price but would like to print it via a Right margin offset.
Would sincerely appreciate anyone's help me with this?
This is what I've got so far, but not sure how to determine the X & Y values:
I've defined the Graphics graphics object and the Fontname & VolAtPriceColor variables earlier in the code.
Code:graphics.DrawString(CurrBidTradedVol.ToString(),Fontname,VolAtPriceColor,X, Y)
Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AttiM, 02-14-2024, 05:20 PM
|
12 responses
212 views
0 likes
|
Last Post
by DrakeiJosh
Today, 11:17 AM
|
||
Started by cre8able, 02-11-2023, 05:43 PM
|
3 responses
237 views
0 likes
|
Last Post
by rhubear
Today, 10:46 AM
|
||
Started by frslvr, 04-11-2024, 07:26 AM
|
8 responses
115 views
1 like
|
Last Post Today, 10:30 AM | ||
Started by stafe, 04-15-2024, 08:34 PM
|
10 responses
47 views
0 likes
|
Last Post
by stafe
Today, 10:29 AM
|
||
Started by rocketman7, Today, 09:41 AM
|
3 responses
11 views
0 likes
|
Last Post Today, 10:07 AM |
Leave a comment: