Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pop up window

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

    #76
    Correct, that the private variables and enum defitions - but if you have user inputs you have to have a public property as well - please see our UniversalMA sample and then try calling it, should work as expected - http://www.ninjatrader.com/support/f...ead.php?t=3420

    Comment


      #77
      Thanks Bertrand,

      You mentioned I need public property. Is it public property of
      private
      DMAType mAType1 = DMAType.EMA;
      private DMAType mAType2 = DMAType.None;

      changing them into public?

      public DMAType mAType1 = DMAType.EMA;
      public DMAType mAType2 = DMAType.None;

      thanks
      peter

      Comment


        #78
        No Peter, that would not be what's needed - I suggest you refer the reference sample code I pointed you to as it would show the implementation - http://www.ninjatrader.com/support/f...ead.php?t=3420

        Comment


          #79
          Hi Bertrand,

          Because this is private indicator I am not allow to distribute I put on parts of code if you can help me to adjust that it can be used in strategy. I am playing with it 3 days and cannot make it work. Your example is working fine for me.Thanks. It looks like
          In Public class Variables we have this:
          private DMAType mAType1 = DMAType.EMA;
          private DMAType mAType2 = DMAType.None;

          publicenum DMAType
          {
          EMA =
          1, // Exponential Moving Average.
          HMA = 2, // Hull Moving Average. ....

          OnBarUpdate() has the following:
          //calculate and create set for first moving average type
          switch(mAType1)
          {
          case DMAType.EMA:
          ma2Series.Set(EMA(Input,mAPeriod1)[
          0]);
          break;



          I will continue in next message
          Thanks
          Peter

          Comment


            #80
            Hi Bertrand,

            This is continuation from previous post. Please have a look post before.

            In "Properties " we have the following:
            [Description("Moving Average Type 1")]
            [Category(
            "Parameters")]
            [Gui.Design.DisplayName(
            "01. MAType1")]
            [GridCategory(
            "Slope")]

            public NinjaTrader.Indicator.TsiPeterShort.DMAType MAType1
            {
            get { return mAType1; }
            set { mAType1 = value; }
            }

            [Description(
            "Moving Average Type 2")]
            [Category(
            "Parameters")]
            [Gui.Design.DisplayName(
            "03. MAType2")]
            [GridCategory(
            "Slope")]

            public NinjaTrader.Indicator.TsiPeterShort.DMAType MAType2
            {
            get { return mAType2; }
            set { mAType2 = value; }
            }

            In Stragegy I am calling the indicator and it looks like this:
            , DMAType.EMA, DMAType.None,

            To me its looks like strategy cannot find declaration for DMAType for some reason.
            I can send you indicator and strategy privately if this option is here.Let me know.

            Thanks
            Peter

            Comment


              #81
              Peter, yes if you could please contact me at support at ninjatrader dot com with the code so I could give them a spin here.

              Thanks,

              Comment


                #82
                Hi Bertrand,

                Thank you for your help. I really appreciate it.
                Can you remind me where can I find Windows system which is dealing with C# .
                I believe I saw it somewhere but now I cannot find it.

                Thanks
                Peter

                Comment


                  #83
                  Hi Peter, I'm not sure I follow what input you seek here - perhaps those classes?

                  Comment


                    #84
                    Thanks Bertrand,

                    Yes I need to learn more about c#.
                    I have another question:
                    I was doing cross in MACD indicator. It looks like this
                    CrossAbove(MACD(20, 50, 20), MACD(20, 50, 20).Avg, 1)
                    How can I make it do the cross on candle before. Like candle [1] or [2] ?

                    Thanks
                    Peter

                    Comment


                      #85
                      Peter,

                      You can use the lookback parameter for CrossAbove().

                      If you set to 3 then it checks the last 3 bars to see if there has been a crossover.
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #86
                        Thanks Ryan,

                        By lookback 3 bars I presume "Bars ago" in standard MACD indicator.
                        What is the Offset in this MACD indicator?

                        Thanks
                        Peter88

                        Comment


                          #87
                          Peter, you could learn about offsets in our Condition Builder help guide page - http://www.ninjatrader.com/support/h...on_builder.htm

                          Comment


                            #88
                            Thanks Bertrand,

                            I can see that during backtest NT only thakes consideration Open and Close of the bar.In real live trading price move inside of the bar. In backtesting SL must be minimum under the low of the present bar. Ohtervise we can have openinghigher than SL , price can go down 50pips cross SL inside the bar and close Higher than SL and SL was not trigered.Is this correct?

                            Thanks
                            Peter88

                            Comment


                              #89
                              Hi Peter, yes this would be expected in backtesting with the Set() methods and a single series chart - the only information known then is the OHLCV info of the particular bar, if a conflict situation arose NT would assume the stoploss triggered first to give a conservative backtest report.

                              Comment


                                #90
                                Hi Bertrand,
                                What other method can I use to backtest tick by tick inside bar?

                                Thanks
                                Peter

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                85 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                47 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                29 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                32 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                67 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X