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

Inserting historical data to NJ from text file using C#

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

  • smyaseen
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hello,

    Thank you for clarifying.

    Unfortunately, there are no supported ways to programmatically import historical data that can be viewed in the Historical Data Manager.

    While it would be possible to read data from a cvs file (see link below), this would be directly into memory for use with the script but would not be added to the historical data that is seen on the chart.

    Read/write excel file: - http://www.ninjatrader.com/support/f...36938&page=7#1

    If you would like to import the cvs data into NinjaTrader you will need to convert the cvs file to a text file with the proper formatting for import into NinjaTrader. Then you will need to follow the import instructions to import the data.

    See post #2 for the proper format and import instructions.

    Also, I've created a short video for another client for instructions converting a cvs to a txt for import.
    http://screencast.com/t/uJSNRl7GSr
    Hi,

    Thank you for your prompt reply. I have got the solution to my problem. My basic requirement was to store the CSV data in historical data manager, and also refresh the chart.

    Go to Tools --> Options --> Data tab
    Here is a checkbox under Real Time Data for storing the chart data to historical data.

    I checked this option and connected the NJ to External Data Feeder, generated the CSV which in turn refreshed the charts and stored the chart data to historical data as well :-)

    Leave a comment:


  • agassi
    replied
    Hi Chelsea,

    I am attaching a document of 2 pages. You can look at the indicator which I am trying to recreate on NT. Basically this is a moving average of all the bids and asks. NOT the price based on bids and asks. The response which you had posted was to graph the moving average of the price of the bids and asks.

    Do you think this has to be a custom built indicator? Kindly guide me through this..

    Thanks.
    Attached Files

    Leave a comment:


  • agassi
    replied
    Hi Chelsea,

    What I wanted originally was this:

    Say for example right now the CL (Crude Oil) market depth on the bid side is as follows:

    7 @ 99.35
    4 @ 99.34
    9 @ 99.33
    11 @ 99.32
    7 @ 99.31

    I just want to plot a line based on all the bids i.e. 7+4+9+11+7=38. I would like to do plot a similar line on asks. Is there a way to do this on NT?

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi agassi,

    Please look at my last post (post #12). The instructions to add a secondary SMA using Ask data are in this post (this instructions are assuming that you already have a primary data series using Bid data from the instructions in post #6.

    Leave a comment:


  • agassi
    replied
    Can i graph 2 charts in 1?

    Hi Chelsea,

    Is there a way to draw 2 charts on the same page i.e. a graph showing moving average of bids and another graph showing the moving average of ask on the same chart / page? If so, please advise, how I an do this task.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi agassi,

    By Level II window I am not referring to the ladder on the SuperDOM. I am referring to the Level II window.
    (File -> New -> Level II...)

    Below is a link to the help guide on the Level II window.
    http://www.ninjatrader.com/support/h..._ii_window.htm

    To add a second SMA to your chart using Ask data, you will need to first add a secondary data series of Ask data to your chart.
    • Right-click chart -> select Data Series... -> on the left select / search for the same instrument -> click the New button to add a second instance
    • On the right, change the value for 'Price based on' to Ask
    • Click OK
    • Right-click the chart again -> select Indicators...
    • Find SMA again -> click the New button to add a second instance
    • On the right click the value for 'Input series' -> click the ellipses button '...' that appears
    • Click the plus to expand the data set '<instrument name> (<interval> - Ask)'
    • Select the Close
    • Click OK -> click OK


    A video that explores something similar to this can be found on the link below.
    https://www.youtube.com/watch?v=x_6B...A14C398CA140D7

    Leave a comment:


  • agassi
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hi agassi,

    The SuperDOM is limited to the 5 closest rows of bid and ask prices. However, the Level II window is not limited in this way.

    Yes, the exchange does control the levels of Level II data. Also, the connection technology can also limit the number of levels of the Level II data.

    The Level II window will need the number of price levels set in the properties. By default this is set to 10.

    To change this right-click the Level II Window -> select Properties... -> increase the value for '# of price levels' (Summary) (and details if you like).

    As an example, if you have Kinetick most stocks will have up to 20 levels such as AAPL.
    Hi Chelsea,

    Thanks again. By level II window, are you referring to NT's Ladder also known as DOM (Depth of the Market)? I am aware of the level II windows on various equities / stock platforms.

    If I want to chart 2 moving averages on the same screen panel, is there a way to do that? i.e. i want a moving average of bid and moving average of ask on the same chart. is there a way to do this? Thanks again for your prompt response.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi agassi,

    The SuperDOM is limited to the 5 closest rows of bid and ask prices. However, the Level II window is not limited in this way.

    Yes, the exchange does control the levels of Level II data. Also, the connection technology can also limit the number of levels of the Level II data.

    The Level II window will need the number of price levels set in the properties. By default this is set to 10.

    To change this right-click the Level II Window -> select Properties... -> increase the value for '# of price levels' (Summary) (and details if you like).

    As an example, if you have Kinetick most stocks will have up to 20 levels such as AAPL.

    Leave a comment:


  • agassi
    replied
    Hi Chelsea,

    Thanks for your prompt reply. If I draw the moving average of bids and asks, i shut down NT and then open it again, would NT save all this historical bids and asks? or just like other market profile indicators etc., i loose this?

    Leave a comment:


  • agassi
    replied
    Thanks. This is kind of what I was looking for.

    Why does NT show only best 5 bids and best 5 asks? Limitation on software or limitatoin from data provider or exchange? This is still unclear to me.

    Leave a comment:


  • agassi
    replied
    Import historical bids and asks

    Hello,

    I need to create a simple moving average of historical bids and asks. Is there a way to do this in ninjatrader? I have a lifetime license and get data from CQG. I am aware that the bids and the asks keep on changing every millisecond. Given the scenario, how can some one

    1) Import the historical bid
    2) Then chart a simple moving average of those historical bids
    3) Import the historical Ask
    4) Then chart a simple moving average of those historical asks

    Does the exchange only give 5 bids and asks? Is that the reason why Ninjatrader only displays the best 5 bids as well as the best 5 asks? I know that in other trading platforms like Trading Technologies etc. the ladder i.e. DOM is more than 5 best bids and 5 asks. How are they able to display more than 5? Please shed some light on this. Thanks again.

    Agassi

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi agassi,
    Originally posted by agassi View Post
    Hi,

    Is it possible to import bids from real time data provider like CQG and draw a simple moving average? If so, how to go about doing this task? This is similar to the question originally posted by Yasmeen.
    CQG does offer historical Bid/Ask Minute/Tick data. Yes, you are able to create a simple moving average of this, however, this data will not need to be imported with the import instructions.

    Instead you will want to set your chart to load the Bid or Ask data and the add the SMA indicator.
    • Right-click your chart -> select Data Series...
    • In the parameters on the right, change the value for 'Price based on' to Bid (or Ask)
    • Click OK
    • Right-click the chart -> select Indicators... -> search for SMA -> click the New button -> click OK

    Leave a comment:


  • agassi
    replied
    Simple Moving Average

    Hi,

    Is it possible to import bids from real time data provider like CQG and draw a simple moving average? If so, how to go about doing this task? This is similar to the question originally posted by Yasmeen.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello,

    Thank you for clarifying.

    Unfortunately, there are no supported ways to programmatically import historical data that can be viewed in the Historical Data Manager.

    While it would be possible to read data from a cvs file (see link below), this would be directly into memory for use with the script but would not be added to the historical data that is seen on the chart.

    Read/write excel file: - http://www.ninjatrader.com/support/f...36938&page=7#1

    If you would like to import the cvs data into NinjaTrader you will need to convert the cvs file to a text file with the proper formatting for import into NinjaTrader. Then you will need to follow the import instructions to import the data.

    See post #2 for the proper format and import instructions.

    Also, I've created a short video for another client for instructions converting a cvs to a txt for import.
    http://screencast.com/t/uJSNRl7GSr

    Leave a comment:


  • smyaseen
    replied
    Hi,

    My requirement is that I have an excel file in which I put data, and run a macro which in return generates a CSV file. This file is in a particular format which can be imported in NJ manually. But now I want to develop a service in C# which takes that CSV file, parse it and insert the data in NJ programatically, instead of the manual process.

    I tried using Ninjatrader.Client.dll, but it has only 3 methods to send data, i.e. Ask, Bid, and Last which takes (instrument name, price, size) parameters only. I want to send (Date, Time, High, Low, Close, Volume) parameters.

    I want that data to see in Historical Data and also refresh the chart I have made in NJ.

    Please help.


    Regards,
    S.M.Yaseen.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by nandhumca, Today, 03:41 PM
0 responses
4 views
0 likes
Last Post nandhumca  
Started by The_Sec, Today, 03:37 PM
0 responses
3 views
0 likes
Last Post The_Sec
by The_Sec
 
Started by GwFutures1988, Today, 02:48 PM
1 response
5 views
0 likes
Last Post NinjaTrader_Clayton  
Started by ScottWalsh, 04-16-2024, 04:29 PM
6 responses
33 views
0 likes
Last Post ScottWalsh  
Started by frankthearm, Today, 09:08 AM
10 responses
36 views
0 likes
Last Post frankthearm  
Working...
X