NexusFi: Find Your Edge


Home Menu

 





Access to Google-Spreadsheet


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one DarthTrader with 5 posts (1 thanks)
    2. looks_two sam028 with 2 posts (1 thanks)
    3. looks_3 Big Mike with 1 posts (0 thanks)
    4. looks_4 ehlaban with 1 posts (0 thanks)
    1. trending_up 4,989 views
    2. thumb_up 7 thanks given
    3. group 6 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

Access to Google-Spreadsheet

  #1 (permalink)
 DarthTrader 
Cologne
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire, Velocity/TT
Trading: Futures, Stocks
Posts: 10 since Jun 2009
Thanks Given: 29
Thanks Received: 3

Hi,

I would like to know if it is generally possibly to access Google-Spreadsheets from a NT-Strategy.
I downloaded the Data-API from Google, referenced all the dll-Files and tried to run a sample code.
The error I get is only the message that a reference is missing. No more errors in any logs or tracefiles.
The error occurs during runtime.

Is it possible to access a spreadsheet from a strategy? Does someone have a code sample for me?

Thx
DarthTrader

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603



DarthTrader View Post
Hi,

I would like to know if it is generally possibly to access Google-Spreadsheets from a NT-Strategy.
I downloaded the Data-API from Google, referenced all the dll-Files and tried to run a sample code.
The error I get is only the message that a reference is missing. No more errors in any logs or tracefiles.
The error occurs during runtime.

Is it possible to access a spreadsheet from a strategy? Does someone have a code sample for me?

Thx
DarthTrader

Post the full error message.

Have you tried right-clicking in the editor window, and adding the reference (point to the DLL path)?

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

I created in the past a Strategy which was sending SMS (using Google agenda API ), it was working well.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #5 (permalink)
 DarthTrader 
Cologne
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire, Velocity/TT
Trading: Futures, Stocks
Posts: 10 since Jun 2009
Thanks Given: 29
Thanks Received: 3

That is the problem. the only message in output-window, logs or traces is:

**NT** Error on calling 'OnStartUp' method for strategy 'GoogleSpreadsheetTest/d0cc6e487abd4d7bbb5a92b8f4a3d16e': Die Datei oder Assembly "Google.GData.Spreadsheets, Version=1.9.0.0, Culture=neutral, PublicKeyToken=3f77feb76ff0d9a1" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

**NT** Error on calling 'OnBarUpdate' method for strategy 'GoogleSpreadsheetTest/d0cc6e487abd4d7bbb5a92b8f4a3d16e': Die Datei oder Assembly "Google.GData.Spreadsheets, Version=1.9.0.0, Culture=neutral, PublicKeyToken=3f77feb76ff0d9a1" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

Translationt: " ...Version 1.9.0.0 was not found or a reference to this file or assembly was not found ..."

I referenced the assemblies in the downloaded google-data-api:

C:\Programme\Google\Google Data API SDK\Redist\Google.GData.Client.dll
C:\Programme\Google\Google Data API SDK\Redist\Google.GData.Extensions.dll
C:\Programme\Google\Google Data API SDK\Samples\Google.GData.Spreadsheets.dll

I also tried to reference all the dlls in Redist-Folder from downloaded API, but the same error occured.

DT

Started this thread Reply With Quote
  #6 (permalink)
 DarthTrader 
Cologne
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire, Velocity/TT
Trading: Futures, Stocks
Posts: 10 since Jun 2009
Thanks Given: 29
Thanks Received: 3

I tried to code the project in SharpDevelop 3.2. Everything works fine with referencing the Google.GData.Client.dll and Google.GDataSpreadsheets.dll. This is the code to show all documents in your Google-Docs account:

 
Code
 
Console.WriteLine ("Connecting to Google Spreadsheets ...");
            
SpreadsheetsService service = new SpreadsheetsService("exampleCo-exampleApp-1");
service.setUserCredentials("USER", "PWD");
            
SpreadsheetQuery query = new SpreadsheetQuery();
SpreadsheetFeed feed = service.Query(query);

Console.WriteLine("Your spreadsheets:");
foreach (SpreadsheetEntry entry in feed.Entries)
{
       Console.WriteLine(entry.Title.Text);
}            
            
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
In NinjaTrader it doesn't work. I copied the dlls to NT/bin/Custom but always the same errot, that the dll reference is missing. The error occurs at runtime, when starting the strategy on a chart, compile works so far.

DT

Started this thread Reply With Quote
  #7 (permalink)
 ehlaban 
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
Posts: 91 since Nov 2009
Thanks Given: 66
Thanks Received: 57

Thinking ....
So you did include the references to ALL the dll's like Mike said?

Are they .Net dll's because otherwise it doesn't work i think ?!?!

also did you include the using namespaces in your Ninja script like

using Google.Application.etcetc

Reply With Quote
  #8 (permalink)
 DarthTrader 
Cologne
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire, Velocity/TT
Trading: Futures, Stocks
Posts: 10 since Jun 2009
Thanks Given: 29
Thanks Received: 3

Yes ... and yes ... I guess the downloaded files are .Net dlls.
As I mentioned above, no errors in SharpDevelop, only NT seems to have
a problem with referencing the dlls. Compiling works fine, after starting the strategy
I see the error in output window.

Data-API-Download: https://code.google.com/archive/p/google-gdata/downloads
Data-API-Getting-Started: https://code.google.com/intl/de-DE/apis/spreadsheets/data/2.0/developers_guide_dotnet.html
Complete-Sample: https://google-gdata.googlecode.com/svn/trunk/clients/cs/samples/spreadsheets/spreadsheetdemo.cs

Started this thread Reply With Quote
  #9 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

I tried myself too, and I have the same problem with this Spreadsheets.dll .
No idea, maybe @gomi have an idea ?

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #10 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505


If you look what Ninja does with process monitor (procmon.exe), you'll see it looks for external assemblies in the GAC (in windows\assembly) and NinjaTrader's bin folder (in Program Files).
So I think if you put the Google assemblies there, it should work better. A least it should load the assemblies.

On my PC I get AssemblyResolveEvents problems afterwards, but the asssemblies are loaded, and it may be specfic to my config though.

Reply With Quote




Last Updated on January 28, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts