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 birdog, 02-02-2023, 09:32 AM
            11 responses
            149 views
            0 likes
            Last Post birdog
            by birdog
             
            Started by sambathraj, Today, 07:46 PM
            0 responses
            17 views
            0 likes
            Last Post sambathraj  
            Started by topa11, Today, 12:52 PM
            2 responses
            35 views
            0 likes
            Last Post topa11
            by topa11
             
            Started by torento, Yesterday, 05:43 PM
            4 responses
            88 views
            0 likes
            Last Post torento
            by torento
             
            Started by sprks7979, Today, 05:59 PM
            0 responses
            34 views
            0 likes
            Last Post sprks7979  
            Working...
            X