Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

connection to NinjaTrader.sqlite inside my indicator

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

    connection to NinjaTrader.sqlite inside my indicator

    Hello Support,

    I'm trying to connect to NinjaTrader.sqlite inside my indicator, but I'm failing.

    I've downloaded System.Data.SQLite.dll file from internet and added it to the indicator through references. The following code is compiled successfully

    Code:
    using System.Data.SQLite;
    using System.Data;
    
    protected override void OnStateChange()
    {
    else if (State == State.Configure)
    {
    using (var connection = new SQLiteConnection ("Data Source = NinjaTrader.sqlite"))
    {
    connection.Open();
    }
    }
    }




    but when i'm trying to add my indicator to a chart the following error occurs
    06.08.2023 2:45:09 Default Indicator 'TradesView': Error on calling 'OnStateChange' method: Не удалось загрузить файл или сборку "System.Data.SQLite, Version=1.0.92.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" либо одну из их зависимостей. Не удается найти указанный файл.

    ​please help
    Last edited by neboTrade; 08-06-2023, 01:55 AM.

    #2
    Hello neboTrade,

    Thank you for your post and welcome to the NinjaTrader forum community!

    Connecting to a database via NinjaScript is a general C# concept that is not supported by the NinjaTrader support team. That said, my colleague has offered some information and publicly available links related to the .NET version and System.Data.dll that should allow access to databases here:


    Otherwise, what is the reason that you are trying to connect to the NinjaTrader database? There may be some other solution or workaround to get the desired data.

    Please let me know if I may be of further assistance.

    Comment


      #3
      Hello Emily,

      Many thanks for the reply.

      I'm trying to get data of my past manual trades

      data got from <Account>.Executions​ or <Account>.Orders​ only gives me information of the current day trades. I would like to have data on all my past trades.

      The property

      trades.Properties.PlotExecutions = ChartExecutionStyle.TextAndMarker;

      displays past trades and their data on a chart so there is the way to get not only the current day trades data.

      Any help would be appreciated

      Comment


        #4
        Hello neboTrade,

        Thank you for your reply.

        You should be able to access a trade collection from the SystemPerformance object:


        This would allow you to access all trades from a strategy, short trades only, long trades only, or real-time trades generated by the strategy. More details regarding TradeCollection may be found here:


        Please let us know if we may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X