Receiving Market Data into Excel - excel

My summer project is developing an algorithmic trader that receives market data and trades based off indicators. I pull data from a company called Interactive Brokers using their TWS(Trader workshop station). I have downloaded their Excel API which uses DDE, but cannot get the Excel spreadsheet to properly connect with TWS.
In my excel spreadsheet, I wrote this command into a random cell. I've replaced 'sample123' with my TWS username It is suppose to evaluate to 0 before I make other adjustments but it evaluates to #REF!:
=Ssample123|tik!'id1?req?EUR_CASH_IDEALPRO_USD_~/'
Image of error received
Another issue with the error is it deletes two characters off my username and I am unsure of why.
Ex: username -> Sample123
Outcome -> Sample1
Any suggestions would be greatly appreciated! Thank you and have a nice day.

'sample123' in the example formula is the username that was used to login to TWS. It has to be replaced in your formulas with the actual username you used to login to TWS.
Also, to use the older legacy TWS DDE API you have to be running 32 bit TWS and have the setting "Enable DDE" checked in TWS Global Configuration.
Issues causing the #REF error
There is a newer 'DDE Socket Bridge' TWS API also available in the Latest version of the API which has additional functionality and is compatible with the 64 bit version of TWS.
DDE SocketBridge API

I've had the same problem. Just put twsserver instead

Related

Problem sending datas by Excel-VBA to PostgressSQL: [ODBC driver manager] data source name not found and no default driver specified

I need help with a task.
I have a VBA code at Excel to send some datas for PostgressSQL.
These days I reinstalled my Excel, but now, when I try to send the data the VBA presents the message below and the data is not include in my database:
"[ODBC driver manager] data source name not found and no default driver specified"
The debug highlight that the problem is in Conexao.Open. Below is part of the code with this:
Sub Conectar_BD()
Set Conexao = New ADODB.Connection
Conexao.ConnectionString = "DRIVER={PostgreSQL ANSI(x64)}; SERVER=localhost; DATABASE=yyyy; UID=marcel; PASSWORD=xxx;"
Conexao.Open
End Sub
Looking for some answers I found the explanation that I have to install the driver, but I´m not sure about how I could do that.
However, researching more I discovered a tutorial teaching how to connect the driver by admnistrative tool in the panel of control of windows called Datasource ODBC.
Following the instructions, when I added PostgreSQL ANSI(x64), that is there and put the credentials of my database, the conecction was sucessfully but the excel continue to present the same message.
Anyway, I don´t know how to fix this problem yet.
Anyone can help me?

RTE5 using `Shell` in VBA

Background:
Recently, a macro I use via VBA (in Excel) to run a script has stopped working; this subroutine worked for the previous six years. This is on a work device in which I do not have full admin privileges. The script file is stored on a network drive which I have access to, and can open and double-click to execute.
I have read from multiple sources, each not having an answer (including here on SO), that people have begun to see RTE5 when using Shell(), which may be related to security settings from the administrator.
One suggestion was to use use ShellExecute, which I have not had luck using.
Issue:
I receive RTE5 (invalid procedure call or argument) on the line for Shell() within the below code.
Question:
Has anyone had this same issue and been able to resolve said issue? Please indicate how you resolved.
Code:
'To open file, which previously worked:
Dim Loc As String
Loc = "Z:/filename.bat"
Call Shell(Loc, 1)
'Attempt at using ShellExecute, which gives Network Access error
Dim Loc As String
Loc = "Z:/filename.bat"
Call CreateObject("Shell.Application").ShellExecute(Loc, 1)

I receive "Object LIbrary feature not Supported" on Evernote SDK VBA sample at ListNotebooksForCOM()

I installed the Windows SDK, opened the sample spreadsheet and checked the reference to "Evernote Cloud SDK for Windows". I get the error when I run the VBA macro
This is the sample code:
Sub EvernoteSDKSample()
Dim EvernoteSession As New ENSessionForCOM
' Be sure to put your own consumer key and consumer secret here.
Call EvernoteSession.SetSharedSessionConsumerKey("hhagell", "3da657d6f5855f7b")
If EvernoteSession.sharedSession.IsAuthenticated = False Then
Call EvernoteSession.sharedSession.AuthenticateToEvernote
End If
' Get a list of all notebooks in the user's account.
Dim myNotebooks As ENCollection
Set myNotebooks = EvernoteSession.sharedSession.ListNotebooksForCOM()
I found a couple of people had the same error and did not find a resolution (at least one not documented)
Any thoughts would be appreciated.
Cheers
Any thoughts would be appreciated.

Is there somewhere to be found a complete list of default accounts for PR15Q2.2 or an updated Generic Charts of Accounts file for version PR15Q2.2?

