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

Error on strategy property - Class Member declaration expected.

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

    Error on strategy property - Class Member declaration expected.

    Hello,

    I have in my strategy serialization of TimeSpan and I am getting compilation error - wierd is that it is possible to compile, but error stays in Visual Studio.
    Could you help me how to fix this?

    thanks

    Paul

    Click image for larger version

Name:	image.png
Views:	193
Size:	75.5 KB
ID:	1255543

    #2
    Do you have two property definitions for FilterTTSessionABegin?

    The intellisense popup in your screenshot is showing a different one ...

    Comment


      #3
      Hello Paul,

      Thanks for your post.

      Please send me a reduced exported version of the script demonstrating this and the steps to reproduce the behavior so I may look into this matter further.

      To export a script, go to Tools > Export > NinjaScript AddOn.

      Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed. To create a copy of your script to modify, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.

      If you are unable to export the reduced copy of the script, please send me the .cs file of the reduced script so I may look into this matter. Strategy files could be found in the Documents\NinjaTrader 8\bin\Custom\Strategies folder.​

      I look forward to assisting further.
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by bltdavid View Post
        Do you have two property definitions for FilterTTSessionABegin?

        The intellisense popup in your screenshot is showing a different one ...
        the only definition of FilterTTSessionABegin is on line 328. It is not defined on other places.

        Comment


          #5
          Hi Brandon,

          error ocures when i have properties in separate file - public partial class. How do i solve this?

          Thanks a lot

          Paul

          Originally posted by NinjaTrader_BrandonH View Post
          Hello Paul,

          Thanks for your post.

          Please send me a reduced exported version of the script demonstrating this and the steps to reproduce the behavior so I may look into this matter further.

          To export a script, go to Tools > Export > NinjaScript AddOn.

          Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed. To create a copy of your script to modify, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.

          If you are unable to export the reduced copy of the script, please send me the .cs file of the reduced script so I may look into this matter. Strategy files could be found in the Documents\NinjaTrader 8\bin\Custom\Strategies folder.​

          I look forward to assisting further.
          Attached Files

          Comment


            #6
            Hello kujista,

            Thanks for that information.

            If you open the files you shared with Notepad++ and go to View > Show Symbol > and enable the 'Show non-printing characters' option I see that there are some extra characters being added in the script.

            To resolve this, download the free Notepad++ application if you do not already have it, right-click on the Devel.Properties.cs file > select 'Edit with Notepad++'. In Notepad++ go to View > Show Symbol > and enable the 'Show non-printing characters' option. Delete the characters (ZWSP) from the file seen in the attached screenshot.

            Also repeat this for the Devel.cs file to ensure there are not extra non-printing characters in that script also.

            Notepad++: https://notepad-plus-plus.org/

            After deleting the extra characters, copy the code in Notepad++ and paste it in the NinjaScript Editor window. Then run a compile and test to see if the error messages persist.

            Note that you could create/modify scripts in the NinjaScript Editor window to prevent extra non-printing characters from being added to the script.

            ​​
            Attached Files
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Hi,

              this did not help at all unfortunetaly :-/ I still see errors

              Click image for larger version

Name:	image.png
Views:	121
Size:	297.7 KB
ID:	1259770

              Comment


                #8
                It only helps me moving this code into Main file - Devel.cs

                Comment


                  #9
                  Hello kujista,

                  Thanks for your note.

                  The screenshot you shared is of Visual Studio. It is possible to see error messages and warning messages in Visual Studio but not in the NinjaScript Editor window. This is because the NinjaScript Editor window adds necessary code to the script that Visual Studio cannot see.

                  Please follow the steps mentioned in my previous post and run a compile in the NinjaScript Editor window. Note if the NinjaScript Editor window has any compile error messages visible.

                  From my previous post:

                  "To resolve this, download the free Notepad++ application if you do not already have it, right-click on the Devel.Properties.cs file > select 'Edit with Notepad++'. In Notepad++ go to View > Show Symbol > and enable the 'Show non-printing characters' option. Delete the characters (ZWSP) from the file seen in the attached screenshot.

                  Also, repeat this for the Devel.cs file to ensure there are not extra non-printing characters in that script also.

                  Notepad++: https://notepad-plus-plus.org/

                  After deleting the extra characters, copy the code in Notepad++ and paste it in the NinjaScript Editor window. Then run a compile and test to see if the error messages persist."


                  Do you see any error messages appearing in the NinjaScript Editor window after following the exact steps above and recompiling?

                  Keep in mind that you cannot run or build the solution in Visual Studio or this could cause issues to occur. NinjaScripts must be compiled in the NinjaScript Editor window to check for any compile errors. This is noted on the Visual Studio Debugging help guide page below.

                  Visual Studio Debugging: https://ninjatrader.com/support/help..._debugging.htm

                  If there are no compile errors in the NinjaScript Editor window then the script is good to go.
                  Brandon H.NinjaTrader Customer Service

                  Comment


                    #10
                    OMG It really helped - there white spaces. Thanks a lot.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by llanqui, Today, 03:53 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post llanqui
                    by llanqui
                     
                    Started by burtoninlondon, Today, 12:38 AM
                    0 responses
                    10 views
                    0 likes
                    Last Post burtoninlondon  
                    Started by AaronKoRn, Yesterday, 09:49 PM
                    0 responses
                    15 views
                    0 likes
                    Last Post AaronKoRn  
                    Started by carnitron, Yesterday, 08:42 PM
                    0 responses
                    11 views
                    0 likes
                    Last Post carnitron  
                    Started by strategist007, Yesterday, 07:51 PM
                    0 responses
                    14 views
                    0 likes
                    Last Post strategist007  
                    Working...
                    X