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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X