Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rectangle Zones from a Text File

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

    Rectangle Zones from a Text File

    Hello,

    I am fairly new and looking for some help on developing and indicator.

    I am wondering if anyone can give me a few pointers on how to develop an indicator that would plot rectangles and horizontal lines from a text file. So basically I have all my levels that I would like to plot in a text file. I would like the indicator to grab that data and plot the levels as a rectangle zone (if i have 2 given levels, and as a horizontal line (if I have 1 give level).

    Thanks for helping a Rookie! All help is appriciated!

    #2
    Hello Corbett,

    To read from a text file you can use StreamReader.

    Below is a link to an example of using StreamReader to pull text from a text file.


    Once you have the text parsed to an array or stored in some variable type, you can use DrawRectangle() to draw the rectangle.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Where is this path actually located so that levels may be entered?

      // This sets the path in which the text file will be created.
      private string path = Cbi.Core.UserDataDir.ToString() + "MyTestFile.txt";

      Comment


        #4
        Why not use Print and find out?

        Add this code to your OnStartUp():

        Code:
        Print("path = " + path);

        Comment


          #5
          What format is used for the date OHLC in text file?

          Comment


            #6
            Hello brucelevy,

            The path of the file is in the Documents\NinjaTrader 7\ folder.
            I also suggest that you print the path variable to see the full path in the Output window.

            The format used for this text file read by this indicator is the format used by the StreamWriter example.

            20161016 2123 2123.25 2123 2123
            YYYYMMDD Open High Low Close

            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            546 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X