This project is read-only.

Configuration section description

The application which hosts .NET Bridge (.NET Shell or your custom application) should have dedicated configuration section. to declare .NET Bridge configuration section you have to add this to your configuration file:

  <configSections>
    <section name="BridgeConfiguration" type="TradePlatform.MT4.Core.Config.BridgeConfiguration, TradePlatform.MT4.Core"/>
  </configSections>

and the section itself should be like following:

 

<BridgeConfiguration useEventLog="true" wcfBaseAddress="http://localhost:8080/TradePlatform">
    <Hosts>
      <Host name="host1" ipAddress="127.0.0.1" port="2007">
        <Handlers>
          <Handler name="handlerName" typeName="fullClassName" assemblyName="assemblyName">
            <Parameters>
              <Parameter propertyName="propertyName" propertyValue="propertyValue" />
            </Parameters>
          </Handler>
        </Handlers>
      </Host>
    </Hosts>
  </BridgeConfiguration>
  • useEventLog - when true application will log errors to Windows Event Log (application should have administrator rights in this case)
  • wcfBaseAddress - base address of WCF host used by _.NET Bridge_. Not really important, you can use basically any address.
  • Host - describes particular host configuration. It should have name, ip address and port number
  • Handler - Particular handler available for host. Should have a name and type resolving information.
  • Parameter - in case you have input parameter in your _.NET ExpertAdvisor_ you can set up it by this node.

 

More configuration parameters

Application configuration file should have more configuration for proper work

Mail setting section can be used to define default for SmtpClient class:

 <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="[FROM_ADDRESS]">
        <network host="smtp.gmail.com" userName="[GMAIL_LOGIN]" password="[GMAIL_PASS]" port="587" enableSsl="true"/>
      </smtp>
    </mailSettings>
  </system.net>

Connection string which used by TradePlatform Entity model:

<connectionStrings>
    <add name="TradePlatformEntities" connectionString="metadata=res://*/TradePlatformModel.csdl|res://*/TradePlatformModel.ssdl|res://*/TradePlatformModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=[PATH_TO_MDF_FILE];integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient"/>
  </connectionStrings>

Trace listener configuration:

 <system.diagnostics>
    <trace autoflush="false" indentsize="4">
      <listeners>
        <remove name="Default" />
        <add name="consoleListener" type="TradePlatform.MT4.Core.Utils.ConsoleBridgeTraceListener, TradePlatform.MT4.Core" />
      </listeners>
    </trace>
  </system.diagnostics>

WCF endpoints configuration:

<system.serviceModel>
    <services>
      <service name="TradePlatform.MT4.Data.TradePlatformDataService">
        <endpoint address="http://localhost:9000/TradePlatform/svc" binding="webHttpBinding" contract="System.Data.Services.IRequestHandler" />
      </service>
    </services>
  </system.serviceModel>

Last edited Nov 5, 2012 at 3:19 PM by vladkalos, version 1

Comments

JeanSebastien Jul 3, 2013 at 9:05 PM 
I added the BridgeConfiguration section to my file but I get the following error : "sectionCould not find schema information for the element BridgeConfiguration". It seems I am missing a schema file?