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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X