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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      77 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X