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

How do I quickly use visual studio to debug NS indicators?

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

    How do I quickly use visual studio to debug NS indicators?

    Hi,
    I want to use visual studio(VS) to debug an indicator, what I have to do now is:
    change code in VS,
    save file in VS,
    open Ninjascript(NS) Editor,
    click on indicator code,
    hit compile,
    wait 10 seconds for audio confirmation of completion,
    switch to chart with indicator,
    press F5 to refresh chart indicators

    At this point I should see change from new codes, but just about 80% of the time. The remaining 20% of the time, the change is not reflected on chart, and I need to unload and reload indicator from/to chart. Sometimes I need to restart NT completely for new code change to show on chart.

    Question 1,
    Could you tell me I am doing it wrong, and there is a much faster way to debug from VS?

    I tried to rebuild solution inside VS, but it never gets reflected on NT chart. Only compile from NS editor works it seems.

    Question 2,
    Since NT chart is not updating at times, I want to find the compiled indicator file and manually delete it, so I can make sure the new version will be used. Could you tell me where that compiled file is located, and what action triggers NT to read the file again, instead of just loading old indicator codes from memory?

    Thank you!

    #2
    Hello xxzbill,
    You're doing it correctly, just go to indicator settings & hit reset on bottom right, its template which is overriding the changes you just made. If there is no default template for the indicator then it should work correctly.
    All compiled indicators are located in Documents\NinjaTrader 8\bin\Custom\Indicators & you don't need to do anything manually after compiling. Hope it helps!
    Last edited by s.kinra; 10-19-2020, 10:20 AM.

    Comment


      #3
      Hello xxzbill,

      Depending on the change you make in the indicator it may require that you remove and re apply it, that would be true for any public properties or State.SetDefaults/OnStateChange code.

      You can also leave the NS editor open, saving files in visual studio will trigger a compile.

      Building the solution in visual studio won't work, NinjaTrader will need to compile for changes to be reflected. Visual studio is only being used as a C# text editor in this case.

      The compiled file is not something you can delete, you would need to ensure that the platform has compiled and it will do that its self. Again some changes will need you to remove and re apply the item.

      The general workflow is usually:

      Open NS editor
      Click VS toolbar button
      Edit code in VS/ Save files in VS

      as long as the editor is open it will compile for you.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Waxavi, Today, 02:10 AM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      13 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by alifarahani, Today, 09:40 AM
      5 responses
      23 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X