MT4 MANAGERAPI .NET WRAPPER

MetaTrader4 ManagerAPI .NET Wrapper

This is a library for .NET, a wrapper for native MetaQuotes ManagerAPI to work with MT4 server using any language that supports .NET. We all know that time is money. Using .NET you can develop applications much faster than using C++.
Furthermore, you can develop web applications on ASP.NET with no need in any third-party WebAPI (it saves your time and money)
In addition, you will be able to automate any business process in short period using PowerShell/Python scripting.

You can get access your MT4 server using any of these great languages:

  • C#
  • Visual Basic .NET
  • JScript .NET
  • C++/CLI (Managed C++)
  • F#
  • J#
  • PowerShell
  • Python for .NET (pythonnet)

Important feature is that you can use it when you develop web-application using ASP.NET framework, for example. You can use our wrapper directly from your web-site with no need to pay extra money to buy any Web.API
You can develop internal management and analytic system, you can write scripts to automate everyday routines very easily, you can do even more tasks using our wrapper.

Usage examples

Deposit money using PowerShell script right from windows command line

All you need to start working with MT4 server is our Wrapper and PowerShell interpreter that (usually) integrated within modern Windows OS.  For best experience you might want to use PowerShell ISE.
The script below shows the process of depositing money, a hundred USD to the '1000' account. Put your MT4 server IP/Login and password as well.
Wrapper uses NLog, so you will need it at least version 4.0.

[Reflection.Assembly]::LoadFile($PSScriptRoot + "\NLog.dll")
[Reflection.Assembly]::LoadFile($PSScriptRoot + "\CPlugin.PlatformWrapper.MetaTrader4.dll")

$man = New-Object 'CPlugin.PlatformWrapper.MetaTrader4.Manager' -ArgumentList "127.0.0.1:443", "1", "manager"

try {
    $result = $man.Connect()
    if($result -ne 'Ok') {
        $result
        exit
    }
    
    $tti = New-Object CPlugin.PlatformWrapper.MetaTrader4.Classes.TradeTransInfo    
    $tti.TradeCommand = [CPlugin.PlatformWrapper.MetaTrader4.Classes.TradeCommand]::Balance # trade command
    $tti.TradeTransactionType = [CPlugin.PlatformWrapper.MetaTrader4.Classes.TradeTransactionType]::BrBalance # transaction type
    $tti.OrderBy = 1000 # account login
    $tti.Price = 100 # amount
    $tti.Comment = "Deposit" # trade comment
    
    $man.TradeTransaction([ref] $tti);

} finally {
    $man.Disconnect()
}

Very same, but using C#

CPlugin.PlatformWrapper.MetaTrader4.Manager man = null;

try
{
	man = new CPlugin.PlatformWrapper.MetaTrader4.Manager
	{
		Server = "127.0.0.1",
		Login = "1",
		Password = "Password"
	};

	var tti = new TradeTransInfo
	{
		radeCommand = TradeCommand.Balance,
		TradeTransactionType = TradeTransactionType.BrBalance,
		OrderBy = 1000,
		Price = 100,
		Comment = "Deposit"
	};

	var result = man.TradeTransaction(ref tti);
        // in 'tti' you will receive order id
}
finally
{
	if(man != null)
		man.Disconnect();
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值