Termos de Referência

Okay, this is a big one for MT5 traders. Let's do it properly.

In Python, the "Merge Tool" usually means 2 things:
1. *Merge MT5 data from different symbols / timeframes into one DataFrame*
2. *Plot it as a clean graph*

Here is a complete working setup:

*Step 1: Install*

pip install MetaTrader5 pandas matplotlib mplfinance

*Step 2: Full Code - Get MT5 Data + Merge + Plot*

import MetaTrader5 as mt5
import pandas as pd
import mplfinance as mpf
from datetime import datetime

# 1. CONNECT TO MT5
if not mt5.initialize():
 print("MT5 failed, open MT5 terminal first")
 quit()

# 2. FUNCTION TO GET DATA
def get_data(symbol, timeframe, bars=500):
 rates = mt5.copy_rates_from_pos(symbol, timeframe, 0, bars)
 df = pd.DataFrame(rates)
 df['time'] = pd.to_datetime(df['time'], unit='s')
 df.set_index('time', inplace=True)
 df.rename(columns={'tick_volume': 'volume'}, inplace=True)
 return df

# 3. GET 2 DIFFERENT DATA SETS
# Example: XAUUSD M1 + XAUUSD H1
df_m1 = get_data("XAUUSD", mt5.TIMEFRAME_M1, 500)
df_h1 = get_data("XAUUSD", mt5.TIMEFRAME_H1, 100)

# 4. MERGE TOOL - Merge M1 and H1 on time
# We merge the H1 close as a trend filter onto M1 chart
df_h1_trend = df_h1[['close']].rename(columns={'close': 'h1_close'})
df_merged = pd.merge_asof(
 df_m1.sort_index(),
 df_h1_trend.sort_index(),
 left_index=True,
 right_index=True,
 direction='backward'
)

# Add indicators
df_merged['EMA_20'] = df_merged['close'].ewm(span=20).mean()
df_merged['EMA_50'] = df_merged['close'].ewm(span=50).mean()

print(df_merged.tail())
mt5.shutdown()

# 5. PLOT GRAPH
# Create extra plots for EMAs
ap = [
 mpf.make_addplot(df_merged['EMA_20'], color='blue', width=1),
 mpf.make_addplot(df_merged['EMA_50'], color='orange', width=1),
 mpf.make_addplot(df_merged['h1_close'], color='purple', width=1, linestyle='--')
]

mpf.plot(
 df_merged.tail(200), # plot last 200 candles
 type='candle',
 style='charles',
 title='XAUUSD M1 Merged with H1 Trend',
 ylabel='Price',
 volume=True,
 addplot=ap,
 figsize=(14, 7),
 savefig='merged_chart.png'
)
print("Chart saved as merged_chart.png")

*What this does:*
- Pulls live data straight from your MT5 terminal
- Merges the H1 close price onto the M1 chart, so you can see the higher timeframe trend while scalping
- Plots candles + EMA 20 / EMA 50 + H1 trend line

*If you want to merge 2 SYMBOLS instead (e.g. XAUUSD + EURUSD):*

# Get both
gold = get_data("XAUUSD", mt5.TIMEFRAME_H1, 500)[['close']].rename(columns={'close': 'GOLD'})
eur = get_data("EURUSD", mt5.TIMEFRAME_H1, 500)[['close']].rename(columns={'close': 'EURUSD'})

# Merge on time
merged_symbols = pd.merge(gold, eur, left_index=True, right_index=True, how='inner')

# Plot correlation
merged_symbols.plot(figsize=(14,6), title='GOLD vs EURUSD - Merged')

Which merge do you want to build?
1. Same symbol, different timeframes (M1 + H1) - for trend filter
2. Different symbols together - for correlation
3. Merge MT5 data from a CSV file + live MT5

Tell me which one and your symbol, I'll give you the exact code for it.

Respondido

