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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        628 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        359 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        562 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X