当前位置:网站首页>Mt4/mql4 getting started to be proficient in EA tutorial lesson 7 - common functions of MQL language (VII) - index value taking function
Mt4/mql4 getting started to be proficient in EA tutorial lesson 7 - common functions of MQL language (VII) - index value taking function
2022-06-22 08:02:00 【EA development - green shirt code customer】
double iMA()
obtain MA Data of indicators , This function is 7 Parameters
double iMA(
string symbol, // Trade variety
int timeframe, // Chart cycle
int ma_period, // Moving average time period
int ma_shift, // translation
int ma_method, // Moving average
int applied_price, // Application price
int shift // Value
)

Read the above parameter settings MA Code instance :
iMA(
NULL, // Current variety
0, // Current chart period
14, //MA cycle time 14
0, // translation 0
MODE_SMA, // Moving average Simple
PRICE_MEDIAN, // Application price Median Price
0 // At present MA value ,1 Means the previous one MA value By analogy
);

double iMACD()
obtain MACD Indicator data , This function is 8 Parameters
double iMACD(
string symbol, // Trade variety
int timeframe, // Chart cycle
int fast_ema_period, // fast EMA
int slow_ema_period, // slow EMA
int signal_period, // MACD SMA
int applied_price, // Application price
int mode, // Value mode MODE_MAIN take MACD Mainline value MODE_SIGNAL take MACD Signal value
int shift // Value
);

This indicator parameter code example :
iMACD(
NULL, // Current transaction category
0, // Current chart period
12, // fast EMA
26, // slow EMA
9, //MACD SMA
PRICE_CLOSE, // Application price
MODE_MAIN, // take MACD Column line value , MODE_SIGNAL, take MACD Signal value
0 // At present K Line MACD Column line value ,1 Indicates the value of the previous column line , By analogy
);
double iRSI()
obtain RSI Indicator data , This function is 5 Parameters
double iRSI(
string symbol, // Trade variety
int timeframe, // Chart cycle
int period, // RSI cycle
int applied_price, // Application price
int shift // Value
);

The indicator code example code
iRSI(
NULL, // Current transaction category
0, // Current chart period
14, //RSI cycle
PRICE_CLOSE,// Application price
0 // At present RSI value ,1 Means the previous one RSI value By analogy
);
double iStochastic()
obtain Stochastic Indicator data , This function is 9 Parameters
double iStochastic(
string symbol, // Trade variety
int timeframe, // Chart cycle
int Kperiod, // K Value period
int Dperiod, // D Value period
int slowing, // slowing value
int method, // Statistical methods
int price_field, // price (Low/High or Close/Close)
int mode, // Value mode ,MODE_MAIN Take the fast line value ,MODE_SIGNAL Take the slow line value
int shift // Value
);

The indicator instance code
iStochastic(
NULL, // Current transaction category
0, // Current chart period
5, //K Value period
3, //D Value period
3, // Slowing value
MODE_SMA, // Statistical price method Simple
0, //
MODE_SIGNAL, // take Stochastic Signal value , MODE_MAIN Take the fast line value
0 // At present Stochastic Signal value ,1 Means the previous one Stochastic Signal value And so on
);
double iCustom( )
Get custom indicator data , The function parameters are indefinite
double iCustom(
string symbol, // Trade variety
int timeframe, // Chart cycle
string name, // Index name
... // Index parameters , Can be more
int mode, // Value mode
int shift // Value
);

Code instance to get custom metrics ZIGZAG Signal data
iCustom(
NULL, // Current transaction category
0, // Current chart period
"ZIGZAG", // Index name
12, // Index parameters Depth
5, // Index parameters Deviation
3, // Index parameters Backstep
0, // Value mode ZIGZAG There is only one output parameter Can only be 0
0, // At present ZIGZAG value ,1 For the previous ZIGZGA value By analogy
);
A good workman does his work well , You must sharpen your tools first , The most important thing in trading is to follow the rules , Strictly carry out . Official account , Study MQL Beginner to master EA course , Learn more EA Programming , Write your own EA, Forge your own magic weapon .
边栏推荐
- (7)双向链表
- 什么是分布式事务
- Target detection series -- detailed explanation of RCNN principle
- Example of using listagg in Oracle 11g (splicing the values of a field into a line, separated by commas)
- 《守望先锋》阵亡镜头、全场最佳和亮眼表现是如何设计
- Common array operations in JS
- 【Oracle 数据库】奶妈式教程 day11 数值函数
- Concurrent programming summary
- 【Oracle 数据库】奶妈式教程 day12 字符函数
- Ugui text spacing textspacing
猜你喜欢

Relative positioning, absolute positioning, fixed positioning

Applet /vant UI to upload files

Invalid applet margin right, text overflow?

【Oracle 数据库】奶妈式教程 day11 数值函数

(7) Bidirectional linked list

面试突击59:一个表中可以有多个自增列吗?

Wx applet vant UI call interface to realize two-level cascade

【Oracle 数据库】奶妈式教程 day12 字符函数

Xlua environment configuration

navicat如何查询已连接的数据库密码信息
随机推荐
模电实验——实验二 JFET共源极放大电路
Why redis is so fast:
Fmdb usage details mark
(7)双向链表
C# 接口持有结构体会导致装箱问题
UI draw line
ExcelToJson
Kotlin a simple Android program
Design skills of common table structure in database design
(9)顺序队列与栈队列
Cocoapods creates private libraries and publishes them
What is distributed transaction
It operation and maintenance knowledge map
Concurrent programming summary
Common array operations in JS
0基础自学stm32(野火)——什么是寄存器?
Relative positioning, absolute positioning, fixed positioning
【Oracle 数据库】奶妈式教程 day13 日期函数
Technology blog collection
Some suggestions on Oracle SQL query return optimization