Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wrong current price Stamp

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

    Wrong current price Stamp

    Hello

    I am logging on from UK, cannot seem to get the correct price that matches the displayed default FDAX price using GetCurrentAsk(); / GetCurrentBid();, also, which session time should I be using as different session times give me different current prices ?

    #2
    Hello ms4551,

    Welcome to the NinjaTrader forums!

    Are you using these methods in a script? How are they used exactly and what exactly are you comparing against?

    You can see how different session templates are defined by clicking tools > Session Manager. You can also create your own session template if the preinstalled ones don't fit what you're looking for. You can review the times traded for FDAX by visiting the exchange website.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Yes the methods are being called in a script, also the reason why I mentioned different prices is because each time I change the session time and the run the script the recorded current price changes and it is the same price for both Bid and Ask as if the method is calling the index price instead of the futures price or the last traded price of that session.

      Comment


        #4
        When you call these methods historically, it will use the close value and won't be able to capture the current bid / ask data.

        To help you troubleshoot this we need to know exactly how you're using these methods (share the file or code snippet), what values you expect to get, and what you're getting instead.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I am enclosing a sample of the code

          Comment


            #6
            Your sample code assigns the value of these variables only during OnStartUp(), which is called only once. If you want them more current, you can access from OnBarUpdate. If you need to monitor for every change in level I bid / ask, then you can access prices from OnMarketData()

            protected override void OnStartUp()
            {
            //***********************



            Sprice = GetCurrentBid();
            Bprice = GetCurrentAsk();
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ETFVoyageur, Today, 02:08 AM
            0 responses
            5 views
            0 likes
            Last Post ETFVoyageur  
            Started by kujista, 04-22-2024, 07:46 AM
            3 responses
            12 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by kujista, 04-23-2024, 06:23 AM
            7 responses
            57 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by SentientDavid, Today, 01:34 AM
            0 responses
            7 views
            0 likes
            Last Post SentientDavid  
            Started by MrForgetful, Today, 01:28 AM
            0 responses
            6 views
            0 likes
            Last Post MrForgetful  
            Working...
            X