• 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.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access to BetterSinewave Variables

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

    Access to BetterSinewave Variables

    I bought the BetterSinewavePB and SR from emini-watch.com.

    They say that accessing the variables is very simple, however my coding was
    not able to bring them up.

    If anyone has experience with this program or his new programs let me know
    and I will share my code and you can tell me where I can make the corrections.

    They have turned me down on help with my code.

    Thanks,

    Don

    #2
    Not sure what you are asking... do you want to find the value of a specific plot at a specific bar?

    Comment


      #3
      Better Sinewave - emini-watch

      These are the indicator outputs the seller says that I should be able to get.


      Use these variables to access public values/states for Better Sine Wave indicators:
      BetterSinewave.Sine[BarsAgo]
      BetterSinewave.LeadSine[BarsAgo]
      BetterSineSR.Support[BarsAgo]
      BetterSineSR.Resistance[BarsAgo]
      BetterSineSR.BreakLo[BarsAgo]
      BetterSineSR.BreakHi[BarsAgo]
      BetterSineSR.PullBackSeries[BarsAgo]
      BetterSineSR.EndOfTrendSeries[BarsAgo]
      BetterSinePB.TrendSeries[BarsAgo] (UpTrend +1, DownTrend -1, NoTrend 0)

      I can send you my program if that helps.

      #region Using declarations
      using System;
      using System.ComponentModel;
      using System.Diagnostics;
      using System.Drawing;
      using System.Drawing.Drawing2D;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Data;
      using NinjaTrader.Gui.Chart;
      #endregion

      namespace NinjaTrader.Indicator
      {

      //================================================== ==============
      [Description("Gets the 'TrendSeries' .")]
      public class dbBSWGet : Indicator
      {
      private BetterSinePB sig3; //BetterSine PB is part of Trend direction.

      //================================================== ==============
      #region Variables
      // True/False Inputs to show arrows.
      private bool showBetterSinePB = false; // 1a (B) Arrows Up/Dn BarC

      // BetterSinePB Bar Trend Series
      private string bswPassword;
      private DataSeries trendSeries; // TrendSeries = +1

      #endregion

      //================================================== ==============
      protected override void Initialize()
      {
      trendSeries = new DataSeries(this); // This is the BetterSinePB Trend Number.
      Overlay = true; // This should draw Plots on the Chart Panel.
      DrawOnPricePanel = true;
      CalculateOnBarClose = true;
      }
      //================================================== ==============
      protected override void OnStartUp()
      {
      sig3 = BetterSinePB(Color.Red,bswPassword,Color.Green);
      }


      protected override void OnBarUpdate()
      {

      if(CurrentBar<1) return;

      // ------------------- Logic for BetterSineWave Arrows -------------------
      if( showBetterSinePB == true)
      {
      // double d = sig3.TrendSeries[0] ; // BetterSinePB (Take out'//' at left)
      }



      }

      #region Properties
      // ------- Data Series -------- //

      [XmlIgnore()]
      [Browsable(false)]
      public DataSeries TrendSeries
      {
      get { return trendSeries; }
      set { trendSeries = value;}
      }


      // BetterSinePB
      [Description("Enter your Password.")]
      [Category("2 - Better SineWave Input")]
      [Gui.Design.DisplayName(" Your Password")]
      public string BswPassword
      {
      get { return bswPassword; }
      set { bswPassword = value;}
      }


      #endregion
      }
      }

      If you have the BetterSinePB you can probably paste this code into a new indicator
      and see what I see.
      Need to take out the '//' at line 58 and I get the error CS1061 that says:
      'NinjaTrader.Indicator.BetterSinePB' does not contain a definition for 'TrendSeries'

      Thanks,
      Don

      Comment


        #4
        Better Sinewave - emini-watch

        Here's my .cs. Beware that I did get a strange message saying you would need access to 5 other files which don't involve the cs that i'm sending. Never got that message before.

        If it won't work.
        It's really easy to paste into a new Indicator. I've done it many times.

        Let me know if it imports for you.
        I can walk you through the procedure if necessary.
        dbl
        Attached Files

        Comment


          #5
          Got it. Successfully imported despite warnings...

          I'll play around with it and get back to you.

          Comment


            #6
            Originally posted by magnumdbl View Post
            These are the indicator outputs the seller says that I should be able to get.


            Use these variables to access public values/states for Better Sine Wave indicators:
            BetterSinewave.Sine[BarsAgo]
            BetterSinewave.LeadSine[BarsAgo]
            BetterSineSR.Support[BarsAgo]
            BetterSineSR.Resistance[BarsAgo]
            BetterSineSR.BreakLo[BarsAgo]
            BetterSineSR.BreakHi[BarsAgo]
            BetterSineSR.PullBackSeries[BarsAgo]
            BetterSineSR.EndOfTrendSeries[BarsAgo]
            BetterSinePB.TrendSeries[BarsAgo] (UpTrend +1, DownTrend -1, NoTrend 0)

            I can send you my program if that helps.

            #region Using declarations
            using System;
            using System.ComponentModel;
            using System.Diagnostics;
            using System.Drawing;
            using System.Drawing.Drawing2D;
            using System.Xml.Serialization;
            using NinjaTrader.Cbi;
            using NinjaTrader.Data;
            using NinjaTrader.Gui.Chart;
            #endregion

            namespace NinjaTrader.Indicator
            {

            //================================================== ==============
            [Description("Gets the 'TrendSeries' .")]
            public class dbBSWGet : Indicator
            {
            private BetterSinePB sig3; //BetterSine PB is part of Trend direction.

            //================================================== ==============
            #region Variables
            // True/False Inputs to show arrows.
            private bool showBetterSinePB = false; // 1a (B) Arrows Up/Dn BarC

            // BetterSinePB Bar Trend Series
            private string bswPassword;
            private DataSeries trendSeries; // TrendSeries = +1

            #endregion

            //================================================== ==============
            protected override void Initialize()
            {
            trendSeries = new DataSeries(this); // This is the BetterSinePB Trend Number.
            Overlay = true; // This should draw Plots on the Chart Panel.
            DrawOnPricePanel = true;
            CalculateOnBarClose = true;
            }
            //================================================== ==============
            protected override void OnStartUp()
            {
            sig3 = BetterSinePB(Color.Red,bswPassword,Color.Green);
            }


            protected override void OnBarUpdate()
            {

            if(CurrentBar<1) return;

            // ------------------- Logic for BetterSineWave Arrows -------------------
            if( showBetterSinePB == true)
            {
            // double d = sig3.TrendSeries[0] ; // BetterSinePB (Take out'//' at left)
            }



            }

            #region Properties
            // ------- Data Series -------- //

            [XmlIgnore()]
            [Browsable(false)]
            public DataSeries TrendSeries
            {
            get { return trendSeries; }
            set { trendSeries = value;}
            }


            // BetterSinePB
            [Description("Enter your Password.")]
            [Category("2 - Better SineWave Input")]
            [Gui.Design.DisplayName(" Your Password")]
            public string BswPassword
            {
            get { return bswPassword; }
            set { bswPassword = value;}
            }


            #endregion
            }
            }

            If you have the BetterSinePB you can probably paste this code into a new indicator
            and see what I see.
            Need to take out the '//' at line 58 and I get the error CS1061 that says:
            'NinjaTrader.Indicator.BetterSinePB' does not contain a definition for 'TrendSeries'

            Thanks,
            Don
            I do not understand what you are trying to achieve, and I do not have the Betterxxx indicators, but that message is correct. You have defined sig3 as an instance of BetterSinePB. TrendSeries is a DataSeries that you created as an independent object. There is no definition of your independent TrendSeries inside the BetterSonePB of which sig3 is an instance.

            Comment


              #7
              Originally posted by koganam View Post
              I do not understand what you are trying to achieve, and I do not have the Betterxxx indicators, but that message is correct. You have defined sig3 as an instance of BetterSinePB. TrendSeries is a DataSeries that you created as an independent object. There is no definition of your independent TrendSeries inside the BetterSonePB of which sig3 is an instance.
              It also gives the same error when you:

              Code:
              double test = BetterSinePB(Color.Red,Password,Color.Green).TrendSeries[0];
              Any other ideas, oh learned one, Koganam?

              Comment


                #8
                Originally posted by Crassius View Post
                It also gives the same error when you:

                Code:
                double test = BetterSinePB(Color.Red,Password,Color.Green).TrendSeries[0];
                Any other ideas, oh learned one, Koganam?
                Same error; same reason. TrendSeries is not an entity in BetterSinePB: it is a DataSeries defined in the current class.

                Comment


                  #9
                  Thanks for looking into this, Koganam,

                  Even when I comment out the TrendSeries language in the original posters script... including the properties it won't compile.

                  The instructions from the indicator vendor are that TrendSeries is a public property of BetterSinePB.

                  He gives a similar public property for his related indicator BetterSineWave of BetterSineWave.Sine. This compiles:

                  Code:
                  double test = BetterSinewave(password,true).Sine[0];
                  This would store the current bars value of Sine into the double test.

                  The vendor gives BetterSinePB.TrendSeries[barsAgo] as the instructions for retrieving the public property TrendSeries from BetterSinePB.
                  Last edited by Crassius; 04-25-2012, 04:15 PM.

                  Comment


                    #10
                    Originally posted by Crassius View Post
                    Thanks for looking into this, Koganam,

                    Even when I comment out the TrendSeries language in the original posters script... including the properties it won't compile.

                    The instructions from the indicator vendor are that TrendSeries is a public property of BetterSinePB.

                    He gives a similar public property for his related indicator BetterSineWave of BetterSineWave.Sine. This compiles:

                    Code:
                    double test = BetterSinewave(password,true).Sine[0];
                    This would store the current bars value of Sine into the double test.

                    The vendor gives BetterSinePB.TrendSeries[barsAgo] as the instructions for retrieving the public property TrendSeries from BetterSinePB.
                    Uh oh!! It looks like you are right. And since you are using the FQPN, if that were a public property, that should be accessible. What does Intellisense say? It seems to me that the author may have intended to make it public, but may actually not have? I guess it is time to contact the author.

                    The OP should not ask for help with his code from the author; that is probably why he is not responding. Instead he should state that he is getting an error trying to access a property that the author claims is exposed. A lot of programmers that I know refuse to look at another person's code, just so they do not get hit with copyright issues. (Basically, the attitude is: "If I never saw your code, you cannot later claim that I stole it.")

                    Comment


                      #11
                      I made a new indicator to test the two public properties:

                      Code:
                      protected override void OnBarUpdate()
                              {
                                 betterSineWaveSine = BetterSinewave(password,true).Sine[0];
                                  Print(betterSineWaveSine);
                                  //betterPBTrend = BetterSinePB(Color.Red,password,Color.Green).TrendSeries[0];
                      //Print(betterPBTrend);
                              }
                      The Sine property works, the TrendSeries property still give sthe error message,

                      Does not contain definition for...

                      Comment


                        #12
                        Originally posted by koganam View Post
                        Uh oh!! It looks like you are right. And since you are using the FQPN, if that were a public property, that should be accessible. What does Intellisense say? It seems to me that the author may have intended to make it public, but may actually not have? I guess it is time to contact the author.

                        The OP should not ask for help with his code from the author; that is probably why he is not responding. Instead he should state that he is getting an error trying to access a property that the author claims is exposed. A lot of programmers that I know refuse to look at another person's code, just so they do not get hit with copyright issues. (Basically, the attitude is: "If I never saw your code, you cannot later claim that I stole it.")
                        read this after my last post...

                        Yes, I think that is the case.... the property is SUPPOSED to be public but there is an error in the vendors script and that property is not exposed...

                        I know the vendor, Barry, is not a C# programmer and hired a NinjaScript consultant to translate his original EasyLanguage code, so he wouldn't know if it is exposed properly or not by looking at the code.

                        I suggest the OP contact Barry and let him know that this has been looked into by more than just the OP and it appears to us that the property is not exposed and is not working as advertised.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by HiddenPhilosopher, Today, 04:37 AM
                        1 response
                        13 views
                        0 likes
                        Last Post NinjaTrader_ChristopherS  
                        Started by aprendiz, Today, 06:44 AM
                        0 responses
                        0 views
                        0 likes
                        Last Post aprendiz  
                        Started by frankduc, Today, 06:35 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post frankduc  
                        Started by Trexxx, Today, 06:34 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post Trexxx
                        by Trexxx
                         
                        Started by Gerik, Today, 04:09 AM
                        1 response
                        7 views
                        0 likes
                        Last Post Gorkhaan  
                        Working...
                        X