当前位置:网站首页>How to judge the trend in quantitative trading
How to judge the trend in quantitative trading
2022-07-22 08:43:00 【LV Haiyang】
Catalog
Train of thought 、 Judge the trend through the idea of Dow's law
Train of thought two 、 Judge the trend through the moving average system
Implementation languages are mql5.
Train of thought 、 Judge the trend through the idea of Dow's law
//+------------------------------------------------------------------+
//| Dow's law judges trends .mq5 |
//| Copyright LV Haiyang QQ Communication group :157528427|
//| https://www.mql5.com/zh/signals/789037|
//+------------------------------------------------------------------+
#property copyright "Copyright LV Haiyang QQ Communication group :157528427"
#property link "https://www.mql5.com/zh/signals/789037"
#property version "1.00"
// Upward trend : Higher highs and higher lows
// Downward trend : Lower highs and lower lows
// Ideas :
// 1、 Find the nearest high : At present 50 Daily maximum price high1
// 2、 Find the second high point : 50 The day before 50 Daily maximum price high2
// 3、 Find the nearest low : At present 50 Daily lowest price low1
// 4、 Find the second low : 50 The day before 50 Daily lowest price low2
string symbol = "EURUSD"
ENUM_TIMEFRAMES timeframe = PERIOD_H4;
int peroid = 50;
double high1 = iHigh(symbol, timeframe, iHighest(symbol,timeframe,MODE_HIGH,peroid,0));
double low1 = iLow(symbol, timeframe, iLowest(symbol,timeframe,MODE_LOW,peroid,0));
double high2 = iHigh(symbol, timeframe, iHighest(symbol,timeframe,MODE_HIGH,peroid,peroid));
double low2 = iLow(symbol, timeframe, iLowest(symbol,timeframe,MODE_LOW,peroid,peroid));
// Upward trend
if(high1 > high2 && low1 > low2)
{
// Up trend strategy
}
// Downward trend
else if(high1 < high2 && low1 < low2)
{
// Downtrend strategy
}
Train of thought two 、 Judge the trend through the moving average system
//+------------------------------------------------------------------+
//| The moving average system judges the trend .mq5 |
//| Copyright LV Haiyang QQ Communication group :157528427|
//| https://www.mql5.com/zh/signals/789037|
//+------------------------------------------------------------------+
#property copyright "Copyright LV Haiyang QQ Communication group :157528427"
#property link "https://www.mql5.com/zh/signals/789037"
#property version "1.00"
// Upward trend : Average long permutation
// Downward trend : Average short spread
// Ideas :
// 1、 find 3 Average of cycles Currently used 8,13,21 MA
// 2、 Use the moving average system to judge the trend
string symbol = "EURUSD"
ENUM_TIMEFRAMES timeframe = PERIOD_H4;
int ma1_peroid = 8;
int ma2_peroid = 13;
int ma3_peroid = 21;
double ma1[];
ArraySetAsSeries(ma1,true);
int handle_ma1 = iMA(symbol,timeframe,ma1_peroid,0,MODE_SMA,PRICE_CLOSE);
CopyBuffer(handle_ma1,0,0,3,ma1);
double ma2[];
ArraySetAsSeries(ma2,true);
int handle_ma2 = iMA(symbol,timeframe,ma2_peroid,0,MODE_SMA,PRICE_CLOSE);
CopyBuffer(handle_ma2,0,0,3,ma2);
double ma3[];
ArraySetAsSeries(ma3,true);
int handle_ma3 = iMA(symbol,timeframe,ma3_peroid,0,MODE_SMA,PRICE_CLOSE);
CopyBuffer(handle_ma3,0,0,3,ma3);
// Upward trend
if(ma1[0] > ma2[0] && ma2[0] > ma3[0])
{
// Up trend strategy
}
// Downward trend
else if(ma1[0] < ma2[0] && ma2[0] < ma3[0])
{
// Downtrend strategy
}
边栏推荐
- [quick start of flex layout] quickly understand the usage of flex layout, and explain it through four common layout cases [detailed notes, as soon as you see it]
- Self study golang [Chapter 1: basic knowledge of go language] Why do you want to learn go language? The relationship between go language and C language? Founder of go language? What are the characteri
- 七/四/五层网络模型
- The difference and implementation of MyISAM and InnoDB in MySQL
- verilog——74HC85四位数值比较器并扩展为16位数值比较器
- Self study golang [3.8 use go language to find the longest substring without repeated characters] exercise code
- 量化交易日记-回撤分析-2021年02月6日
- How excel automatically matches gender code according to ID number
- Self study golang [3.2go language variable types and conditional statements, constants, variables, enumerations, application of if statements and switch statements]
- Soft test intermediate [Database System Engineer] Chapter 2: basic knowledge of program language, self-study soft test notes, overview of program language, basic translation of program language, diffe
猜你喜欢
解释内存中的栈(stack)、堆(heap)和方法区(method area)的用法
Soft exam intermediate [Database System Engineer] Chapter 1: computer system knowledge, self-study soft exam notes, preparation for the soft exam in May 2022, computer hardware system CPU composition
C语言刷题笔记之基础不牢地动山摇 <一>
Pytorch学习(一).深度学习回顾和Pytorch简介
量化交易日记-2021年01月总结
Self study golang [3.8 use go language to find the longest substring without repeated characters] exercise code
SPI debugging is not successful, it is likely that you connected the wrong cable!!
指针总结篇
The difference and implementation of MyISAM and InnoDB in MySQL
How to delete colored lines in Excel
随机推荐
Verilog应用——24秒篮球计数器
Quantitative transaction journal - fallback analysis - February 6, 2021
Shell exercise: Statistics of word frequency
Analysis of location cache module and detailed explanation of OCP monitoring and alarm
excel 如何根据身份证号自动匹配性别代码
自学golang【3.7map的练习代码】
七/四/五层网络模型
Partage de la stratégie de percée ultime des commerçants professionnels pendant de nombreuses années (avec un ensemble complet de modèles de transaction)
Error: L6218E: Undefined symbol SX1276FskGetPacketCrcOn (referred from sx1276-fsk.o)
Verilog - Basketball 24s timer
“珠峰”架构强势赋能 第三代荣威RX5/超混eRX5刷新产品力“天花板”
Verilog -- 74hc85 four bit numeric comparator and extended to 16 bit numeric comparator
指针总结篇
Soft test intermediate [Database System Engineer] Chapter 0: how to prepare for the test by self-study, test introduction, test preparation materials, size score distribution in the morning and aftern
解释内存中的栈(stack)、堆(heap)和方法区(method area)的用法
自学golang【第一章:go语言基础知识】为什么要学习go语言?go语言与c语言的关系?go语言创始人?go语言的特性有哪些?go语言适合做什么?国内外有哪些企业或项目使用go语言?
动态内存管理
Detailed construction process of airflow (personal test + summary)
vscode添加自定义注释
Redis的持久化方式RDB和AOF的区别