Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SMA on Range Bar chart

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

    SMA on Range Bar chart

    Click image for larger version

Name:	NTSMARB.jpg
Views:	1
Size:	56.9 KB
ID:	898473

    The above shows an SMA(30) indicator plotted on a Range Bar chart.

    It appears that the SMA(30) indicator calculation is beginning after the 20th bar (rather than after the 30th), which doesn't seem correct to me.

    Have I misunderstood? Or is this a bug?

    #2
    Hello AnotherTrader,
    NinjaTrader will calculate the average of the last available bars till the total bars equals or more than the period value. For example on bar 20 it will calculate the average of SMA 20, on the 25th bar it will be the SMA 25 and so on till the total bars reaches 30 or more.


    If you like to see the formula on how injaTrader calulates thee SMA you can do so from:
    • In Control Center menu bar goto Tools>Edit Ninjascript>Indicators...
    • In the Indicators dialog select SMA and click on the Ok button.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Joydeep View Post
      Hello AnotherTrader,
      NinjaTrader will calculate the average of the last available bars till the total bars equals or more than the period value. For example on bar 20 it will calculate the average of SMA 20, on the 25th bar it will be the SMA 25 and so on till the total bars reaches 30 or more.



      If you like to see the formula on how injaTrader calulates thee SMA you can do so from:
      • In Control Center menu bar goto Tools>Edit Ninjascript>Indicators...
      • In the Indicators dialog select SMA and click on the Ok button.
      Please let me know if I can assist you any further.
      If that were the case, why isn't it also calculating (and showing) SMA 15 on the 15th, SMA 10 on the 10th, SMA 5 on the 5th, etc ...?

      Comment


        #4
        Hello AnotherTrader,
        Every indicator has a BarsRequired property. By default it is set to 20. Thus you are seeing the SMA starting from the 20th bar.

        You can change the BarsRequired property by editing the NinjaScript code.

        Please apply this modified SMA indicator where I have set the BarsRequiredd to 0 (zero). You will be able to see the SMA from the first bar itself.

        Attached Files
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        84 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        47 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        29 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        66 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X