• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Instrument?

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

    Custom Instrument?

    Hi

    I'd like some general guidance on how to create a custom/synthetic instrument that I can plot on a candlestick chart as though it was a valid instrument from a data provider.

    The instrument would be an arithmetic combination of several other instruments, like an index.
    It does not need to update with incoming ticks, but ideally would update on a timer, e.g. every minute.

    My initial thoughts are...
    Create the instrument in the Instrument Manager.
    Create an indicator or strategy to periodically write the calculated daily and minute 'price' data to day and minute folders in the db folder.
    Open a chart with the custom instrument.
    Apply an indicator or strategy that reloads the data on a timer (possibly the same indicator or strategy that writes the data).

    Will this work?
    Are there better ways of doing it?

    Any suggestions gratefully received.

    Regards
    Tony

    #2
    Hi Tony,

    This is possible.

    A great example of this is the HeikenAshi indicator which overlays its own bars on top of the chart.

    http://ninjatrader.com/support/forum...php?linkid=730
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea

      I've tried using the approach used for the Heiken Ashi indicator, but the resulting indicator must load the data series for 8 instruments for each instance, so it's become cumbersome and not very robust.

      I think a better approach is to create a custom instrument, with its own calculated data, so there is only one data series to be loaded.

      I've tried this:
      Create an instrument in the instrument manager (AUDIDXTEST). It made me choose an exchange (I chose Default) and a Symbol Map (I typed "AUD Test" against Simulator).
      To get some data to use, I exported AUDCAD minute.last data.
      Rename the AUDCAD minute data as AUDIDXTEST.last.txt.
      Import the data.
      I was able to load the data to a chart, but it was corrupt. See attached image.

      Is it possible to create a custom chart like this?
      Should the process I used work? If not what am I doing wrong?
      Is there a better way?

      Cheers
      Tony
      Attached Files

      Comment


        #4
        Hi Tony,

        How is the data corrupt?

        It appears to be displaying on the chart.

        Are the bars on the chart not matching what is in the file?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea

          In the attachment to my previous post, two 60 min charts are shown - AUDCAD and my custom AUDIDXTEST. AUDIDXTEST was created by exporting the AUDCAD data and importing it as AUDIDXTEST. I think the two charts should be identical, but clearly they are not.

          The text files AUDIDXTEST.Last.txt has continuous 1 min data, unlike the chart.

          Should the process I described work as I expect? If so, what am I missing?

          Cheers
          Tony
          Last edited by Jellybean; 03-27-2017, 01:04 PM.

          Comment


            #6
            Hi Tony,

            The issue is the number of decimal places.

            There does seem to be unexpected behavior when importing a file as when I tested this, the exported file has the correct number of decimals, however, after imported is showing the wrong number of decimals in the historical data manager.

            I will do some further testing with this and then report the behavior to our development.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hi Chelsea

              Your comment about the decimal places suggested I may have the tick size wrong, but no.

              I've attached the instrument setting for the normal AUDCAD and my custom AUDIDXTEST for your reference.

              Cheers
              Tony
              Attached Files

              Comment


                #8
                Tony,

                Our development has let me know that Forex symbols must have 6 characters.

                By having 7, the data automatically imports as a stock.

                Should you absolutely want to do this, use 6 characters when creating the new instrument.

                Like ADCADB.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks, Chelsea.

                  I can see now that when I imported the data, a new stock instrument was created.

                  However, I tried the same process with only a 6-character name (AUDAJS) for the new instrument and data file, as you suggested, but I still get the same result.

                  I can export AUDCAD data and import it back to AUDCAD fine, but renaming the experted file and importing to AUDAJS makes it a stock. There must something else that causes the data to be imported as a stock. Any ideas?

                  Cheers
                  Tony

                  Comment


                    #10
                    Hi Tony,

                    I've tested and confirmed and sent this back to development.

                    I appreciate your patience.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by Jellybean View Post
                      Thanks, Chelsea.

                      I can see now that when I imported the data, a new stock instrument was created.

                      However, I tried the same process with only a 6-character name (AUDAJS) for the new instrument and data file, as you suggested, but I still get the same result.

                      I can export AUDCAD data and import it back to AUDCAD fine, but renaming the experted file and importing to AUDAJS makes it a stock. There must something else that causes the data to be imported as a stock. Any ideas?

                      Cheers
                      Tony
                      Hello Jellybean,

                      Thank you for your patience.

                      Development has got back to us on this matter. The new instrument data is imported as a stock because it will only ever import data as a forex instrument if the the symbol is valid to the format of a forex symbol.

                      For example, EURUSD contains six characters and each name is a valid currency. EURUSDA as an example would be invalid based on the length of the name and the invalid currency.

                      Please let me know if you have any questions.
                      Patrick H.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Patrick

                        Thanks. I'll just multiply my values by 1000 to keep the precision and treat it as a stock or index.

                        Regards
                        Tony

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by StevenNelson, Today, 05:49 AM
                        1 response
                        4 views
                        0 likes
                        Last Post NinjaTrader_PatrickG  
                        Started by fx.practic, Today, 01:41 AM
                        0 responses
                        11 views
                        0 likes
                        Last Post fx.practic  
                        Started by wolfcuring, Today, 01:29 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post wolfcuring  
                        Started by BrandonT1292, 06-17-2019, 03:03 PM
                        2 responses
                        30 views
                        0 likes
                        Last Post thinarthrill  
                        Started by cbentrikin, Yesterday, 07:46 PM
                        1 response
                        11 views
                        0 likes
                        Last Post NinjaTrader_Marco  
                        Working...
                        X