Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MySQL - sample script

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

    MySQL - sample script

    Hi, could anybody please be so kind an provide a sample script, how NT8 can be connected with the database MySQL.

    Furthermore, I would be interested to get the information which line I have to add as reference in the Script Editor (Error occurred while using MySQL Net Connector 6.9.3 - Assemblies - V4.0 or V4.5).

    Historical NT7 Code:
    USING:
    using MySql.Data;
    using MySql.Data.MySqlClient;

    VARIABLES:
    private MySqlConnection myConnection ;
    private string myConnectionString = "Server=192.168.2.119;User ID=MySQLdell;Password=$$$$$;Database=dbdummy;Port= 3306;Pooling=false";
    private MySqlCommand myCommand;
    private string mySelectQuery;

    FUNCTIONS:
    ...
    using(MySqlConnection myConnection = new MySqlConnection(myConnectionString)){...}

    Thanks, Al

    #2
    We do not have any samples handy at this time, but would encourage discussion amongst the community in this area.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks, that was the idea I posted the question within the General Discussion section. Looking forward to hear from a other member, how he/she set it up. Al

      Comment


        #4
        Enclosed please find my solution:
        NinjaScript Editor
        1. Press right mouse key / select "References" / add
        2. Please check where MySql was installed. In my case the following reference was added: C:/Program Files (x86)/MySql/MySql Connector Net 6.9.6/Assemblies/v2.0/MySql.Data.dll
        3. Furthermore I added the reference "System.Data.Dll", which I downloaded from the internet.

        It just works like in NT7.

        Maybe it helps you also!.


        USING:
        using MySql.Data;
        using MySql.Data.MySqlClient;

        VARIABLES:
        private MySqlConnection myConnection ;
        private string myConnectionString = "Server=192.168.2.119;User ID=MySQLdell;Password=$$$$$;Database=dbdummy;Port= 3306;Pooling=false";
        private MySqlCommand myCommand;
        private string mySelectQuery;

        FUNCTIONS:
        ...
        using(MySqlConnection myConnection = new MySqlConnection(myConnectionString)){...}

        Comment


          #5
          I created MySQL for NT7

          MySQL Syntax in NT7 will be very similar to NT8, so take a look at a project I built for NT7 to create a global PNL from MySQL.

          Note with NT8, NT has included OnAccountUpdate and the project I created is no longer needed to capture global PNL.

          https://www.bigmiketrading.com/elite...total-p-l.html

          Cheers,

          Sody

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, Yesterday, 10:06 AM
          0 responses
          17 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          16 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          14 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          9 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          38 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X