Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

SQLite inside strategy?

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

    SQLite inside strategy?

    Hi - I'm trying to use the current .Net Sqlite (System.Data.SQLite), available for either .net 3.5 or 4.0 from http://system.data.sqlite.org/index....downloads.wiki. (so if anyone can point me to a how-to for ninja with this, we can ignore my later investigations below).

    My PC is an i7, running Win7 Pro, 64bit.

    From other threads, I've gathered that current NT uses .net 3.5 to run itself. However, having installed the .net 3.5 SQLite above, and in NT editing a strategy, I see that System.Data is not available. Since System.Data was available in .net 2.0, you likely have a simple setup explanation (for my incorrect setup) here, thanks.

    That led me to try the snippets below
    Print("Running .net version: " + System.Environment.Version );
    Print("Running .net version: " + System.Runtime.InteropServices.RuntimeEnvironment. GetSystemVersion() );
    These give the output:
    Running .net version: 2.0.50727.5456
    Running .net version: v2.0.50727
    (whether I'm running 32 or 64b NT)

    Also, as a test, I tried to add (edit into my strategy) System.HashSet, which entered .net in 3.5, and could not, making me think the environment is 2.0, not 3.5.

    I've verified that my system has both .net 3.5 and 4.0 installed (and NT itself runs fine), so I believe those versions are present.

    So, is it that NT itself is running .Net 3.5, but our strategies can only access 2.0 .net constructs, assemblies, etc?

    Thanks for clearing this up for me.

    #2
    It looks like you have to manually add the reference if you want to use System.Data:


    Comment


      #3
      Getting better, not there yet.

      Radical - thanks for the pointers...

      I tried both:
      • adding the Reference via right click in editing the strategy,
      • manually editing the Config.xml, as you suggested

      Both ways, the script compiles, but I still get failure to run properly...
      **NT** Error on calling 'OnTermination' method for strategy 'ScanBack/e018f12680d7404892371c184049f9ca': Could not load file or assembly 'System.Data.SQLite, Version=1.0.81.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified


      I believe it could find the actual dll file(s) involved.

      Maybe it's failing because of the versioning? (ie Sqlite wants .net 3.5 or 4.0, but the .net environment only appears to be 2.0xxxx).


      Will keep plugging away, thanks for any further pointers.

      Comment


        #4
        bnehlsen, can you please recheck your installed version of the custom dll you attempt to use - it would need to be created with a target framework of 3.5 set to be able to run it via NT7.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RubenCazorla, Today, 09:07 AM
        2 responses
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by i019945nj, 12-14-2023, 06:41 AM
        7 responses
        81 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by timmbbo, 07-05-2023, 10:21 PM
        4 responses
        158 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by tkaboris, Today, 08:01 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Lumbeezl, 01-11-2022, 06:50 PM
        31 responses
        819 views
        1 like
        Last Post NinjaTrader_Adrian  
        Working...
        X