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

BitfFinex - Add On

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

    BitfFinex - Add On

    Hello,
    I am going to create Add On, which enables BitFinex markets in NinjaTrader 8 using api -
    https://www.bitfinex.com/.

    I want to ask, if there is a tutorial / code snippets on how to :
    1) Create custom Insturment List
    2) Create Instruments in this List
    3) Store data to local disk and
    4) Show them in chart.

    Can anyone please guide me, where can I get further informations?
    Yours sincerely

    Pavel Kujal

    #2
    Hello kujista,

    Thanks for opening the thread.

    1) Create custom Insturment List
    2) Create Instruments in this List
    This would be done through the Instrument Manager rather than through code. The NinjaTrader database will include instrument definitions. When using these in NinjaScript, the name of the instrument (with expiry) would be used. I would suggest checking out Multi Series NinjaScripts for indicator/strategy implementations, and using the AddOn Framework example as a reference for AddOn implementations.

    3) Store data to local disk and
    4) Show them in chart.
    Storing data to disk and can be done through a StreamReader/StreamWriter. Displaying this data on a chart can be done by setting the data to the indicators Plot Series<t>.

    I'll include publicly available resources to the items discussed below.

    Working with Instruments - https://ninjatrader.com/support/help...nstruments.htm

    Multi Series NinjaScripts - https://ninjatrader.com/support/help...nstruments.htm

    AddOn Framework example (linked within) - https://ninjatrader.com/support/help...t_overview.htm

    Sample StreamReader - https://ninjatrader.com/support/foru...ead.php?t=3476

    Sample StreamWriter - https://ninjatrader.com/support/foru...ead.php?t=3475

    AddPlot() - https://ninjatrader.com/support/help...us/addplot.htm

    Please let us know if we may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello i need add Instruments into instrument list, because I get them in object array and it needs to be done in code.. Check the attachments.

      I need data to be drawn in chart as DataSeries not in Indicator. AFAIK the AddPlot() can be used only in Indicator. I need to show data in chart (without indicator). If you take a look at attachments, there is shown AVTETH instrument and it automaticaly redraws according to selected time frames (see instrument-in-chart attachment.

      Will you please help me out?
      Thanks a lot
      Pavel
      Attached Files

      Comment


        #4
        Hello kujista,

        There is not a supported way to add instruments or instrument lists through NinjaScripts. We can request this behavior, however. Were there any details you would like me to specify in a feature request other than "Allowing users to manage instruments and instrument lists through NinjaScript?"

        As for creating your own data series for the data, you could create your own External Data Feed based off of the DLL interface. Please note that supporting the DLL interface exceeds the scope of services we may provide and the documentation is only provided as-is.

        Please let me know if there is anything else I can do to provide further assistance.
        JimNinjaTrader Customer Service

        Comment


          #5
          Well, about the showing data is there a way to show data other way than using indicator? See my attachment. Well if someone already did what i asked (and he did), he did by trying fo find right way withou nt support? Dont you provide further support for developers e.g. Who have multi license or paied service?

          Comment


            #6
            Hello kujista,

            If you are trying to feed your own data into NinjaTrader to create a custom data series, creating your own External Data Feed would be the way to go.

            If this information is available from your provider, it would be recommended to add this instrument to NinjaTrader so it can be used natively. (It is currently not possible to add instruments to the NinjaTrader database through NinjaScript.)

            An indicator would let you hide the contents on a chart and draw your own bars (or anything) in place of the original data series. This would be synchronized with the primary data series of a chart and not the data series you would want to display, however.

            From what it sounds like, you will need to add the instrument you would like to the platform.

            If this does not clear things up, could you provide further detail on the AddOn you wish to develop so I could elaborate on what would or would not be possible as well as any resources I can share?
            Last edited by NinjaTrader_Jim; 12-11-2017, 05:14 PM.
            JimNinjaTrader Customer Service

            Comment


              #7
              Hi,
              External Data Feed is exactly what I want to do. I have access to market data (https://docs.bitfinex.com/v1/reference#symbols) and when I create my Instrument, I need AddOn to read data in real time (and store for historical purposes) and to show them in charts like oher NT Instruments...

              In other step, I also need to be able to send orders to provider to update orders and account.
              Is it now clear what I need?

              Thanks for response
              Pavel

              Comment


                #8
                Hello kujista,

                The External Data Feed would allow you to pull in data so it can be used natively throughout the platform. You shouldn't need to develop an AddOn to handle realtime or historical data so it can be used in a chart. Once the data enters the platform with the External Data Feed, it should be treated like any other provider's data.

                The only resource we can provide for creating a your own External Data Feed is the API documentation found here: https://ninjatrader.com/support/help.../functions.htm

                For oder placement from an AddOn window, you can review the AddOn Framework example in my previous post. As mentioned with data, the platform should handle orders natively, and the External Data Feed should handle the other end going from NinjaTrader to the provider.

                If you have any other specific questions on creating part of an AddOn window or another NinjaScript item, I will happy to be of further assistance.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  Thanks for reply,

                  you tell me that if I create my custom Instrument and my AddOn will recieve data in format - [ 2, 236.62, 9.0029, 236.88, 7.1138, -1.02, 0, 236.52, 5191.36754297, 250.01, 220.05 ] (https://docs.bitfinex.com/v1/reference#ws-public-ticker), it is possible to store it into NT platform and it takes care of everything else? Could you kindly provide snippet, which adds data to NT from Data Feed -> to store it to db on Hard drive and to show on chart with selected custom instrument?

                  Thanks a lot
                  Paul

                  Comment


                    #10
                    Hello kujista,

                    If you create your own External data feed and add the definitions for your instrument, you should be able to pull that data up through any part of the platform and NinjaTrader will handle the rest.

                    When NinjaTrader connects to an instrument, it performs a BarsRequest and downloads historical data for that instrument and stores it in "Documents\NinjaTrader 8\db". It then proceeds to show the Realtime data from the moment the chart was opened. Whenever a chart or other part of the platform needs to access this historical data, it will fetch it from local storage if it is there. NinjaTrader handles all of this internally, and there would not be an example I could share. We also do not have any examples for creating your own External Data Feed.

                    As mentioned, support for creating your own External Data Feed will be extremely limited. The API reference from post #7 will be the best resource available for developing it.

                    Historical data reference: https://ninjatrader.com/support/help...AndDataFormats

                    If there is anything else I can clear up for what can and should be done in NinjaTrader via NinjaScript, please let me know.
                    JimNinjaTrader Customer Service

                    Comment


                      #11
                      Another big thanks.. I would like to reffer to part:
                      "When NinjaTrader connects to an instrument, it performs a BarsRequest and downloads historical data for that instrument and stores it in "Documents\NinjaTrader 8\db"."

                      - how do I tell NT to connect to instrument and how do I specify in what format ( for me: [ 2, 236.62, 9.0029, 236.88, 7.1138, -1.02, 0, 236.52, 5191.36754297, 250.01, 220.05 ])

                      - and how do I tell, from what url and using what protocol to download it?

                      Comment


                        #12
                        Hello kujista,

                        - how do I tell NT to connect to instrument and how do I specify in what format ( for me: [ 2, 236.62, 9.0029, 236.88, 7.1138, -1.02, 0, 236.52, 5191.36754297, 250.01, 220.05 ])
                        This will be done whenever NinjaTrader opens a chart or uses part of the platform that requests for data. It will be handled for you and there would not be a way to specify the format. It would have to be provided by the data feed.

                        If you are looking for an example on how to connect to an instrument from an AddOn window to subscribe to market data, please refer to the AddOn Framework example.

                        - and how do I tell, from what url and using what protocol to download it?
                        NinjaTrader gets its data from the data providers it connects to. The External Data Feed that you wish to develop would need to translate this data into what can be usable through the DLL Interface API.

                        Please let me know if I can be of further assistance.
                        JimNinjaTrader Customer Service

                        Comment


                          #13
                          NinjaTrader gets its data from the data providers it connects to. The External Data Feed that you wish to develop would need to translate this data into what can be usable through the DLL Interface API.
                          - well how do I define "data provider" (in my case it is bitfinex) to which will NT connect?

                          i also attach image, to make sure, that I understand this principle...
                          Attached Files

                          Comment


                            #14
                            Hello kujista,

                            You would connect to the External Data Feed like other providers on the platform. (Control Center > Connections)

                            I would agree with your flowchart. I believe you are understanding correctly.
                            JimNinjaTrader Customer Service

                            Comment


                              #15
                              hello, Continuing this thread.
                              Can you please let me know how to configure a connection to "kraken" and get the data feed. can we do the configuration and connection/setup through ATI DLL methods like setuphost. If there are any samples of doing this, please let me know.
                              Thanks,
                              Subhash

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Irukandji, Today, 09:34 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post Irukandji  
                              Started by TraderBCL, Today, 04:38 AM
                              3 responses
                              24 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by WeyldFalcon, 08-07-2020, 06:13 AM
                              11 responses
                              1,423 views
                              0 likes
                              Last Post jculp
                              by jculp
                               
                              Started by RubenCazorla, Today, 09:07 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post RubenCazorla  
                              Started by BarzTrading, Today, 07:25 AM
                              2 responses
                              29 views
                              1 like
                              Last Post BarzTrading  
                              Working...
                              X