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

unexpected behavior between strategy and indicator

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

    unexpected behavior between strategy and indicator

    This is a bit complicated to explain.

    I have a strategy wizard developed, and still locked, strategy that references several indicators that I also developed.

    Here is the issue: When I load the previously exported binaries of the referenced indicators, everything works as expected.

    But if I have the source codes for the indicators loaded, the strategy won't compile...

    It errors on all references to any of the indicators... reporting that the reference to the indicator is "Used as an array"

    This doesn't seem right to me...

    Any comments?

    Gordo

    #2
    Hello,

    I believe if I understand you correctly this is expected as you will have double of the indicator in your NinjaTrader install. You can only have one indicator installed with the same name.

    If for example you remove the source codes temporally does the error go away? Be sure to just move the .cs files out of My Documents->NinjaTrader 7/6.5 ->bin->custom->indicatos that way you can move them back in when your done with your testing and need to do any editing.

    Let me know if I can be of further assistance.

    Comment


      #3
      The circumstance you suggest, of course, can't occur.

      I am sorry I wasn't clearer.

      At any point in time only one (source code) or the other (binaries) are loaded.

      With binaries loaded the strategy compiles. With source codes loaded the strategy does not compile.

      Again, I'm sorry I wasn't clear,

      Gordo

      Comment


        #4
        Hello,

        I tested this on my side and didnt run into any issue.

        Of course this type of switching really isnt supported as it requires you to shutdown NinjaTrader and edit and change/move these files manually. I would recommend from a workflow perspective.

        Did you originally build the strategy with the Binary or the .cs file in use?


        If you go back in and edit the strategy and readd the indicator where its mentioned in your strategy will it let you readd it?

        If you take the strategy(manually move .cs file out) out then compile your code then re add the strategy does this make a difference?

        Comment


          #5
          >>I tested this on my side and didnt run into any issue.
          if you post the codes you used, I'll try it here.

          >>Of course this type of switching really isnt supported as it requires you to shutdown NinjaTrader and
          >>edit and change/move these files manually. I would recommend from a workflow perspective.
          I am not sure just what this means. I am forced to do this because what one would normally expect to work does not!
          What part of the following is "not supported".. the exact procedure I am apparently forced to follow is this: I have "exported" my indicators as source. I have exported the same files as binaries. The strategy exists only as a locked strategy wizard file... which has been exported. There is no editing of the strategy.
          If I "import" the sources and compile them followed by "importing" the strategy and compiling it, this compilation will fail. I use the Editor to "delete" the strategy, followed by using the editor to delete all of the indicators. I exit NT. Now start NT, import the binaries of the indicator, import the same strategy file, and the compile of the strategy works!

          >>Did you originally build the strategy with the Binary or the .cs file in use?
          With the binaries.

          >>If you go back in and edit the strategy and readd the indicator where its mentioned in your strategy
          >>will it let you readd it?
          The strategy is a wizard locked file. If by editing you mean delete a condition that references one of the indicators, then renter it.... then the the answer is YES, iff the indicator binaries are loaded; NO, iff the indicator sources are loaded.


          >>If you take the strategy(manually move .cs file out) out then compile your code then re add the >>strategy does this make a difference?
          No.

          hope this advances the discussion...

          Comment


            #6
            Hello,

            I just made a copy of an indicator I have on my system and exported it as a binary. Then reimported it. Created a NinnjaScript strategy with the wizard with it. This compiled and worked. Then I deleted out the binary and restored my .cs file and the strategy still ran.

            The reason I mention workflow perspective is why are you reimporting the binary back when you already have the source code on this system, I dont understand what your trying to accomplish here? If your looking to test the final export I would recommend testing on another PC my self so that way you dont have to jump through as many hoops or am I missing something here?

            Comment


              #7
              I started out by saying this would be hard to explain....

              I would be perfectly happy to keep my sources... edit them and then run the my strategy.....

              But, as I am trying to report: the strategy won't compile when the sources are loaded.

              I am forced to keep switching back and forth in order to make any progress...

              So, way back... I exported the strategy and "removed" the indicator binaries then re- "imported" the sources... made my changes to the indicators and re-imported the the strategy.... it errors out on the compile.

              Forget all the switching stuff.... forget all about binaries.... My question, simply stated: why won't the wizard generated strategy compile against my indicator source files...

              based on your last post, it seems you compiled the strategy against the binary... thats the one that works. Try compiling the wizard strategy against the indicator source... that is what is failing for me.

              I want to thank for the time and effort you are putting into this, I apologize if my descriptions have not been the best,

              Gordo

              Comment


                #8
                Gordo, can you please post your code and exported assemblies (binaries), zipped up, so I can test this out on my end?
                AustinNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by geotrades1, Today, 10:02 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by ender_wiggum, Today, 09:50 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by rajendrasubedi2023, Today, 09:50 AM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by bmartz, Today, 09:30 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by geddyisodin, Today, 05:20 AM
                3 responses
                26 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X