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 NullPointStrategies, Today, 05:17 AM
          0 responses
          41 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          64 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 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