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

Getting Trade Price on Tick Data

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

    Getting Trade Price on Tick Data

    Hi All:

    Is there a way to get last trade price on tick data? Specifically I have CalculateOnBarClose = false & I would like to have the current trade price at 6:30am. If this works on Market Replay Data that would be even better.

    Any help would be appreciated.

    #2
    Hello Geekodude,

    Thank you for your note.

    You can use Close[0] to receive the last traded price from the tick data.
    http://www.ninjatrader.com/support/h...html?close.htm
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply. But what is the logic to get the trade EXACTLY at 6:30am. This is what I have that does not work.

      if(ToTime(Time[0]) = 63000)

      Do something....

      I believe ToTime only works when the bar is closed. Is there a way to get a trade at a certain time when CalculateOnBarClose = false? Or is there some way to use multiple session templates to achieve this?

      Comment


        #4
        Geekodude,

        DateTime.Now would work for getting the most recent time from the Tick coming in.

        ToTime(DateTime.Now)
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          OK great. ToTime(DateTime.Now) works relative to the computer clock in real-time so to speak. Now the ideal situation is to also have code logic that works with market replay tick data. What would be the equivalent to parse market replay tick data to see what price trade occurred at 6:30am in market replay data? I guess what I am really asking for is there an equivalent call that gives the time relative to the CHART?
          Last edited by geekodude; 05-07-2014, 02:28 PM.

          Comment


            #6
            Geekodude,

            Yes, however this is unsupported so I don't have documentation on it.

            Bars.MarketData.Connection.Now

            That will work for both Market Replay and Live
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ender_wiggum, Today, 09:50 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by rajendrasubedi2023, Today, 09:50 AM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by geotrades1, Today, 10:02 AM
            0 responses
            4 views
            0 likes
            Last Post geotrades1  
            Started by bmartz, Today, 09:30 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by geddyisodin, Today, 05:20 AM
            3 responses
            26 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X