Upload 6 files
Browse files- LICENSE +21 -0
- README.md +43 -0
- STRUCTURE.md +10 -0
- TECHSTACK.md +11 -0
- hmr_periods.csv +14 -0
- hmr_periods_visuakizer.py +84 -0
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 remb
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HMRZ-framework
|
| 2 |
+
A simple High Margin Requirement Zone framework to visualize limited HMR data from Exness Broker
|
| 3 |
+
|
| 4 |
+
### The poblem im trying to address
|
| 5 |
+
HMR Zones data from Exness Broker is not free and is limited. Therefore, users must be quick at interpreting this kind of data. For those who have AI agents, you are lucky cuz you could just train it using this repo to construct a related backend-frontend framework using Python or any language. Enjoy
|
| 6 |
+
|
| 7 |
+
### Sample Data
|
| 8 |
+
<table style="width: 100%; border-collapse: collapse;">
|
| 9 |
+
<tr>
|
| 10 |
+
<td style="width: 50%; padding: 5px; text-align: center;">
|
| 11 |
+
<img src="https://github.com/user-attachments/assets/932c7682-a6a9-4232-a007-94c18632196e" alt="Image 1" style="width: 50%;">
|
| 12 |
+
</td>
|
| 13 |
+
<td style="width: 50%; padding: 5px; text-align: center;">
|
| 14 |
+
<img src="https://github.com/user-attachments/assets/8d7c37e8-90af-4347-a76d-4f6464186091" alt="Image 2" style="width: 100%;">
|
| 15 |
+
</td>
|
| 16 |
+
</tr>
|
| 17 |
+
</table>
|
| 18 |
+
|
| 19 |
+
### Sample CSV framework
|
| 20 |
+
```csv
|
| 21 |
+
Start_Datetime,End_Datetime,Max_Leverage,Events
|
| 22 |
+
2026-02-25 05:28,2026-02-25 07:10,1000,
|
| 23 |
+
2026-02-25 14:45,2026-02-25 15:01,200,
|
| 24 |
+
2026-02-25 17:45,2026-02-25 18:01,200,
|
| 25 |
+
2026-02-25 23:15,2026-02-25 23:31,200,
|
| 26 |
+
2026-02-26 05:28,2026-02-26 07:10,1000,
|
| 27 |
+
2026-02-26 17:45,2026-02-26 18:01,200,
|
| 28 |
+
2026-02-26 21:15,2026-02-26 21:31,200,
|
| 29 |
+
2026-02-27 05:28,2026-02-27 07:10,1000,
|
| 30 |
+
2026-02-27 15:30,2026-02-27 16:01,200,
|
| 31 |
+
2026-02-27 16:40,2026-02-27 17:01,200,
|
| 32 |
+
2026-02-27 20:45,2026-02-27 21:01,200,
|
| 33 |
+
2026-02-27 21:15,2026-02-27 21:31,200,PPI MoM | PPI YoY | Core PPI MoM
|
| 34 |
+
2026-02-27 22:30,2026-02-27 23:01,200,Chicago PMI | Construction Spending MoM
|
| 35 |
+
|
| 36 |
+
```
|
| 37 |
+
### Sample output visualization
|
| 38 |
+
|
| 39 |
+
<img width="1186" height="578" alt="image" src="https://github.com/user-attachments/assets/8d7c37e8-90af-4347-a76d-4f6464186091" />
|
| 40 |
+
|
| 41 |
+
### How to use Python?
|
| 42 |
+
|
| 43 |
+
Learn your basics somewhere :C
|
STRUCTURE.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Project Structure
|
| 2 |
+
|
| 3 |
+
```text
|
| 4 |
+
HMRZ-framework/
|
| 5 |
+
├── hmr_periods.csv
|
| 6 |
+
├── hmr_periods_visuakizer.py
|
| 7 |
+
├── LICENSE
|
| 8 |
+
├── README.md
|
| 9 |
+
└── TECHSTACK.md
|
| 10 |
+
```
|
TECHSTACK.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Techstack
|
| 2 |
+
|
| 3 |
+
Audit of **HMRZ-framework** project files (excluding environment and cache):
|
| 4 |
+
|
| 5 |
+
| File Type | Count | Size (KB) |
|
| 6 |
+
| :--- | :--- | :--- |
|
| 7 |
+
| (no extension) | 1 | 1.1 |
|
| 8 |
+
| CSV (.csv) | 1 | 0.6 |
|
| 9 |
+
| Markdown (.md) | 1 | 1.8 |
|
| 10 |
+
| Python (.py) | 1 | 3.3 |
|
| 11 |
+
| **Total** | **4** | **6.9** |
|
hmr_periods.csv
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Start_Datetime,End_Datetime,Max_Leverage,Events
|
| 2 |
+
2026-02-25 05:28,2026-02-25 07:10,1000,
|
| 3 |
+
2026-02-25 14:45,2026-02-25 15:01,200,
|
| 4 |
+
2026-02-25 17:45,2026-02-25 18:01,200,
|
| 5 |
+
2026-02-25 23:15,2026-02-25 23:31,200,
|
| 6 |
+
2026-02-26 05:28,2026-02-26 07:10,1000,
|
| 7 |
+
2026-02-26 17:45,2026-02-26 18:01,200,
|
| 8 |
+
2026-02-26 21:15,2026-02-26 21:31,200,
|
| 9 |
+
2026-02-27 05:28,2026-02-27 07:10,1000,
|
| 10 |
+
2026-02-27 15:30,2026-02-27 16:01,200,
|
| 11 |
+
2026-02-27 16:40,2026-02-27 17:01,200,
|
| 12 |
+
2026-02-27 20:45,2026-02-27 21:01,200,
|
| 13 |
+
2026-02-27 21:15,2026-02-27 21:31,200,PPI MoM | PPI YoY | Core PPI MoM
|
| 14 |
+
2026-02-27 22:30,2026-02-27 23:01,200,Chicago PMI | Construction Spending MoM
|
hmr_periods_visuakizer.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import matplotlib.pyplot as plt
|
| 3 |
+
import matplotlib.dates as mdates
|
| 4 |
+
import numpy as np
|
| 5 |
+
import io
|
| 6 |
+
|
| 7 |
+
# 1. The CSV Data (embedded so you can run this immediately)
|
| 8 |
+
csv_data = """Start_Datetime,End_Datetime,Max_Leverage,Events
|
| 9 |
+
2026-02-25 05:28,2026-02-25 07:10,1000,
|
| 10 |
+
2026-02-25 14:45,2026-02-25 15:01,200,
|
| 11 |
+
2026-02-25 17:45,2026-02-25 18:01,200,
|
| 12 |
+
2026-02-25 23:15,2026-02-25 23:31,200,
|
| 13 |
+
2026-02-26 05:28,2026-02-26 07:10,1000,
|
| 14 |
+
2026-02-26 17:45,2026-02-26 18:01,200,
|
| 15 |
+
2026-02-26 21:15,2026-02-26 21:31,200,
|
| 16 |
+
2026-02-27 05:28,2026-02-27 07:10,1000,
|
| 17 |
+
2026-02-27 15:30,2026-02-27 16:01,200,
|
| 18 |
+
2026-02-27 16:40,2026-02-27 17:01,200,
|
| 19 |
+
2026-02-27 20:45,2026-02-27 21:01,200,
|
| 20 |
+
2026-02-27 21:15,2026-02-27 21:31,200,PPI MoM | PPI YoY | Core PPI MoM
|
| 21 |
+
2026-02-27 22:30,2026-02-27 23:01,200,Chicago PMI | Construction Spending MoM"""
|
| 22 |
+
|
| 23 |
+
# Load and format dates
|
| 24 |
+
df_hmr = pd.read_csv(io.StringIO(csv_data))
|
| 25 |
+
df_hmr['Start_Datetime'] = pd.to_datetime(df_hmr['Start_Datetime'])
|
| 26 |
+
df_hmr['End_Datetime'] = pd.to_datetime(df_hmr['End_Datetime'])
|
| 27 |
+
|
| 28 |
+
# 2. Generate Mock Price Data (to simulate XAU/USD movements)
|
| 29 |
+
date_rng = pd.date_range(start='2026-02-25 00:00', end='2026-02-28 00:00', freq='5min')
|
| 30 |
+
np.random.seed(42) # For reproducibility
|
| 31 |
+
# Simulate a gold chart starting around $2,030
|
| 32 |
+
price_data = 2030 + np.cumsum(np.random.randn(len(date_rng)) * 0.4)
|
| 33 |
+
df_price = pd.DataFrame({'Datetime': date_rng, 'Price': price_data})
|
| 34 |
+
|
| 35 |
+
# 3. Setting up the Plot
|
| 36 |
+
fig, ax = plt.subplots(figsize=(14, 7))
|
| 37 |
+
|
| 38 |
+
# Plot the mock XAU/USD line
|
| 39 |
+
ax.plot(df_price['Datetime'], df_price['Price'], color='#DAA520', label='XAU/USD (Mock Price)', linewidth=1.5)
|
| 40 |
+
|
| 41 |
+
# 4. Loop through the data to draw HMR Zones
|
| 42 |
+
for index, row in df_hmr.iterrows():
|
| 43 |
+
start = row['Start_Datetime']
|
| 44 |
+
end = row['End_Datetime']
|
| 45 |
+
leverage = row['Max_Leverage']
|
| 46 |
+
events = row['Events']
|
| 47 |
+
|
| 48 |
+
# Conditional coloring based on leverage restrictions
|
| 49 |
+
if leverage == 200:
|
| 50 |
+
zone_color = 'red'
|
| 51 |
+
alpha_val = 0.2
|
| 52 |
+
label_text = '1:200 HMR (Strict)' if index == 1 else "" # Prevent duplicate legend entries
|
| 53 |
+
else:
|
| 54 |
+
zone_color = 'blue'
|
| 55 |
+
alpha_val = 0.1
|
| 56 |
+
label_text = '1:1000 Margin' if index == 0 else ""
|
| 57 |
+
|
| 58 |
+
# axvspan creates the shaded vertical zones
|
| 59 |
+
ax.axvspan(start, end, color=zone_color, alpha=alpha_val, label=label_text)
|
| 60 |
+
|
| 61 |
+
# Add text annotation if there's an economic event tied to this period
|
| 62 |
+
if pd.notna(events):
|
| 63 |
+
# Truncate text to fit nicely and plot near the top of the chart
|
| 64 |
+
short_event = events.split('|')[0].strip() + '...'
|
| 65 |
+
ax.text(start, ax.get_ylim()[1] * 0.998, short_event,
|
| 66 |
+
rotation=90, verticalalignment='top', fontsize=9, color='darkred', weight='bold')
|
| 67 |
+
|
| 68 |
+
# 5. Formatting the Chart
|
| 69 |
+
ax.set_title('XAU/USD Algorithmic View with HMR Zones', fontsize=16, fontweight='bold')
|
| 70 |
+
ax.set_ylabel('Price (USD)', fontsize=12)
|
| 71 |
+
ax.set_xlabel('Date & Time', fontsize=12)
|
| 72 |
+
|
| 73 |
+
# Format the X-axis to cleanly display dates and hours
|
| 74 |
+
ax.xaxis.set_major_formatter(mdates.DateFormatter('%b %d\n%H:%M'))
|
| 75 |
+
plt.xticks(rotation=0)
|
| 76 |
+
|
| 77 |
+
# Clean up the legend (remove empty label artifacts)
|
| 78 |
+
handles, labels = ax.get_legend_handles_labels()
|
| 79 |
+
by_label = dict(zip(labels, handles))
|
| 80 |
+
ax.legend(by_label.values(), by_label.keys(), loc='upper left')
|
| 81 |
+
|
| 82 |
+
plt.grid(True, linestyle='--', alpha=0.5)
|
| 83 |
+
plt.tight_layout()
|
| 84 |
+
plt.show()
|