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

Question Regarding Receiving Data and running Strategies

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

    Question Regarding Receiving Data and running Strategies

    hey there,

    maybe someone already answered this - and I have searched for a few full days honestly - so sorry if I missed it - but these seem like the corner stone of the system. What good is a nice strategy if it can't be executed for all stocks.

    Question 1. How do I pull all of the publicly traded stocks? Not just the SP500 that's included, but all - way over 10K.

    Question 2. IF there is a way to pull the data, is there any chance of doing it automatically? Currently it seems that even for just a few stocks (SP500), I have to connect to Kinnetic every morning first and get data for the last few days; can't it just pull information from my TD Ameritrade automatically?

    Question 3. Even for a few stocks it crashes and looses connection, is it even possible to use it for more than a handful stocks?
    Even if I'm successful in enabling the strategies, and the system doesn't hang after just adding a few stocks - like NASDAQ 100, it almost always drops within a few seconds and disconnects:
    "Disabling NinjaScript strategy 'Main_strategy/79449849'
    Strategy 'Main_strategy/79449851' lost price connection for more than 10 seconds and will be restarted.
    Disabling NinjaScript strategy 'Main_strategy/79449851'
    Strategy 'Main_strategy/79449852' lost price connection for more than 10 seconds and will be restarted.
    Disabling NinjaScript strategy 'Main_strategy/79449852'"

    Anyone successfully implementing a strategy across stocks in real time?

    Thanks

    #2
    Hello lmatiukas,

    You would need to create a custom instrument list with all of the stocks you would like.

    A heads up, most data providers and brokers will not allow that many simultaneous data subscriptions. Check with your provider to find what the limit of simultaneous data connections is for you.

    You can use a Market Analyzer window to load an instrument list of stocks and create an active data subscription for that instrument.
    http://ninjatrader.com/support/helpG...ument_rows.htm

    You can also add instruments to a script with a loop (though this is undocumented).
    Code:
    NinjaTrader.Cbi.InstrumentList list = NinjaTrader.Cbi.InstrumentList.GetObject("Custom");
    if (list != null)
    {
    foreach (Instrument i in list.Instruments)
    {
    //Print(i.FullName);
    Add(i.FullName, PeriodType.Day, 1);
    }
    }
    else
    {
    //Log("AddInstrumentsByListExample: There is no instrument list named Custom", LogLevel.Information);
    }
    Data will come from the first connected connection that supports that data type. If you connect to TD Ameritrade first, all equity data will come from TD Ameritrade.

    If you are experiencing connection losses, this is likely due to internet latency (and possibly the speed of the CPU).

    Are you on wireless or are you hardwired in to a router?
    Are you physically located near your brokerages servers?
    If you do a jitter / latency test are you finding that the internet connection is remaining at a steady speed?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alifarahani, 04-19-2024, 09:40 AM
    8 responses
    52 views
    0 likes
    Last Post alifarahani  
    Started by mmckinnm, Today, 01:34 PM
    2 responses
    4 views
    0 likes
    Last Post mmckinnm  
    Started by Conceptzx, 10-11-2022, 06:38 AM
    3 responses
    60 views
    0 likes
    Last Post NinjaTrader_SeanH  
    Started by f.saeidi, Today, 01:32 PM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by traderqz, Today, 12:06 AM
    9 responses
    16 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X