• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Graphics.DrawString to Print Volume at Price

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

    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)

    #2
    Searching on drawstring I found this one:

    http://www.ninjatrader.com/support/f...ght=DrawString

    Comment


      #3
      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.

      Comment


        #4
        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.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sdauteuil, Today, 11:02 PM
        1 response
        2 views
        0 likes
        Last Post sdauteuil  
        Started by Jschmelz, Today, 04:45 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by sisenberg, Today, 08:06 PM
        1 response
        8 views
        0 likes
        Last Post sisenberg  
        Started by priceisking, Today, 07:44 PM
        0 responses
        5 views
        0 likes
        Last Post priceisking  
        Started by saltminer, Today, 06:06 PM
        0 responses
        5 views
        0 likes
        Last Post saltminer  
        Working...
        X