Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

question on onmarketdata

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

    question on onmarketdata

    hi

    I´m trying to modify the VolumeProfile indicator and I looked for info on OnMarketData method, and MarketDataType but I didn´t what conditions identify each value of MarketDataType.Type, when it takes Bid, Ask, last what exactly does it means. Can anyone tell me more on this because NT help is too poor on this

    thanks

    #2
    telbentel, I'm sorry, I don't follow what you attempt doing: the OnMarketData() is called for each change in Level 1 data, this can be either the bid / ask or last.

    Also: it would work in realtime or Market Replay only, not in backtesting.

    Comment


      #3
      For what I read in NT help, the OnMarketData method is called any time there is a change in level 1 data, in particular this will happen every time a trade takes place, is that right?

      I need to know the volume asociated to that trade, I think I have to look the value of the parameter of the OnMarkedData call and if e.type==last then take the value of e.volume and I will have the volume of shares or contracts traded in the last trade at e.price. Is that right?

      I suppose e.type==bid will be when there is a change in the bid and similar for the ask.

      I took VolumeProfile as a template but I need to be sure of the above.

      Comment


        #4
        telbentel, your understanding is correct.

        Comment


          #5
          thanks for your answer.

          Just one last question, in case there is a trade that consume all the volume available at the bid or ask price, in that case there will be a new bid or ask price and a trade took place. My question is: The OnMarketData method will be called twice, once with the e parameter with the value e.type==last and other with the e.type==Last?

          Comment


            #6
            Correct, as you see calls for each change in Level 1 MarketData.

            Comment


              #7
              In the OnMarketData method, can I have access to Time[] or Times[]? If not, what other restrictions do I have?

              Comment


                #8
                This method is called for each Level 1 data change and as such it's no tied to any bars update calls, therefore calling Time / Times would not be useful.

                Comment


                  #9
                  yes I know, but I want to know the timestamp of the bar in progress that´s why I use Time[0], but when I try to use it my indicator doesn´t work. Can I use it inside OnMarketData?

                  Comment


                    #10
                    You should be able to use it if you're running on CalculateOnBarClose = false - to get the last / bid / ask tick time, you can access e.Time

                    Comment


                      #11
                      No I´m not able to access Time[] when I am in OnMarketData, I just check it, I put only an If sentence in the code for OnMarketData, the condition of this if was to check if Time[0] was between 2 timestamps and if yes show a messagebox, if not show another message box.

                      When I use Time[0] the indicator doesn´t work, it doesn´t show any of the two messages, when I use e.Time it works properly.

                      Just to let you know.

                      Comment


                        #12
                        Are you working in NT 6.5 or 7 beta here?

                        Comment


                          #13
                          I´m using version 6.5.1000.16

                          Comment


                            #14
                            Ok, that explains our differences then - I was checking on NT7.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            576 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            334 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            101 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            553 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            551 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X