Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculations of an indicator with On market Depth

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

    Calculations of an indicator with On market Depth

    Hello, I am making an indicator with On market Depth, the question I have is how it would be better to call a method to make certain calculations.


    Thanks since now.
    Last edited by iradielt; 08-03-2021, 09:05 PM.

    #2
    Hello iradielt,

    This depends on the needs of the script and how you like to organize your code.

    If you need to calculate something everytime the level 2 ladder changes, that would have to run from OnMarketDepth().
    If you just need snapshots of the market depth each time the bar is updating, that can go in OnBarUpdate().

    Putting something in a method organizes that code as a set of actions. If you plan to run that set of actions from different triggers or events, then its best to put that in its own method and trigger the method instead of duplicating the code.
    Last edited by NinjaTrader_ChelseaB; 06-28-2021, 07:25 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      if I only want to see every time the orderbook changes only the first level of bid and ask. Can I use OnMarketData?
      Or It would be better to use OnMarketDepth.

      Comment


        #4
        Hello iradielt,

        For the first level of ask and bid, OnMarketData() would be fine.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        44 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        56 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        35 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        95 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        57 views
        0 likes
        Last Post PaulMohn  
        Working...
        X