Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator that only draws lines read from a file

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

    Indicator that only draws lines read from a file

    Hi,

    I'm looking to create an indicator that will read levels from a .csv file (support/resistance, price, a ranking 1 to 5), and plot them on the chart. Basically this is a one time action once the "apply" or "ok" button is pressed. It is merely a convenience for plotting lines (like F6 Horizontal Lines) at the prices, with preset colors, thicknesses, and types based on the data from the .csv file.

    I have much of the logic done, but am stumped for where I would call the file read and plot methods from for this one time action. Like which Calculate.??

    Thanks

    #2
    Hello GrumpyDude,

    The reading code should go in OnStateChange -> DataLoaded, that is called once the script is setup and is only called once.

    To draw a single time you could do that by waiting for the last bar in processing and then looping over your data. That can be done from OnBarUpdate using a condition like this:

    Code:
    if(CurrentBar == Count - 2)
    {
    
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    213 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    122 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    145 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    228 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    189 views
    0 likes
    Last Post CarlTrading  
    Working...
    X