Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I import a visual studio project into NinjaTrader?

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

    How do I import a visual studio project into NinjaTrader?

    I created a Windows Forms .NET 4.5 solution in Visual Studio.
    How do I get it to work the same way OnBarUpdate() of NinjaTrader?
    Other classes exist, methods, etc exist.

    I am currently recreating the project in Ninjatrader, but I'm getting an InitializeComponent does not exist in the current context error.

    My question is, is there an easy way to import the solution, or do I have to recreate the classes, methods, resources in NinjaTrader?

    I would assume that the easiest solutions was to call the solution in onbarupdate..

    Thanks IA.

    #2
    Hello lakersfan,

    If you are trying to edit NinjaScripts in Visual Studio, click the Visual Studio icon on the top toolbar of the NinjaScript Editor.

    You will not be able to compile in Visual Studio. But if you save a file you have edited in Visual Studio while the NinjaScript Editor is open, NinjaTrader will detect the changes to the file and automatically trigger a compile.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello lakersfan,

      If you are trying to edit NinjaScripts in Visual Studio, click the Visual Studio icon on the top toolbar of the NinjaScript Editor.

      You will not be able to compile in Visual Studio. But if you save a file you have edited in Visual Studio while the NinjaScript Editor is open, NinjaTrader will detect the changes to the file and automatically trigger a compile.

      https://ninjatrader.com/support/help..._debugging.htm
      Hi Chelsea,

      I was able to recreate the Windows Form in NT8, however, I am getting "calculating" on the chart. It seems as though the windows forms application "pauses" onbarupdate. Once I close the forms application, onbarupdate continues. Do you know what I can do maintain the forms application open, and continue with onbarupdate and the chart?

      Comment


        #4
        Hello lakersfan,

        It sounds like you are trying to do something that is not supported by NinjaTrader like make a new windows form window..

        Is all of the code in the script documented in the NinjaTrader Help Guide?


        As a heads up, NinjaTrader 8 uses WPF and does not use WinForms..

        Below is a link to an example that opens a new window (but does not use WinForms).
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello lakersfan,

          It sounds like you are trying to do something that is not supported by NinjaTrader like make a new windows form window..

          Is all of the code in the script documented in the NinjaTrader Help Guide?


          As a heads up, NinjaTrader 8 uses WPF and does not use WinForms..

          Below is a link to an example that opens a new window (but does not use WinForms).
          https://ninjatrader.com/support/foru...686#post492686
          Thank you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          45 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          21 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          31 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          50 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          42 views
          0 likes
          Last Post CarlTrading  
          Working...
          X