Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Charts based on bid

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

    Charts based on bid

    Hi I have a paid account in ninja and a live MB Trading account . I have some strategies which are based on the bid price in the code (i.e. when buying I add the spread when selling i don't do anything). The problem is when i open a chart and change the data series from last to bid price then all my history disappears and i only have one bar, it then starts creating new bars as time progresses. I am using pivot points in my strategy and i have a feeling they are being calculated on bars using last price. Is there any way to get historical data in my charts using bid price...Most charting software tracks the bid price e,g. tradestation. This is most frustrating.
    Is there a solution for this.

    Kind Regards

    Max

    #2
    Max, this would be a function of the connected provider if it can support a historical bid / ask data series backfilled - MBT would unfortunately not support this, so you would need to connect first to a 3 rd party feed like Kinetick that would offer this backfill data for your charts.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      Have been using Kinetick and if i do a historical update based on bid then the charts only show 1 bar as well.

      Cheers Max

      Comment


        #4
        Max, this would be expected on minute based charts - for tick based charts it should work - what setup were you testing?

        Thanks
        BertrandNinjaTrader Customer Service

        Comment


          #5
          There is no easy way to get actual bid prices

          Unless you are using an indicator that gets the bid and ask prices from OnMarketData() or from the GomRecorder, the Bid and Ask prices you get are useless, since they are the same as the Last price. The reason for this is the one second minimum resolution of the time stamps for the price data, and the lack of anything in Ninjatrader historical data that shows the offset between the bid, ask, and last prices.

          Comment


            #6
            Ricam, I'm not sure I follow you - please see the screenshot attached ES on Kinetick 150 tick chart, blue bid, red ask - orange line on close - your last price.
            Attached Files
            BertrandNinjaTrader Customer Service

            Comment


              #7
              bid and ask cannot be accessed programmatically altho they appear on the chart

              Using Kinetick I put up a one tick chart of the YM showing line plots of the bid, ask and last going back one day and there are distinct plots for each, with the data backfilling to the beginning of the one day "bars back" setting.

              Now, the question is how do I get the bid and ask and last values off of a chart like this programmatically.GetCurrentBid() and GetCurrentAsk() DO NOT return these values. GetCurrentBid and GetCurrentAsk are always equal, even on a one tick chart.

              Is there a way to Add() to a chart dataseries of the bid and ask price of an instrument? Then maybe you could get the bid, ask and last from Closes[n][0]....

              The fact that this information is appearing on the chart, and backfills, would seem to indicate that it's possible to determine buy sell volume without using the GomRecorder; IF it's possible to access the bid and ask values that are appearing on the chart. So far I can't figure out how to do that.
              Last edited by Ricam; 11-08-2010, 10:54 AM.

              Comment


                #8
                Yes, correct you would add each series you need in the Initialize() of the indicator / strategy and then you could access via the regular MultiSeries framework in the code - http://www.ninjatrader.com/support/h...s/nt7/add3.htm
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  How do you Add() a dataseries for the Ask or Bid price?

                  I did notice on my one tick chart that GetCurrentBid and GetCurrentAsk seem to plot correctly and return the correct values in real time, but do not backfill. In Panel 2 I am plotting GetCurrentBid minus GetCurrentAsk. The last chart refresh was at 9.06 AM.

                  However, the plots of the bid and ask dataseries of the instrument in panel one DO backfill to the beginning of the chart period. (Panel 1 )



                  Bertrand, going back to your last post, what is the syntax for ADDing the bid or ask dataseries for an instrument?
                  Attached Files

                  Comment


                    #10
                    Ricam, please have a look at the link I posted - there's an extended Add() overload available where you can also Add() a MarketData type -

                    Add(string instrumentName, PeriodType periodType, int period, MarketDataType marketDataType)

                    GetCurrentBid / Ask are not meant for historical data, they would be replaced with the close in this call.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Need the OnBarUpdate event to fire on every trade

                      My understanding is that OnBarUpdate only fires when there is a change to the Last price. I need an event that triggers every time there is a TRADE.

                      Is there any way to do this with the OnBarUpdate method? I know it can be done with OnMarketData LAST events, but those only work in real time.

                      If the OnBarUpdate method can be triggered on every trade, we should be able to get real time AND historical bid ask data without using the GomRecorder.

                      Comment


                        #12
                        Hello,

                        Last = Trade.

                        Therefor OnBarUpdate() with COBC = False should do what you need.

                        Let me know if I can be of further assistance.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by trilliantrader, 04-18-2024, 08:16 AM
                        7 responses
                        27 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Started by samish18, 04-17-2024, 08:57 AM
                        17 responses
                        64 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Started by rocketman7, Today, 02:12 AM
                        2 responses
                        17 views
                        0 likes
                        Last Post rocketman7  
                        Started by briansaul, Today, 05:31 AM
                        1 response
                        13 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by PaulMohn, Today, 03:49 AM
                        1 response
                        12 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Working...
                        X