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

Drawing horizontal lines on multiple charts

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

    Drawing horizontal lines on multiple charts

    Hi there
    I presume this is the right place to make such a post and that if not someone will let me know thank you for that.
    My question is, is it feasible to do the following programatically.
    Create a hoz line on a given chart (call it the source chart) and give it a unique tag
    Copy/past/recreate/attach that line on all charts for the same pair with a timeframe the same or smaller TF than the source chart.
    For example I have a workspace with 9 tabs.
    Each tab have a chart of a forex pair say GBPUSD with a progressively smaller TZ starting at 1Month then 1W/1D/4H/1H/30m/15/5m/1m
    Let the 1H chart be the source chart.
    I create a hoz line on this 1H chart.
    I then the script to recreate/attach that hoz line on the 4 charts with smaller TF (30m/15m/5m/1m)

    There is a feature built in where a hoz line can be set to be drawn on all charts
    (Drawing Objects > Hoz Line Properties > General > Attach to > GBPUSD (All charts)

    So such a script would be a variation on this.
    I want a line to be attached to all charts with smaller TF than the original.
    Hope this makes sense.

    Can this be done within the NT8 development environment?

    Thank you for any replies

    #2
    Hello slouw,

    Thank you for your note.

    The ability to filter which charts will display a global drawing object is not supported but may be possible.

    A possible solution may be to create an indicator which will write to a file the price of a horizontal line that is drawn. Then in another indicator you could read this file, and if the file contains a horizontal line to draw and the charts current interval is greater than x value, draw a horizontal line on the at chart.

    I suggest seeing the following,


    And the following sample on reading from a file,


    To pull a charts BarsPeriod value you could see,


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by elirion, Today, 09:32 PM
    0 responses
    2 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by cre8able, Today, 09:15 PM
    1 response
    5 views
    0 likes
    Last Post bltdavid  
    Started by cummish, Today, 08:43 PM
    0 responses
    10 views
    0 likes
    Last Post cummish
    by cummish
     
    Started by Option Whisperer, Today, 07:58 PM
    4 responses
    21 views
    0 likes
    Last Post Option Whisperer  
    Started by ETFVoyageur, 05-07-2024, 07:05 PM
    13 responses
    87 views
    0 likes
    Last Post ETFVoyageur  
    Working...
    X