当前位置:网站首页>MT4 / MQ4L entry to the master of EA tutorial lesson two (2) - - MQL language commonly used function account information commonly used functions
MT4 / MQ4L entry to the master of EA tutorial lesson two (2) - - MQL language commonly used function account information commonly used functions
2022-08-09 02:03:00 【EA Development - Blue Shirt Coder】
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,锻造属于自己的神兵利器.
边栏推荐
猜你喜欢
Use of torchversion.transforms
如何在群晖系统中安装cpolar(群晖6.X版)
Image denoising based on edge enhancement Diffusion 】 (cEED) and Coherence Enhancing coursing together (cCED) filter to realize image denoising matlab code
德语翻译器在线翻译中文
Data recovery software EasyRecovery supports recovery of all types of files
eladmin容器部署超详细过程
谷歌翻译软件-免费谷歌翻译
etcd实现大规模服务治理应用实战
Grid布局介绍
LeetCode每日两题01:二分查找 (均1200道)
随机推荐
qps tps rps 区别
如何在推荐系统中玩转知识图谱
OpenSceneGraph3.5.1编译
seaborn 笔记: 绘制分类数据
2022/8/8 比赛思维+状压dp
谷歌翻译软件-免费谷歌翻译
etcd实现大规模服务治理应用实战
Loadrunner结合Fiddler实现脚本的录制
线段树知识整理
Docker redis master-slave replication setup, the container cannot be started?
The security of the pension insurance?Reliable?
数据库设计的总结
Go - 9 - data type - function
力扣刷题记录7.1-----707. 设计链表
MT4/MQL4入门到精通EA课程第二课-常用的功能函数
LeetCode每日两题01:二分查找 (均1200道)
PMP有什么答题技巧?
final
SEMRush如何寻找关键词用于投放广告
力扣刷题记录1.5-----367. 有效的完全平方数