• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.


No announcement yet.

Partner 728x90


Does NinjaScript process Core Indicators Different From 3rd Party Indicators?

  • Filter
  • Time
  • Show
Clear All
new posts

    Does NinjaScript process Core Indicators Different From 3rd Party Indicators?

    I'm not sure that I phrased the question propely, but I'm experimenting with some NS and ran into a problem. If I'm using a Moving Average in a Script, I can write

    private SMA smaFast;
    and there is no problem. But if I call a 3rd party MA and write"

    private amaEHMA amaehmaFast
    where amaEHMA is the Exponential HMA written by Harry, I get an error that says

    'NinjaTrader.NinjaScript.Strategies.Strategy.amaEH MA(int)' is a 'method' but is used like a 'type'
    So why can I call the SMA indicator with no problem, but get an error when I call amaEHMA?

    Here's more of a snippet. The offending code is line 44 "private amaEHMA amaehmaFast;"

    public class LMACross : Strategy
            ///private HMA hmaFast;
            private HMA hmaSlow;
            private amaEHMA amaehmaFast;
            protected override void OnStateChange()
                if (State == State.SetDefaults)
                    Description    = NinjaTrader.Custom.Resource.NinjaScriptStrategyDescriptionSampleMACrossOver;
                    Name           = "LMACross";
                    Fast            = 8;
                    Slow            = 21;
                    //Adj            = 13;
                    // This strategy has been designed to take advantage of performance gains in Strategy Analyzer optimizations
                    // See the Help Guide for additional information
                    IsInstantiatedOnEachOptimizationIteration = false;
                else if (State == State.DataLoaded)
                    amaehmaFast     = amaEHMA(Fast);                
                    hmaSlow             = HMA(Slow);
                    //hmaFast            = HMA(Fast);
                    amaehmaFast.Plots[0].Brush      = Brushes.Red;
                    hmaSlow.Plots[0].Brush              = Brushes.Cyan;
                    //AMAehmaAdj.Plots[0].Brush     = Brushes.Yellow;
    //              AddChartIndicator(hmaFast);

    Hello dmking,

    You should be able to call most custom indicators in the same way as system indicators however it will depend on how the item was developed. Is an indicator which is available for free download so that I could test? The syntax to call this indicator may just be different than what you have used.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service


      Hello dmking,

      No, system indicators are not called different than custom indicators.

      Are you certain the custom indicator is in the Indicators namespace?

      Attached is an example of a custom indicator called in a strategy.
      Attached Files
      Chelsea B.NinjaTrader Customer Service


        Thanks Jesse.

        There is a bundle of indicators from LizardIndicators. These indicators were developed by NT User Harry. I paid a fee to get access to his tools - They're very good. Harry has made many contributions on the forum, but I don't know if you guys have access from him. Is there a way that I can help out?



          Chelsea thanks for responding. I downloaded the zip file from his site and then imported the zip file into NT8. When I look at the indicators that are available to me, there is a Folder called Lizardindicators that contain all of his indicators. Hmm, Does it mak any difference that his indicators are in a folder? Do I have to call the indicator in a different way if it's in a folder?


            Jesse and Chelsea, A question Chelsea asked got me wondering so I move the indicator from the LizardIndicator folder and put it down with all the other indicators and recompiled it. That did the trick. So the question I have is, if an indicator is contained in a folder and you want to call it, what's the syntax for doing that?


              If you have questions regarding our "ama"-indicators, please contact me via a private message or contact LizardIndicators support. I will answer your questions.

              All "ama"-indicators are using a separate namespace "NinjaTrader.NinjaScript.Indicators.LizardIndi cato rs".

              When you call the amaEHMA, you need to add a line to the "Using directions":

              using NinjaTrader.NinjaScript.Indicators.LizardIndicators;
              However, it is not a good idea to move the indicator out of the namespace.

              In that case the indicator will no longer appear in the LizardIndicators folder, and other scripts calling the indicator may stop working.
              Last edited by Harry; 04-03-2019, 01:31 AM.


                Harry, Thanks for responding. Your suggestion is just what I needed and everything works as expected. I put the indicator back in the folder. Thanks for the heads up on that.

                As I've said, I'm very glad that I joined you guys as a member. Your work on the tools/indicators is VERY useful both from a standpoint of enhanced functionality AND from a heuristic standpoint of seeing what the best NT coding practices look like. Now, get to work on coding strategies. I'd gladly pay for anything that you do there.

                Kindest regards to a smart and giving guy.



                Latest Posts


                Topics Statistics Last Post
                Started by Eric M., Today, 05:25 PM
                0 responses
                1 view
                Last Post Eric M.
                by Eric M.
                Started by ttodua, Today, 01:52 PM
                1 response
                Last Post NinjaTrader_Jim  
                Started by muisca, 05-19-2017, 11:49 AM
                8 responses
                Last Post NinjaTrader_Tyler  
                Started by NinjaTrader_Brandon, Today, 12:08 PM
                0 responses
                Last Post NinjaTrader_Brandon  
                Started by iq200, Today, 12:00 PM
                2 responses
                Last Post iq200
                by iq200