Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

SMA when Cumulative Delta zeros at noon

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

    SMA when Cumulative Delta zeros at noon

    Hi,

    The Order Flow Cumulative Delta zeros at noon. I would like to draw SMA on its panel but to start calculating its values from noon no to have false calculations.
    How can I achieve it?
    Attached Files

    #2
    Hello iskier,

    Thanks for your post.

    We have received your inquiry and are currently researching this matter in order to provide you with the best information possible.

    We will reach back out to you and update this forum thread once we are finished researching this topic.

    Thanks for your patience.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello iskier,

      Thanks for your patience.

      This would require that you come up with your own custom logic to accomplish what you have described.

      By default, the NinjaTrader SMA indicator plot is calculated by summing the closing prices of the security for a period of time and then dividing this total by the number of time periods. This indicator will plot from one session to the next, using historical bars from prior sessions for calculations. This means that the SMA indicator that comes with NinjaTrader could have a difference as seen in the screenshot you shared if the new session's data is less than or greater than the data at the previous session's close.

      The SMA uses its own plot for data points in its average so you would have to figure out exactly what to do and what logic to used when the session opens. You could likely check if the current bar is greater than the index of the session bar or not to delegate the calculation at that time.

      If you only want to cut off the SMA plot visually during those hours between sessions you could just not plot it by not assigning the SMA value to the plot within that timeframe. If you want that to also affect the SMA value, you would have to make a custom SMA indicator.
      Last edited by NinjaTrader_BrandonH; 08-28-2023, 08:26 AM.
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Hi, I edited and create my own indicator. The only thing is connecting last value of SMA of previous day to the first value of the new day. Is there a way to disconnect these plots? I don't want to see that line connecting both values only at the beginning of the session. Can I configure it somehow?
        Attached Files

        Comment


          #5
          Hello iskier,

          Thanks for your notes.

          To cut off the SMA plot visually during those hours between sessions you could just not plot it by not assigning the SMA value to the plot within that timeframe.

          For example, you could only assign the SMA value to the plot within a Time Filter condition. That way a plot will not be assigned to the plot outside of that Time Filter condition.

          Such as:

          if (time filter condition)
          {
          Value[0] = SMA(14)[0];
          }

          See the help guide documentation below for more information.

          'How to create time filters': https://ninjatrader.com/support/help...on_builder.htm
          AddPlot(): https://ninjatrader.com/support/help...t8/addplot.htm
          Value: https://ninjatrader.com/support/help.../nt8/value.htm
          SMA(): https://ninjatrader.com/support/help...simple_sma.htm
          Brandon H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          6 responses
          3,290 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          8 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          11 responses
          61 views
          0 likes
          Last Post halgo_boulder  
          Started by Option Whisperer, Today, 09:55 AM
          0 responses
          8 views
          0 likes
          Last Post Option Whisperer  
          Started by halgo_boulder, 04-20-2024, 08:44 AM
          2 responses
          24 views
          0 likes
          Last Post halgo_boulder  
          Working...
          X