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

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:

    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 Stanfillirenfro, Yesterday, 09:19 AM
        7 responses
        51 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by TraderCro, 04-12-2024, 11:36 AM
        4 responses
        69 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Mindset, Yesterday, 02:04 AM
        1 response
        15 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by agclub, 04-21-2024, 08:57 PM
        4 responses
        18 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Irukandji, Today, 04:58 AM
        0 responses
        6 views
        0 likes
        Last Post Irukandji  
        Working...
        X