Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What is the best workflow for development in C#

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

    What is the best workflow for development in C#

    I have started working on my strategies in C# and would like to understand what would be a recommended workflow to compile my code for a quick turnaround.

    At the moment, I would edit code using Visual Studio as it seem to be working better with intelisense, early error detection and other features that NinjaScrip Editor doesn't seem to have. Then I would go to script editor and compile the strategy and reload it on the chart.

    I'm not sure if compiling is even necessary as I don't see any binary output. Does strategy tester compile from .cs file on the fly or in fact accessing some binary code from other directory when I load the strategy?

    I was unable to compile or run the strategy in VS, not sure if there configuration guild to do entire pipeline from VS?

    The other issue I've discovered is that my compiled strategy will not Enable to execute. I don't see compilation errors anywhere but "Enable" won't stick like if there some error. How do you troubleshoot these?

    thank you
    Attached Files
    xcoder
    NinjaTrader Ecosystem Vendor - EMS

    #2
    Hello Xcoder,

    As long as you have the NinjaScript editor open you can save the file in Visual Studio and it will compile automatically. You still need to observe the NinjaScript editor window after saving files to make sure there are no errors. Visual Studio has most of the context needed so it will show most errors but the NinjaScript editor is what does the compiling so if any errors are generated they would be in the editor. Visual studio cannot be used to compile but you can save files from there.

    After you compile depending on the change if you are using a chart you can use either the F5 reload for code that was changed in OnBarUpdate or for OnStateChange/class level items you can remove and re apply the script to see changes. If the strategy is being used from the control center you need to remove and re apply it.

    If a strategy will not enable check the control center log tab, you likely have a logical problem that is causing a runtime error.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you Jesse, this helps.

      I've tested and realized that I would actually have to click "compile" button in script editor after file is saved. Maybe there auto-compile feature that I didn't see?

      Another little annoyance is confirmation dialogue every time I reload the script with F5. Not sure if there a way to never ask it again. maybe some settings somewhere I didn't find yet.
      Attached Files
      Last edited by Xcoder; 10-23-2023, 08:07 PM.
      xcoder
      NinjaTrader Ecosystem Vendor - EMS

      Comment


        #4
        Hello Xcoder,

        There is no option to disable the auto compile, that should happen when you save files using visual studio. There is also no option to disable that dialog for strategies, that will always appear for a running strategy to make sure its ok to restart it.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by michelz, Yesterday, 08:30 AM
        5 responses
        34 views
        0 likes
        Last Post MiCe1999  
        Started by ntbone, Yesterday, 01:50 AM
        13 responses
        51 views
        0 likes
        Last Post MiCe1999  
        Started by gyilaoliver, Today, 10:30 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Irukandji, Yesterday, 04:24 PM
        2 responses
        27 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by madankumars, 11-18-2019, 11:12 AM
        15 responses
        204 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X