Great Platform, but slow learning curve

Apr 25, 2013 at 10:17 AM
Edited Apr 25, 2013 at 10:47 AM
Hi all,
I found TradePlatform in just two days. I will give a five STARS for the project. But I think we needed to enhance the documentation. Otherwise, it is painful to the C# newbie like me to learn how to adopt it.
I can't make my app's or my experts run. Therefore I am asking for helping hand to make some clarification.
To my understanding, we can use the dlls in 2 ways:
  1. Develop dll library like the c++ dll project, then attach the dll to MT4 chart. All trading logic (or indicator calculation) are being done by the dll.
  2. Develop app that can communication with MT4 using the TradePlatform assemblies
What stopped me are following:
  1. Config file
  2. Folder Structure
Assuming my project is a expert typed project, only dll is generated. Please let me know what if I am wrong for the following settings:

EA purpose CAPTURE the chart for every new bar.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TradePlatform.MT4.Core;
using TradePlatform.MT4.SDK.API;

namespace Fx
{
    public class Test : TradePlatform.MT4.Core.ExpertAdvisor
    {
        private int bar;
        protected override int Init()
        {
            this.bar = 0;
            return (1);
        }
        protected override int DeInit()
        {
            return (1);
        }
        protected override int Start()
        {
            if (this.bar < this.Bars())
            {
                this.WindowScreenShot(string.Format("{0}-{1}.gif", this.Symbol(), this.Period()), 640, 480);
                this.bar = this.Bars();
            }
            return (0);
        }
    }
}
The dll generated is call: Fx.dll

Now for the config file, I am wondering with few things:
  1. the name of the config file: should it be Shell.dll.config or Fx.dll.config. If the assembly (Fx.dll) is placed in the Shell.exe folder, then I suspect it would be Shell.exe.config
  2. in the config file,
<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="BridgeConfiguration" type="TradePlatform.MT4.Core.Config.BridgeConfiguration, TradePlatform.MT4.Core"/>
  </configSections>
  <runtime>
    <loadFromRemoteSources enabled="true" />
  </runtime>
  <appSettings>
    <add key="NotifyToEmail" value="[YOUR_EMAIL]"/>
  </appSettings>
  <BridgeConfiguration useEventLog="true" wcfBaseAddress="http://localhost:8080/TradePlatform">
    <Hosts>
      <Host name="host1" ipAddress="127.0.0.1" port="2007">
        <Handlers>
          <!-- Experts -->
          <Handler name="Test" typeName="Fx.Test" assemblyName="Fx" />
          <!-- Common -->
        </Handlers>
      </Host>
    </Hosts>
  </BridgeConfiguration>
</configuration>
For <Handler name="Test" typeName="Fx.Test" assemblyName="Fx" />
The name is refer to the Class name, typeName refer to the namespace of the class, assembyName is the dll name
Am I correct?

Event I set it up, but nothing happen.

In the Expert_NET.mql file, I changed it to follow:
#property show_inputs

extern string System_NET_HandlerName = "Test";

#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###");
}
Here is the result:
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : Connection opened
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : --> Test12993|Test|Start|
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : <-- ###MQL###|Bars|
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : --> 0:no error|65795
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : <-- ###MQL###|Symbol|
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : --> 0:no error|EURUSD
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : <-- ###MQL###|Period|
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : --> 0:no error|1
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : <-- ###MQL###|WindowScreenShot|EURUSD-1.gif|640|480|-1|-1|-1|
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : --> 0:no error|1
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : <-- ###MQL###|Bars|
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : --> 0:no error|65795
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : <-- 0|
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : Method execution time: 54.0031 ms.
2013/4/25 18:46:26 @ 127.0.0.1:55779 > 127.0.0.1:2007 : Connection closed

Please notice the italic result!!!
Done!!!!