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

Rectangle with 2 different colors

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

    Rectangle with 2 different colors

    Do you know if there is an indicator or a way to draw a rectangle with 2 different background colors? Thank you very much.

    #2
    Hello punkiy2111,

    Thanks for your post.

    If you are looking for an existing indicator that accomplishes this then you could browse the Ecosystem User App Share for a possible solution.

    Ecosystem User App Share:

    Otherwise, you could use SharpDX in OnRender() to draw a rectangle on the chart with a gradient Brush color such as a red to blue gradient. Note that you could convert a LinearGradientBrush to a SharpDX brush using ToDxBrush().

    See the attached example script demonstrating how this could be done.

    And, see the help guide documentation below for more information.

    OnRender():https://ninjatrader.com/support/help...8/onrender.htm
    Using SharpDX to custom render objects on a chart: https://ninjatrader.com/support/help..._rendering.htm

    Let me know if I may further assist.​
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Waxavi, Today, 02:10 AM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by alifarahani, Today, 09:40 AM
    5 responses
    23 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X