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 lightsun47, Today, 03:51 PM
            0 responses
            5 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            10 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            46 views
            0 likes
            Last Post futtrader  
            Started by Option Whisperer, Today, 09:55 AM
            1 response
            14 views
            0 likes
            Last Post bltdavid  
            Started by port119, Today, 02:43 PM
            0 responses
            10 views
            0 likes
            Last Post port119
            by port119
             
            Working...
            X