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

Make Chart Background Flash

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

    Make Chart Background Flash

    I would like to make the chart background flash whenever a Tick-bar closes, in order to draw my attention to it. Is this possible?

    #2
    Hello reach4thelasers,

    Yes, this is possible.

    One way you can do this would be to use a drawing object that fills the region of the chart and apply it trigger it to change on the close of bar of an additional data series. Since tick bars happen very often, to make the screen 'flash' you will want to change the drawing object to be transparent in within OnRender() when that bar is not closed.

    The tools to create this in an indicator would require:
    1. Additional Data Series
    2. Drawing Object
    3. OnRender() override
    4. Variable to control how long the flash should last
    5. Counter to control flashes for each new bar/tick


    For example, with a 1 tick data series added, you could check for the close of the additional data series to see if a new tick has been made.

    Within OnRender(), you could check if the counted tick is greater than the last counted tick. If it is, and the drawing object was not already created for this tick, then you can change the region drawing object to a visible color, if the conditions are not true you can set the region drawing object to be an invisible color.

    You may also wish to use the properties within ChartControl to draw the region over the entire visible range of the chart.

    Documentation on the tools required to create this indicator can be found here:

    Draw.RegionHighlightX() - https://ninjatrader.com/support/help...highlightx.htm
    OnRender() - https://ninjatrader.com/support/help...e_onrender.htm
    MultiTime Frame and Instruments - https://ninjatrader.com/support/help...nstruments.htm
    ChartControl - https://ninjatrader.com/support/help...artcontrol.htm

    Please let me know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by BarzTrading, Today, 07:25 AM
    0 responses
    1 view
    0 likes
    Last Post BarzTrading  
    Started by i019945nj, 12-14-2023, 06:41 AM
    5 responses
    64 views
    0 likes
    Last Post i019945nj  
    Started by ruudawakening, Today, 12:58 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by thread, Yesterday, 11:58 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by stafe, Yesterday, 08:34 PM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X