This project is read-only.

TradePlatform.MT4.SDK.Win

Oct 30, 2012 at 10:01 AM

I am trying to running the Winforms demo provided with 2.0 but I am not sure which script/indicator/expert to load in MT4. Could you please provide some tips.

Baluda

Oct 30, 2012 at 10:27 AM

This topic is not really documented, so I understand your confuse

For such type of integration you have to use "QuoteListener" as System_NET_HandlerName

Oct 30, 2012 at 1:11 PM

I use this Expert_Net EA:

#property copyright "Copyright © 2012, Vladimir Kaloshin"
#property link      "http://solyanka.net/"

#property show_inputs

extern string System_NET_HandlerName = "QuoteListener";

// .NET Integration
#include <System_NET_API.mqh>
#include <System_NET_MQL.mqh>
#include <System_NET.mqh>

int init()
{
   System_NET_Init();
 System_NET_API_Init();
}

int start()
{
 System_NET_API_Start();
}

int deinit()
{
 System_NET_API_DeInit();
   System_NET_DeInit();
}

string System_NET_MQL_Custom(string message[])
{
 if(message[1] == "METHOD_NAME")
 return("RETURN_VALUE");
 
 return("###NORESULT###");
}

Ofcourse I compiled the WinForms app using the right accountnumber. There does not seem to be a connection. Any tips?

Oct 30, 2012 at 1:24 PM

Do you as well using same instrument in Win app and MetaTrade side?

metaTrader4 = Bridge.GetTerminal(126710, "EURUSD");

Do you see any logs in terminal or Debug window in VS while debugging WinApp?

You also have to consider, that connection between WInApp and MetaTrader will appear when new tick will arrive on MetaTrader side.

Oct 30, 2012 at 1:43 PM

Here's an event in the TradePlatform logbook:

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Execption" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2012-10-30T12:39:36.000000000Z" />
<EventRecordID>74</EventRecordID>
<Channel>TradePlatform.MT4</Channel>
<Computer>Paul-PC.delta.local</Computer>
<Security />
</System>
- <EventData>
<Data>TradePlatform.MT4.Core.Exceptions.HandlerLoadException: Can't load handler: Can't create intance of expert.. Failure Context: [HandlerName=QuoteListener, Discriminator=QuoteListener13759].Start() ---> System.ArgumentNullException: Waarde kan niet null zijn. Parameternaam: type bij System.Activator.CreateInstance(Type type, Boolean nonPublic) bij System.Activator.CreateInstance(Type type) bij TradePlatform.MT4.Core.Internals.HandlerProvider.GetOrCreate(ExpertInfo expertInfo, HostElement hostElement) --- Einde van intern uitzonderingsstackpad --- bij TradePlatform.MT4.Core.Internals.HandlerProvider.GetOrCreate(ExpertInfo expertInfo, HostElement hostElement) bij TradePlatform.MT4.Core.Internals.HandlerHost.HandleClientComm(Object client) System.ArgumentNullException: Waarde kan niet null zijn. Parameternaam: type bij System.Activator.CreateInstance(Type type, Boolean nonPublic) bij System.Activator.CreateInstance(Type type) bij TradePlatform.MT4.Core.Internals.HandlerProvider.GetOrCreate(ExpertInfo expertInfo, HostElement hostElement)</Data>
</EventData>
</Event>
 
Seems to be an ArgumentNullException on QuoteListener.Start()
Oct 30, 2012 at 2:13 PM

my bad. QuoteListener configuration bug. fixed in Source Control

Oct 30, 2012 at 2:23 PM

Works like a charm. Thank you.

Oct 30, 2012 at 2:51 PM

Please review release and also would be nice to get feedback from you

Oct 30, 2012 at 4:44 PM

Vladimir,

Will review this as 'excellent' when released as stable. Please provide some more samples.