1
Desenvolvedor 1
Classificação
(64)
Projetos
145
46%
Arbitragem
21
38% / 24%
Expirado
32
22%
Livre
2
Desenvolvedor 2
Classificação
(19)
Projetos
22
18%
Arbitragem
9
33% / 44%
Expirado
3
14%
Trabalhando
Publicou: 2 códigos
3
Desenvolvedor 3
Classificação
(23)
Projetos
34
53%
Arbitragem
1
100% / 0%
Expirado
1
3%
Livre
4
Desenvolvedor 4
Classificação
(1)
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
5
Desenvolvedor 5
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Trabalhando
6
Desenvolvedor 6
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
7
Desenvolvedor 7
Classificação
(5)
Projetos
7
86%
Arbitragem
0
Expirado
0
Livre
Publicou: 4 códigos
8
Desenvolvedor 8
Classificação
(1)
Projetos
1
100%
Arbitragem
0
Expirado
0
Livre
9
Desenvolvedor 9
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
10
Desenvolvedor 10
Classificação
(2)
Projetos
3
33%
Arbitragem
0
Expirado
2
67%
Livre
11
Desenvolvedor 11
Classificação
(1)
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 4 códigos
12
Desenvolvedor 12
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
13
Desenvolvedor 13
Classificação
(49)
Projetos
74
18%
Arbitragem
30
17% / 53%
Expirado
31
42%
Livre
14
Desenvolvedor 14
Classificação
(29)
Projetos
36
39%
Arbitragem
0
Expirado
2
6%
Livre
15
Desenvolvedor 15
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
16
Desenvolvedor 16
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
17
Desenvolvedor 17
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
18
Desenvolvedor 18
Classificação
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 11 códigos
19
Desenvolvedor 19
Classificação
(24)
Projetos
35
40%
Arbitragem
9
22% / 33%
Expirado
5
14%
Carregado
Publicou: 8 artigos, 35 códigos
Pedidos semelhantes
Metafix 50 - 200 USD
Here is a professional specification you can send directly to your developer. # Project Requirements Specification: MetaTrader 5 Trading Robot Development ### 1. Project Overview I want to develop an automated Forex trading robot (Expert Advisor) for MetaTrader 5 (MT5). The robot should analyse the financial markets, identify trading opportunities, and execute trades automatically based on predefined strategies. ###
Forex Hunter MT5 30 - 250 USD
ثبت طلبك في مواصفات البوت الثاني كذا: الجودة والأمان أهم من السعر، وما يدخل إلا إذا الفرصة قوية، مع حماية عند الخسائر وانقطاع الاتصال وارتفاع السبريد، وتشغيل مستمر على سيرفر، مع اختبارات إلزامية قبل أي تشغيل حقيقي. بهذه الصيغة يصير يشتغل وأنت مرتاح بالِك، لكنه يوقف تلقائيًا وقت عطلة السوق أو أي خلل. بس أكون واضح معك: ما في بوت يضمن عدم الخسارة، خصوصًا بالمضاربات السريعة، هدفنا نقلل المخاطر ونمنع الخسائر غير المنضبطة
SMC Bot Creation 350 - 550 USD
Hello, I am interested in developing a professional MT5 Expert Advisor similar in functionality and technical sophistication to your reference product, Institutional SMC Robot: https://www.mql5.com/en/market/product/187011 I want to develop my own independent EA based on advanced Smart Money Concepts (SMC), with a strong focus on institutional price action, liquidity and market structure. The key functionalities I
PROJECT: BYBIT PUMP & DUMP EARLY DETECTION ENGINE Fixed Budget: USD $1,000 – Complete Project I am looking for an experienced quantitative trading developer to design, develop, validate and deliver a professional standalone Python 3.12 module for detecting early pump and dump movements on Bybit USDT perpetual futures. IMPORTANT: This is NOT an MT4/MT5 indicator, Expert Advisor or a request to build a complete trading
Hello, I am an independent developer selling an Expert Advisor (EA) on the MQL5 Market. I am looking for an experienced Forex affiliate marketing company or professional marketer to promote my existing MT5 trading robot to customers worldwide. My proposed partnership offers a 35% commission per verified sale, with the possibility of a long-term collaboration. I would like to know: Do you promote third-party MT5

Informações sobre o projeto

Orçamento
30+ USD

Cliente

Pedidos postados1
Número de arbitragens0