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 yertle, Yesterday, 08:38 AM
    7 responses
    28 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by bmartz, 03-12-2024, 06:12 AM
    2 responses
    21 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by funk10101, Today, 12:02 AM
    0 responses
    6 views
    0 likes
    Last Post funk10101  
    Started by gravdigaz6, Yesterday, 11:40 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by MarianApalaghiei, Yesterday, 10:49 PM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X