mql code in c#

To add comments, please log in or register
Noman Yaqoob
Noman Yaqoob  

what is wrong with this c# code. I am using TradePlatform.mt4 api:

 double bid = 0.0;
 double ask = 0.0;
 double balance = 0.0;
 int ticket = 0;
 bool connected=false;
 terminalA = Bridge.GetTerminal(12773749, "EURUSD");
 terminalA.MqlScope(mql => connected=mql.IsConnected());
 terminalA.MqlScope(mql => bid=mql.Bid());
 terminalA.MqlScope(mql => ask = mql.Ask());
 terminalA.MqlScope(mql => balance = mql.AccountCredit());
 terminalA.MqlScope(mql => ticket = mql.OrderSend("USDCAD",ORDER_TYPE.OP_BUY, 0.1, ask, 0, 0.0, 0.0, "test order"));

here 12773749 is account number that i have created on web terminal and my configuration code is as follow:

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

<BridgeConfiguration wcfBaseAddress="http://localhost:27917/mt4api">
    <Host name="host1" ipAddress="" port="2007">
        <!-- Experts -->
        <Handler name="MACrossExpert" typeName="TradePlatform.MT4.Demo.Library.Experts.MACrossExpert" assemblyName="TradePlatform.MT4.Demo.Library" />
        <!-- Indicators -->
        <Handler name="PrevDayHighLowIndicator" typeName="TradePlatform.MT4.Demo.Library.Indicators.PrevDayHighLowIndicator" assemblyName="TradePlatform.MT4.Demo.Library" />
        <!-- Scripts -->
        <Handler name="ImportOrdersScript" typeName="TradePlatform.MT4.Demo.Library.Scripts.ImportOrdersScript" assemblyName="TradePlatform.MT4.Demo.Library" />
        <Handler name="SendEmailScript" typeName="TradePlatform.MT4.Demo.Library.Scripts.SendEmailScript" assemblyName="TradePlatform.MT4.Demo.Library" />
        <!-- Tests -->
        <Handler name="UnitTestScript" typeName="TradePlatform.MT4.SDK.Library.Scripts.UnitTestScript" assemblyName="TradePlatform.MT4.SDK.Library" />
        <Handler name="SmokeTestScript" typeName="TradePlatform.MT4.SDK.Library.Scripts.SmokeTestScript" assemblyName="TradePlatform.MT4.SDK.Library">
            <Parameter propertyName="TestProperty" propertyValue="25" />
        <!-- Common -->
        <Handler name="QuoteListener" typeName="TradePlatform.MT4.Core.QuoteListener" assemblyName="TradePlatform.MT4.Core" />
    <Host name="host2" ipAddress="" port="2008">

Fernando Carreiro
Fernando Carreiro  
Noman Yaqoob: what is wrong with this c# code. I am using TradePlatform.mt4 api:

This forum is for mainly for MQL coding. TradePlatform is a 3rd party API so it might be better for you to discuss the issue on their forum:

EDIT: PS! Also, it seems that it has not been touched for over 4 years, so don't expect much from that project. It might be better for you to actually learn MQL instead of using a 3rd part API.

To add comments, please log in or register