• 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

Live / Replay -- how to tell in NinjaScript?

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

    Live / Replay -- how to tell in NinjaScript?

    Is there a way, in NinjaScript, to know if the feed is Live or Replay?

    Thanks

    #2
    Hello TurtleTrader,

    You can check the Connection and if its the MarketReplay connection or not.

    if(Bars.MarketData.Connection.Name == "Market Replay Connection")
    {
    //Do something here
    }

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      ok

      thank you, that should work fine... :-)

      Comment


        #4
        Try this:

        Code:
        private bool IsMarketReplay
        {
            get {
                if (Bars == null || Bars.MarketData == null)
                    return false;
                return Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay;
            }
        }

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Jschmelz, Today, 01:13 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_EricB  
        Started by Newtrader101, Today, 12:37 PM
        2 responses
        13 views
        0 likes
        Last Post Newtrader101  
        Started by Robert87, Yesterday, 11:07 AM
        1 response
        24 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by U0000999, Today, 12:20 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_EricB  
        Started by im197, Today, 02:54 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X