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 Jonafare, 12-06-2012, 03:48 PM
          5 responses
          3,985 views
          0 likes
          Last Post rene69851  
          Started by Fitspressorest, Today, 01:38 PM
          0 responses
          2 views
          0 likes
          Last Post Fitspressorest  
          Started by Jonker, Today, 01:19 PM
          0 responses
          2 views
          0 likes
          Last Post Jonker
          by Jonker
           
          Started by futtrader, Today, 01:16 PM
          0 responses
          7 views
          0 likes
          Last Post futtrader  
          Started by Segwin, 05-07-2018, 02:15 PM
          14 responses
          1,792 views
          0 likes
          Last Post aligator  
          Working...
          X