Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem using SMA Median

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

    Problem using SMA Median

    I am trying create a customized indicator that uses the data from a 4 period SMA.
    The problem arises because, I need the “Median” value of the SMA (not the Close).

    The following “Description” command line works well for using the “Close” value of the SMA.
    Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDe scriptionSMA;

    I tried the following “Description” command line and it will not compile.
    Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDe scriptionSMA(Median, 4);

    Can someone tell me how I can modify the line so I can get the “Median” values of the SMA?

    Thanks in advance. I appreciate your help, and your expertise.


    #2
    Please ignore the space in the two places where "Description" is used. The space was added by the forum and I could not get rid of them.

    Comment


      #3
      Hello goodknight777,

      Thank you for your reply.

      The description isn't where you would define the period of the SMA nor the data type it uses. Are you calling the SMA from a different script, or are you trying to create a modified version of the built in SMA?

      I'm attaching a very simple example of using the Median price to calculate an SMA from an indicator.

      Please let us know if we may be of further assistance to you.
      Attached Files

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      607 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      353 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
      560 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      561 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X