Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical Last/BID/ASK access in ninjascripts

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

    Historical Last/BID/ASK access in ninjascripts

    Hello
    In NT7.0033, we use Last/Bid/Ask in our strategies by using :
    (we configure the strategy with main Dataserie : Last / 1Tick on AAPL)
    and we add in Initialize :
    Add("AAPL", PeriodType.Tick, 1, MarketDataType.Bid);
    Add("AAPL", PeriodType.Tick, 1, MarketDataType.Ask);

    Then we print Last/Bid/Ask...

    It works with no problem in realtime (no historical data is requested from the database, just live from our datafeed wich provide Last/bid/ask correctly)

    Now we want to do calculations in the historical phase of the strategy, but historical data for the Bid/Ask Dataseries is not available in our DB nor in our datafeed (Last is still available). => The problem is that we cannot acces anymore to all our dataseries in historical (even for Last)

    => We did exactly the same test with NT8, in the same conditions. Even if there is no data for Bid/Ask, NT8 loads default values (same as Last) and we can access all the data series (and BID=Ask=Last )

    Concerning NT7 behaviour, is it a bug or do we have to change something in our strategy ?

    Concerning NT8, when we tried to download data from our Datafeed to populate the database, NT8 fills Ask/Bid fields with Last data even if the datafeed does not contain Ask/bid Data. Is it the attended behaviour ?

    Thanks for your help for us to understand if it is limitations or bug from our side.
    regards
    François

    #2
    Hello,

    Thank you for the post.

    I wanted to check, does the data provider you are currently using provide historical tick data for Ask and Bid?

    In the case they do not, what you are explaining sounds correct as far as being able to use the series in Realtime but not being able to request historical data. It would also be expected that the script is unable to run if one or more of its series fails to load data in NT7. Regarding the NT8 action, I would need to know more specifics on what data provider is being used and if historical data from the provider is available to further test this.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,
      Datafeed is iqfeed and it provides historical data for Last (tick level) but not for bid/ask.
      For nt7, I understand that if a dataserie fails to load, the script fails as well.
      For nt8, the script does work as the missing dataseries (bid ask) are automatically shadow copy from Last. It is my understanding...
      Best regards
      Francois

      Comment


        #4
        Hello,

        Thank you for the reply.

        I will further research this scenario and reply back once I have further details.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse, any news ?

          Comment


            #6
            Hello,

            Thank you for the reply.

            Unfortunately, I have no new news at this time, I am still currently working on getting a full expectation on what should occur in the various situations of loading data for NT8. Once I have further details I will provide them here.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              I am able to replicate the issue with 8.0.5.2 64bit. IQfeed 5.2.5.0. In historical data > load: intervals: Tick, Data Type: Ask, Bid, Last. When I check in the edit tab, the tick bid, ask, last series are all the same value. This is not the expected result.

              I enabled logging on iqfeed to see the request and data output, and ninjatrader is in fact asking - and receiving bid and ask prices from iqfeed. So this seems like a bug with ninjatrader.

              iqfeed request / response below:

              STATUS Information 11612 0 2017-03-26 15:52:33 LOOKUP SOCKET ACCEPTED 267 -
              STATUS Information 11612 0 2017-03-26 15:52:33 LOOKUP SOCKET ACCEPTED 268 -
              STATUS Information 11612 0 2017-03-26 15:52:33 LOOKUP SOCKET ACCEPTED 269 -
              FROM CLIENT LookupRequest 15656 267 2017-03-26 15:52:33 S,SET PROTOCOL,5.1

              TO CLIENT LookupData 15656 267 2017-03-26 15:52:33 S,CURRENT PROTOCOL,5.1


              TO CLIENT LookupData 15656 267 2017-03-26 15:52:33 S,CURRENT PROTOCOL,5.1


              FROM CLIENT LookupRequest 948 269 2017-03-26 15:52:33 S,SET PROTOCOL,5.1

              FROM CLIENT LookupRequest 21208 268 2017-03-26 15:52:33 S,SET PROTOCOL,5.1

              FROM CLIENT LookupRequest 15656 267 2017-03-26 15:52:33 HTT,AMZN,20170313 030000,20170315 025959,,,,1,,

              TO CLIENT LookupData 948 269 2017-03-26 15:52:33 S,CURRENT PROTOCOL,5.1


              TO CLIENT LookupData 21208 268 2017-03-26 15:52:33 S,CURRENT PROTOCOL,5.1


              TO CLIENT LookupData 948 269 2017-03-26 15:52:33 S,CURRENT PROTOCOL,5.1


              TO CLIENT LookupData 21208 268 2017-03-26 15:52:33 S,CURRENT PROTOCOL,5.1


              FROM CLIENT LookupRequest 948 269 2017-03-26 15:52:33 HTT,AMZN,20170313 030000,20170315 025959,,,,1,,

              FROM CLIENT LookupRequest 21208 268 2017-03-26 15:52:33 HTT,AMZN,20170313 030000,20170315 025959,,,,1,,

              TO CLIENT LookupData 15656 267 2017-03-26 15:52:34 2017-03-13 04:00:00.020,853.5600,1,1,852.0500,852.6900,1,O,11 ,8717,

              2017-03-13 04:02:15.046,853.5600,60,61,839.5000,855.1200,2,O, 11,873D17,

              2017-03-13 04:44:11.867,853.2900,1,62,851.1800,853.5600,3,O,1 1,8717,

              2017-03-13 05:05:57.309,850.9900,1,63,850.8300,853.0000,4,O,1 1,8717,

              2017-03-13 05:54:30.984,853.5200,1,64,850.2200,853.5300,1,O,5 ,8717,

              2017-03-13 06:30:52.744,851.0000,14,78,850.1300,854.2600,5,O, 11,873D17,

              2017-03-13 06:30:52.764,851.0000,2,80,850.1300,854.2600,6,O,1 1,873D17,

              2017-03-13 06:30:52.773,851.0000,1,81,850.1300,854.2600,7,O,1 1,873D17,

              2017-03-13 07:31:14.810,852.1600,5,86,851.1900,853.2600,8,O,1 1,8717,

              2017-03-13 07:31:14.810,851.7800,5,91,851.1900,853.2600,9,O,1 1,8717
              Last edited by DaVinci; 03-26-2017, 05:07 PM.

              Comment


                #8
                FWIW, since I checked to download bid, ask, and last ticks, ninjatrader appears to be submitting three LookupRequest HTT calls. In theory you guys only need to ask IQfeed once, since the tick response from IqFeed includes the bid, ask, and last in the same response. That is how I am doing it in my custom app outside of ninjatrader.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Mindset, 05-06-2023, 09:03 PM
                9 responses
                258 views
                0 likes
                Last Post ender_wiggum  
                Started by Mizzouman1, Today, 07:35 AM
                4 responses
                18 views
                0 likes
                Last Post Mizzouman1  
                Started by philmg, Today, 01:17 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_ChristopherJ  
                Started by cre8able, Today, 01:01 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by manitshah915, Today, 12:59 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Erick  
                Working...
                X