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

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 Kaledus, Today, 01:29 PM
            0 responses
            3 views
            0 likes
            Last Post Kaledus
            by Kaledus
             
            Started by PaulMohn, Today, 12:36 PM
            1 response
            16 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by yertle, Yesterday, 08:38 AM
            8 responses
            36 views
            0 likes
            Last Post ryjoga
            by ryjoga
             
            Started by rdtdale, Today, 01:02 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by alifarahani, Today, 09:40 AM
            3 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X