当前位置:网站首页>MT4/MQ4L入门到精通EA教程第二课-MQL语言常用函数(二)-账户信息常用功能函数
MT4/MQ4L入门到精通EA教程第二课-MQL语言常用函数(二)-账户信息常用功能函数
2022-08-09 01:58:00 【EA开发-青衫码客】
double AccountBalance(); // 返回当前账户的余额。
double AccountEquity(); // 返回当前账户的净值。
double AccountFreeMargin(); // 返回当前账户可用预付款。
double AccountMargin(); // 返回当前账户已用预付款。
脚本实例:
//+------------------------------------------------------------------+
//| hello.mq4 |
//| Copyright 2021, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
double balance=AccountBalance(); // 返回当前账户的余额。
double Equity=AccountEquity(); // 返回当前账户的净值。
double FreeMargin=AccountFreeMargin(); // 返回当前账户可用预付款。
double Margin=AccountMargin(); // 返回当前账户已用预付款。
Print("Account balance = ",balance);
Print("Account equity = ",Equity);
Print("Account free margin = ",FreeMargin);
Print("Account margin ", Margin);
//---
}
脚本运行结果
double AccountBalance();
返回当前账户的余额。
double AccountEquity();
返回当前账户的净值。
double AccountFreeMargin();
返回当前账户可用预付款。
double AccountMargin();
返回当前账户已用预付款。
工欲善其事,必先利其器,交易最重要的是遵守规则,严格执行。关注公众号,学习MQL入门到精通EA教程,学习更多EA编程,畅写属于自己的EA,锻造属于自己的神兵利器。
边栏推荐
- JDBC技术(二)——设置通用的sql和配置文件
- MAYA发动机建模
- 【Unity】判断鼠标是否点击在UI上
- 德语翻译-德语在线批量翻译软件
- When the centralized platform is gone, everything derived from this platform will be in vain
- Latex示例参考
- PostMan import certificate add certificate
- The server quit without updating PID file (/usr/local/mysql/data/localhost.pid).
- [C language brush questions] Application of fast and slow pointers in linked lists
- typescript90-使用类型文件声明类型
猜你喜欢
『Another Redis DeskTop Manager』用了这款Redis可视化工具,分析效率提升12倍
2022PMP项目管理认证考试报考指南(1)
深度学习模型的两种部署:ONNX与Caffe
保护您的 Web 应用程序的最佳开源 Web 应用程序防火墙
日文翻译-在线免费日文翻译软件
PostMan import certificate add certificate
typescript89-展示任务列表功能
《LC刷题总结》—— 二叉树
PMP有什么答题技巧?
class path resource [bean.xml] cannot be opened because it does not 错误解决方案
随机推荐
字节输入流(InputStream)与字节输出流(OutputStream)
Go-11 - Process Control
33. 分别谈谈联合索引生效和失效的条件
远程控制项目遇到的bug
Go-12-Structure
2020.10.13开发日志
任务五 处理连续型数据
谷歌翻译下载-免费谷歌翻译软件下载
Go-7-RESTful API的设计
智能视频监控设计摄像头部分
力扣刷题记录5.1-----59. 螺旋矩阵 II
LeetCode每日两题02:第一个错误的版本 (均1200道)方法:二分查找
makefile文件编译
TCP/IP协议栈
SEMRush如何寻找关键词用于投放广告
Latex example reference
New Swagger3.0 tutorial, OAS3 quick configuration guide, to automate API interface documentation!
Using ngrok on Raspberry Pi (Extra 2)
如何在EasyDSS中使用ffmpeg实现点播视频的拼接与合成?
最新豆瓣top250爬虫案例代码分析[注释齐全]