• 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

Compiling PriceActionSwingPro

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

    Compiling PriceActionSwingPro

    Hello,

    Anyone using PriceActionSwingPro have issues compiling?

    I'm getting this error:

    NinjaTrader.Strategy.Strategy.PriceActionSwing(int , double, PriceActionSwing.Base.SwingStyle, bool)' is a 'method', which is not valid in the given context

    When attempting to compile this:

    if(PriceActionSwingPro(35, 7, PriceActionSwing.Base.SwingStyle.Ticks, false).DoubleTop[0] > CurrentDayOHL().CurrentOpen[0])

    Thanks in Advance

    #2
    Hello,
    Due to the nature of the PriceActionSwingPro indicator you will need to add in a using declaration for PriceActionSwing.Base. Once that is added in you can call the SwingStyle by using SwingStyle.Ticks.

    I have provided an example below:
    Code:
    #region Using Declarations
    //Below The other Declarations
    using PriceActionSwing.Base;
    #endregion
    
     protected override void OnBarUpdate()
     {
        if(PriceActionSwingPro(35, 7, SwingStyle.Ticks , false).DoubleTop[0] >      CurrentDayOHL().CurrentOpen[0])
        //DoSomething
    }
    Do to having to add in the using statement you would not be able to export this indicator and have it import. The developer of this indicator would need to make a change to it or have some other work around for calling this indicator within NinjaScript.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_CodyB View Post
      Do to having to add in the using statement you would not be able to export this indicator and have it import.
      [Do != Due.]

      Whaaaa? You sure about that?

      For someone who only uses the indicator on their charts, and not in NinjaScript, this is simply not true. But, for all others, it's not true either: the use of "using" is no impediment to exporting.

      The developer of this indicator would need to make a change to it or have some other work around for calling this indicator within NinjaScript.
      Whaaaa? Do you really mean that as something that is important?

      The same statement could be said about using MessageBox() -- which requires the NinjaScript writer to specify,

      Code:
      using System.Windows.Forms;
      Sorry, Cody, I disagree with your two statements. They are incomplete and misleading, or relatively useless.

      Comment


        #4
        It is not an impediment to exporting the class: it is an impediment to importing the exported class on another system.

        Comment


          #5
          Originally posted by koganam View Post
          It is not an impediment to exporting the class: it is an impediment to importing the exported class on another system.
          How so?

          What import errors should one expect?

          Comment


            #6
            Originally posted by bltdavid View Post
            How so?

            What import errors should one expect?
            An inability to access the public property in the custom namespace, when calling the instance constructor.

            Comment


              #7
              Originally posted by koganam View Post
              An inability to access the public property in the custom namespace, when calling the instance constructor.
              But, if all files are added to the exported .zip file correctly at the time of export, then I contend this problem won't occur. Why? Because the file(s) containing the custom namespace, if added to the export, means accessing said public property in that custom namespace should now succeed during the silent compile.

              I mean, if PASPro has one or more auxiliary files with additional namespaces used by the main indicator file, then just click the arrow button in the export dialog to manually add those auxiliary files to the export.

              If NT does not detect and add all needed auxiliary files to the export automatically, then the undetected files must be added manually. There are add/delete "arrow" buttons in the export dialog specifically for this.

              Comment


                #8
                Originally posted by bltdavid View Post
                But, if all files are added to the exported .zip file correctly at the time of export, then I contend this problem won't occur. Why? Because the file(s) containing the custom namespace, if added to the export, means accessing said public property in that custom namespace should now succeed during the silent compile.

                I mean, if PASPro has one or more auxiliary files with additional namespaces used by the main indicator file, then just click the arrow button in the export dialog to manually add those auxiliary files to the export.

                If NT does not detect and add all needed auxiliary files to the export automatically, then the undetected files must be added manually. There are add/delete "arrow" buttons in the export dialog specifically for this.
                Would that it were so simple. But that is easy to check. Do it and see. This is not a theoretical argument: many have already been tripped up by the situation.

                After you do the necessary and come a cropper, we can continue this discussion.

                Part of the problem is that NT recompiles your exported, and then imported code again into its gumball. The namespace may be exported: its reference is a different kettle fish during a recompilation.
                Last edited by koganam; 06-05-2016, 01:49 PM.

                Comment


                  #9
                  Originally posted by koganam View Post
                  Would that it were so simple. But that is easy to check. Do it and see.
                  Rats. You beat me to it. I was about to ask you for an example.

                  Originally posted by koganam View Post
                  After you do the necessary and come a cropper, we can continue this discussion.
                  Ok, I will make an attempt and get back to you, but give me a couple days. Monday is coming, always busy then.

                  [Btw, I had never heard the expression 'come a cropper' ... that was something new I had to lookup, lol.]

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Longhornmark, Today, 07:06 AM
                  4 responses
                  22 views
                  0 likes
                  Last Post bltdavid  
                  Started by bomberone3, Today, 02:59 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post bomberone3  
                  Started by Krossaren96, Today, 02:36 PM
                  1 response
                  14 views
                  0 likes
                  Last Post NinjaTrader_JoshG  
                  Started by Rafmed, 01-28-2019, 11:01 PM
                  8 responses
                  88 views
                  0 likes
                  Last Post aligator  
                  Started by priceisking, Today, 01:15 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X