I am working on creating a new charts of accounts file.
Started working with the coa file from here:
http://centralrepository.openbravo.com/openbravo/org.openbravo.forge.ui/ForgeModuleDetail/Generic-Chart-Of-Accounts
And using this as a guide:
http://wiki.openbravo.com/wiki/Creating_Accounts_Files
When I look at the file and the guide there is a difference when it comes to the standard accounts.
These are not in the guide on the web but in the file:
"CB_EXPENSE_ACCT"
"CB_RECEIPT_ACCT"
"CH_EXPENSE_ACCT"
And these are not in the Generic Charts of Accounts file but in the guide on the web:
P_COGS_RETURN_ACCT
P_REVENUE_RETURN_ACCT
T_CREDIT_TRANS_ACCT
T_DUE_TRANS_ACCT
Is there somewhere to be found a complete list of default accounts for PR15Q2.2 or an updated Generic Charts of Accounts file for version PR15Q2.2?
I'd recommend to use the testing spreadsheet from openbravo. The information in the wiki is indeed confusing, but in the spreadsheet you can paste your own COA and then debug until no errors are shown:
http://sourceforge.net/projects/openbravo/files/04-openbravo-accounting/Chart%20Of%20Accounts%20Test/
Hope it helps,
Regards
EDIT:
On the testing spreadsheet, the following default accounts are:
A_ACCUMDEPRECIATION_ACCT
A_DEPRECIATION_ACCT
B_ASSET_ACCT
B_EXPENSE_ACCT
B_INTRANSIT_ACCT
B_REVALUATIONGAIN_ACCT
B_REVALUATIONLOSS_ACCT
C_RECEIVABLE_ACCT
CB_ASSET_ACCT
CB_CASHTRANSFER_ACCT
CB_DIFFERENCES_ACCT
* CB_EXPENSE_ACCT
* CB_RECEIPT_ACCT
* CH_EXPENSE_ACCT
CURRENCYBALANCING_ACCT
DEFAULT_ACCT
INCOMESUMMARY_ACCT
NOTINVOICEDRECEIPTS_ACCT
P_ASSET_ACCT
P_COGS_ACCT
P_EXPENSE_ACCT
P_REVENUE_ACCT
SUSPENSEBALANCING_ACCT
SUSPENSEERROR_ACCT
T_CREDIT_ACCT
T_DUE_ACCT
V_LIABILITY_ACCT
W_DIFFERENCES_ACCT
WRITEOFF_ACCT
As per Openbravo pR15Q1.5 (released on the 19th of Juni 2015 - http://wiki.openbravo.com/wiki/Release_Notes/3.0PR15Q1.5), a COA tested with this spreadsheet, can be imported into Openbravo Business Suite.

Odd Oracle + .net behaviour when comparing types

My workplace has a .net application supplied to us by a postal service, it connects to an oracle database running on the same machine and is responsible for registering, storing and printing shipping labels.
Seeing as the database host etc. is configurable we asked the company if the application could be used over the network (simply copying it over to another machine resulted in "literal does not match format string" errors), all we were told is "it isn't possible". Not wanting to take no for an answer I poked around the exe with reflector.
Together with Oracle's v$sqlarea view I pinpointed the errors to a few date comparison functions, but I have no idea why the application was working in the first place on the original machine.
The original application uses queries similar to
SELECT * FROM shipping WHERE date = '2011/03/28' --error
easily fixed with something like
SELECT * FROM shipping WHERE to_char(date, 'yyyy/mm/dd') = '2011/03/28'
Why does the original application work without throwing any errors? The incorrect query pops up in the v$sqlarea view when the application is used on the original host, if I copy the query and run it manually using anything else it throws the error, if I run the application on any other machine it throws the error too, is there some setting in Oracle that is modifying queries on the fly, but only for queries originating from the local machine, while storing the original query in v$sqlarea?
This sounds like a regional settings difference between the two client machines, since formatting of dates will be dependent on the culture used to convert the date to a string in .NET, and unless the application specifies a culture, it will use the settings of the current logged on user running the application. This is obviously a problem if the database engine is expecting them in a certain format. This problem is less likely to arise with parametrized queries, where the date parameters are passed separate from the query and as a date datatype instead of a string.
If you work with dates, you must avoid String.Format based query generation. Use parametrized selects and parameters to set those values.
OracleCommand cmd = new OracleCommand("SELECT * FROM shipping WHERE date = :dataParam", connection);
var param = cmd.Parameters.Add("date", OracleDbType.Date);
param.Value = DateTime.Now;
It worked, because the format was matching the datetime settings on the developer machine and on the target database.
In other words: the issue is connected to an incorrect date time format you are trying to provide.
This could be because of regional settings on the server. Please check that the new server is configured for the same Locale (EN-GB, EN-US, or whatever the original server is configured to use).

Resources