指定

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.

応答済み

1
開発者 1
評価
(64)
プロジェクト
145
46%
仲裁
21
38% / 24%
期限切れ
32
22%
暇
2
開発者 2
評価
(19)
プロジェクト
22
18%
仲裁
9
33% / 44%
期限切れ
3
14%
仕事中
パブリッシュした人: 2 codes
3
開発者 3
評価
(23)
プロジェクト
34
53%
仲裁
1
100% / 0%
期限切れ
1
3%
暇
4
開発者 4
評価
(1)
プロジェクト
1
0%
仲裁
0
期限切れ
0
暇
5
開発者 5
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
仕事中
6
開発者 6
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
7
開発者 7
評価
(5)
プロジェクト
7
86%
仲裁
0
期限切れ
0
暇
パブリッシュした人: 4 codes
8
開発者 8
評価
(1)
プロジェクト
1
100%
仲裁
0
期限切れ
0
暇
9
開発者 9
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
10
開発者 10
評価
(2)
プロジェクト
3
33%
仲裁
0
期限切れ
2
67%
暇
11
開発者 11
評価
(1)
プロジェクト
1
0%
仲裁
0
期限切れ
0
暇
パブリッシュした人: 4 codes
12
開発者 12
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
13
開発者 13
評価
(49)
プロジェクト
74
18%
仲裁
30
17% / 53%
期限切れ
31
42%
暇
14
開発者 14
評価
(29)
プロジェクト
36
39%
仲裁
0
期限切れ
2
6%
暇
15
開発者 15
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
16
開発者 16
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
17
開発者 17
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
18
開発者 18
評価
プロジェクト
1
0%
仲裁
0
期限切れ
0
暇
パブリッシュした人: 11 codes
19
開発者 19
評価
(24)
プロジェクト
35
40%
仲裁
9
22% / 33%
期限切れ
5
14%
取り込み中
パブリッシュした人: 8 articles, 35 codes
類似した注文
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
MarketMind Breakout Pro XAUUSD H1 — Donchian Breakout EA Project type: Personal EA development and backtesting Platform: MetaTrader 5 Instrument: XAUUSD Timeframe: H1 Strategy: Donchian Channel breakout with EMA 200 Project overview This project evaluates a Donchian breakout trading strategy for XAUUSD on the H1 timeframe. The system uses channel-based breakout conditions and an EMA 200 trend filter. Historical

プロジェクト情報

予算
30+ USD

依頼者

出された注文1
裁定取引数0