Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create New Instrument

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

    Create New Instrument

    Hello
    I am looking for a way to create a new instrument that can then be plotted on a Point and Figure chart. I see Indicator and Strategy Classes but I did not find an Instrument Class. I have not found any similar requests in the forum.

    I do think I can add a new data series to an indicator but I do not see a way to plot it as a PnF chart or how I would get it into an Instrument list to plot it as say I would the ^SP500.

    What I am trying to do is to create and plot the instrument that is the ratio of a stock price to the SnP500 or SPEWI Index or a stock to the industry sector price ratio. I am reading Tom Dorsey's Point and Figure Charting want to play with some of Tom Dorsey's relative strength plots.

    Can you get me started? I do have Visual Studio 2005 in I need that for the programming.

    Thanks

    #2
    Hello blach00,

    Thanks for your post.

    To accomplish your goals would require 4 steps:

    1) Create an indicator that determines the ratio you are looking for and output that information in a format that can then be loaded as historical bar data. Here is a reference to creating a text file output from an indicator: http://ninjatrader.com/support/forum...ead.php?t=3475 Note that the file format needed is identified by the link in step 3.

    2) Modify an existing unused instrument in the instrument editor to reflect the new instrument characteristics. Here is a link to the helpguide in editing instruments: http://ninjatrader.com/support/helpG...nstruments.htm

    3) Import the created historical data as the new instrument. Here is a link to the helpguide section on data import (note the format needed): http://ninjatrader.com/support/helpG...?importing.htm

    4) Plot the new instrument with the historical data in a PNF chart.

    Comment


      #3
      Thank-you

      Thanks much
      It looks doable. I will start with a simple implementation and flesh it out after I get the key components working.

      Comment


        #4
        Error importing

        I have the calculation and writing to the file working. When I tried to import the file using the Historical Data manager, I received an error:
        " ORCS: Import filed separator could not be identified. "

        I was using the default "write line" the ample code with a space as separator.

        I change the separator to a comma and received the following error:
        "ORCS: Unexpected number of fields in line 1. Should 6 or 3."

        The sample code has 5 fields: Data, Open, High, Low, Close

        sw.WriteLine(ToDay(Time[0]) + "," + dsOpen[0] + "," + dsHigh[0] + "," + dsLow[0] + "," + dsClose[0]);

        I don't know what I am missing anything as I use the sample code format.


        Thanks for your continued help.

        Comment


          #5
          Error importing , continued

          Here is the data line from the file I am trying to import, if this helps.

          20151023,21.71,22.27,21.67,22.2


          Thanks

          Comment


            #6
            Hello blach00,

            Thanks for your post.

            The sample writer was an example of outputting data for use outside of NinjaTrader. In this case you are creating new data that you then want to read into NinjaTrader and this means that you have to create the output in a format that is compatible with the input requirements of the Historical data manager.

            From your post I am guessing you are creating minute bars. From the helpguide section on importing data:

            Minute Bars Format
            Each bar must be on its own line and fields must be separated by semicolon ";". Only 1 minute bars can be imported.

            The format is:
            yyyyMMdd HHmmss;open price;high price;low price;close price;volume

            Sample data:
            20061023 004400;1377.25;1377.25;1377.25;1377.25;86

            So I think you are missing the time component as well as the Volume and need to use the ";" as the separator.. I know you are creating new data so you can just set the volume to be a value of 1.

            Here is a link to the import section: http://ninjatrader.com/support/helpG...?importing.htm

            Comment


              #7
              Daily Bars (?)

              Thanks for the reply,

              Actually, I wanted to create Daily bars from and to Kinetick Free EOD. I am a NinjaTrader Brokerage customer for futures but "Continuum' does not provide stock quotes so I do not have minute or tick data for stocks as far as I know.

              I did modify the code and the import as subsequent chart from the imported data appeared to work ( after I corrected some Closing values > High values, etc. post the calculations.)

              Originally posted by NinjaTrader_Paul View Post
              Minute Bars Format
              Each bar must be on its own line and fields must be separated by semicolon ";". Only 1 minute bars can be imported.
              Were you saying "If Minute Bars, only 1 minute may be imported?" I think I mis-interrupted that statement initially.

              I did receive an error about cashe but ignored it and was able to create the chart. (I attached the chart for the benefit of others).


              These multiple steps were going to be cumbersome for numerous charts and I was planning to attempt to write a C# program outside of NT to extract the required data, manipulate it, and write to NT readable files for all the stocks I was following. However, I could not open a NT data file to observe the formatting required.

              Is there a way I can write to a NT readable file for daily bars outside of the Historical data manager? If not, I think I have it and will work on streamlining the code inside NT to handle the bulk data.

              Thanks for the additional help.
              Attached Files

              Comment


                #8
                Hello blach00,

                Thanks for your reply.

                Sounds like you've done well!

                I was quoting the Helpguide which was advising that you can only import minute bars as 1 minute bars. I assume that was to answer the question of anyone wanting to import 5 minute, 3 minute, x minute bars.

                I am not aware of a method to write NT files directly.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                85 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                48 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                29 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                32 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                67 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X