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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X