Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

User defined methods and debugging in strategies

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

    User defined methods and debugging in strategies

    Sorry for asking two things in one post, but I have been struggling with this for a while so I thought that I would seek advise.

    1. I have written a user defined method in the indicators, the only way that I seem to get it to work in the Strategy was to make a 'copy' of it as a user define method in strategies is this true? I would have thought that it would have been 'safer' from a development point of view to only have one version being used.

    2. Are there any issues with using MS Visual studio and running debug on strategies, as I have managed to get it working correctly on indicators, but I do not hit any of my breakpoints whilst running a strategy, I have even put the breakpoint on the 'onbarupdate' function.

    Any help advise that you could give would be appreciated.

    TIA,

    Graham.

    #2
    Hi Graham, thanks for the inquiry.

    Regarding #1, NinjaTrader has two versions of UserDefinedMethods. One can be referenced by strategies only and the other can be referenced by indicators only. Your copy method is one way to make sure each file's contents are the same.

    For #2, have you seen the help guide section on debugging with Visual Studio?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin,

      Thanks for the reply, you mention that one way to make sure each file's contents are the same, is to copy them as I have done.

      Is there a better/alternative way? Since each time a change is done in one file it must be replicated to the other.

      Are there any thoughts of have common source code available for both indicators and strategies in future versions?

      Graham.

      Comment


        #4
        Hello,

        I will have Austin reply on Monday. I am not aware of another way.
        DenNinjaTrader Customer Service

        Comment


          #5
          Hi Graham,

          I am quite sure that if you define and compile code in the strategy folder it can be used by indicators too and vice versa. I tested it some time ago. I used an own namespace definition and you have to avoid parameters specific to strategies or indicators, i.e. 'Strategy' or 'Indicator'.

          Another way to define 2 identical files references based on a single copy is to create a hardlink over the operating system. In Windows XP in the command line editor there is a command 'fsutil hardlink create' which does that job.

          Regards
          Ralph

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Option Whisperer, Today, 09:55 AM
          1 response
          11 views
          0 likes
          Last Post bltdavid  
          Started by port119, Today, 02:43 PM
          0 responses
          1 view
          0 likes
          Last Post port119
          by port119
           
          Started by Philippe56140, Today, 02:35 PM
          0 responses
          3 views
          0 likes
          Last Post Philippe56140  
          Started by 00nevest, Today, 02:27 PM
          0 responses
          1 view
          0 likes
          Last Post 00nevest  
          Started by Jonafare, 12-06-2012, 03:48 PM
          5 responses
          3,986 views
          0 likes
          Last Post rene69851  
          Working...
          X