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

New to NT. Want to re-create SMR indicator lines

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

    New to NT. Want to re-create SMR indicator lines

    Hey, Im new to NinjaTrader and I want to be able to re-create SMR charts two indicator lines and I have no clue how to do that. The fast line is basically a SMA of closing price of the last 3 days - the SMA of closing price of the last 10 days. The slower line is a SMA 14 of the fast line. That's about it. Some help on this would be appreciated!

    David

    #2
    Hello David,

    Calling SMA's with different amounts of historical data would be very complicated. Indicators when called, use the same amount of historical data as is loaded on the chart.

    It would be simple to call these using different periods. This would change the amount of bars used in the SMA calculation but the indicator will still process all of the historical data loaded on the chart and doesn't cause the indicator to ignore some of the historical data.

    For example
    Print(SMA(3)[0] - SMA(10)[0]);

    To have different amounts of historical data loaded, this would have to be achieved by modifying the SMA to have a value that limits the number of days that will be processed.

    It would be possible to tell the indicator not to start processing until after a certain amount of days in historical data with custom code.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Give this a try.

      Originally posted by Dmoss3 View Post
      Hey, Im new to NinjaTrader and I want to be able to re-create SMR charts two indicator lines and I have no clue how to do that. The fast line is basically a SMA of closing price of the last 3 days - the SMA of closing price of the last 10 days. The slower line is a SMA 14 of the fast line. That's about it. Some help on this would be appreciated!

      David
      Attached Files

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DynamicTest, Yesterday, 11:18 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Rogers101, 05-05-2024, 11:30 AM
      6 responses
      26 views
      0 likes
      Last Post Rogers101  
      Started by llanqui, Yesterday, 03:51 PM
      4 responses
      22 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by smartromain, Yesterday, 10:50 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by nleitman, Yesterday, 11:46 AM
      11 responses
      29 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X