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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      49 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      69 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      36 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      96 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      59 views
      0 likes
      Last Post PaulMohn  
      Working...
      X