I am trying to connect to Interactive Brokers via their C# API. As an exercise, I am trying to develop my client in F#.
This is what I have done:
- I have imported the CSharpAPI project in Visual Studio. CSharpAPI defines the IBApi namespace
- I have created a new F# project in the solution. The project will host my implementation
I created a new module in a .fs file as below:
open IBApi module ibConnectivity = type IBclient = interface EWrapper with member this.connectionClosed() = printfn "connection has been closed" member this.currentTime time = printfn "server time: %i" time ....
I get the following error message:
Error 1 Files in libraries or multiple-file applications must begin with a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule'
I have googled around for a solution. I am a complete noob. Some posts refer to F# file order, but in this case I am working with a C# library.