[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: anybody try to launch broker thro c#



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "murthysuresh" <money@xxx> wrote:
>
> i seem to get compile errors and obviously am doing something wrong.

If you want to continue the approach you started then you will have to use the System.Reflection namespace to use late binding.  For example:

            Type brokerType = Type.GetTypeFromProgID("Broker.Application");
        object brokerObject = Activator.CreateInstance(brokerType);

        object analysis = brokerType.InvokeMember("Analysis",
                BindingFlags.GetProperty,
                null,
                brokerObject,
                null);

        object retVal = brokerType.InvokeMember("Backtest",
                BindingFlags.InvokeMethod,
                null,
                analysis,
                new object[] { 0 });



If you have the ability to use VB.Net you can take advantage of its built in late binding.  In VB, the same functionality as above would look like:

        Dim broker = CreateObject("Broker.Application")

        Dim analysis = broker.Analysis
        analysis.Backtest(0)


There is also an early binding type library in the members zone that you could use.  I haven't used it -- just curious if anyone is using it?


Tuzo

__._,_.___

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___