algorembrant commited on
Commit
6164f9e
·
verified ·
1 Parent(s): 63dd019

Upload 5 files

Browse files
Files changed (6) hide show
  1. .gitattributes +2 -0
  2. RDBS_paper.tex +42 -0
  3. rdbs_indicator.py +92 -0
  4. zoom_x1.png +3 -0
  5. zoom_x2.png +3 -0
  6. zoom_x3.png +0 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ zoom_x1.png filter=lfs diff=lfs merge=lfs -text
37
+ zoom_x2.png filter=lfs diff=lfs merge=lfs -text
RDBS_paper.tex ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ \documentclass[journal]{IEEEtran}
2
+ \usepackage{amsmath,amsfonts}
3
+ \usepackage{graphicx}
4
+
5
+ \begin{document}
6
+
7
+ \title{The Range Divided by Spread (RDBS) Indicator: A Microstructural Approach to Volatility and Liquidity}
8
+
9
+ \author{ConQ Research Team \\
10
+ Continual Quasars}
11
+
12
+ \markboth{April 17, 2026}{}
13
+
14
+ \maketitle
15
+
16
+ \begin{abstract}
17
+ This paper introduces the Range Divided by Spread (RDBS) indicator, an unwindowed metric designed to capture the instantaneous relationship between price volatility and market liquidity. By dividing the intra-bar price range by the tick spread, RDBS provides real-time insights into market microstructure anomalies.
18
+ \end{abstract}
19
+
20
+ \section{Introduction}
21
+ \IEEEPARstart{I}{n} quantitative finance, understanding the relationship between the magnitude of price movements and the cost of executing trades is critical. Traditional indicators often employ sliding windows, which introduce lag. The RDBS indicator mitigates this lag by evaluating conditions on a per-bar basis, operating entirely without a window size.
22
+
23
+ \section{Methodology}
24
+ The RDBS indicator is defined for any given timeframe without a lookback window. For a given time period $t$, it is calculated as:
25
+ \begin{equation}
26
+ \text{RDBSin}_t = \frac{\text{High}_t - \text{Low}_t}{\text{Spread}_t}
27
+ \end{equation}
28
+ where the numerator denotes the absolute price range of the individual bar and the denominator represents the spread.
29
+
30
+ \section{Implementation and Visualization}
31
+ The dataset analyzed comprises XAUUSD M3 (3-minute) data. Visualizing the RDBS alongside an OHLC candlestick chart identifies structural breaks. Time gaps in the sequential data are algorithmically identified and visually highlighted (red, 10\% opacity) to prevent false continuity assumptions.
32
+
33
+ \begin{figure}[htbp]
34
+ \centerline{\includegraphics[width=\columnwidth]{rdbs_plot_placeholder.png}}
35
+ \caption{XAUUSD M3 OHLC Candlestick chart overlaid with time gap identifications and the RDBSin indicator.}
36
+ \label{fig:rdbs_plot}
37
+ \end{figure}
38
+
39
+ \section{Results and Conclusion}
40
+ By isolating the ratio of range to spread, RDBSin effectively filters out noise during low-liquidity periods. It offers a granular, lag-free perspective on market dynamics. The indicator serves as a robust metric for both microstructural analysis and real-time algorithmic strategy deployment.
41
+
42
+ \end{document}
rdbs_indicator.py ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import plotly.graph_objects as go
3
+ from plotly.subplots import make_subplots
4
+ import os
5
+
6
+ # --- 1. File Selection ---
7
+ file_name = 'XAUUSDc_M3_data.csv'
8
+
9
+ def process_and_plot_rdbs(csv_file_path):
10
+ if not os.path.exists(csv_file_path):
11
+ print(f"Error: {csv_file_path} not found.")
12
+ return
13
+
14
+ # Load and clean headers
15
+ df = pd.read_csv(csv_file_path, skipinitialspace=True)
16
+ df.columns = df.columns.str.strip().str.replace('\ufeff', '')
17
+
18
+ # Parse time and sort
19
+ df['time'] = pd.to_datetime(df['time'], errors='coerce')
20
+ df.dropna(subset=['time'], inplace=True)
21
+ df.sort_values('time', inplace=True)
22
+ df.reset_index(drop=True, inplace=True)
23
+
24
+ # Calculate Indicator: RDBSin = individual range / spread
25
+ # RDBSin_value calculation
26
+ df['range'] = df['high'] - df['low']
27
+ df['RDBSin'] = df['range'] / df['spread']
28
+
29
+ # Identify time gaps (M3 = 3 minutes)
30
+ expected_diff = pd.Timedelta(minutes=3)
31
+ df['TimeDiff'] = df['time'].diff()
32
+ gaps = df[df['TimeDiff'] > expected_diff]
33
+
34
+ # Create Subplots
35
+ fig = make_subplots(
36
+ rows=2, cols=1,
37
+ shared_xaxes=True,
38
+ vertical_spacing=0.05,
39
+ row_heights=[0.7, 0.3]
40
+ )
41
+
42
+ # Top Pane: OHLC Candlestick
43
+ fig.add_trace(
44
+ go.Candlestick(
45
+ x=df['time'],
46
+ open=df['open'],
47
+ high=df['high'],
48
+ low=df['low'],
49
+ close=df['close'],
50
+ name='XAUUSD OHLC'
51
+ ),
52
+ row=1, col=1
53
+ )
54
+
55
+ # Bottom Pane: RDBSin Indicator
56
+ fig.add_trace(
57
+ go.Scatter(
58
+ x=df['time'],
59
+ y=df['RDBSin'],
60
+ mode='lines',
61
+ name='RDBSin',
62
+ line=dict(color='blue', width=1.5)
63
+ ),
64
+ row=2, col=1
65
+ )
66
+
67
+ # Visualizing Gaps: Red with 10% opacity
68
+ for idx, row in gaps.iterrows():
69
+ start_time = df['time'].iloc[idx-1]
70
+ end_time = row['time']
71
+ fig.add_vrect(
72
+ x0=start_time, x1=end_time,
73
+ fillcolor="red", opacity=0.1,
74
+ line_width=0, row="all", col=1
75
+ )
76
+
77
+ # Formatting
78
+ fig.update_layout(
79
+ template="plotly_white",
80
+ title="XAUUSD M3: RDBS Indicator Analysis",
81
+ xaxis_rangeslider_visible=False,
82
+ height=900,
83
+ showlegend=True
84
+ )
85
+
86
+ fig.update_yaxes(title_text="Price", row=1, col=1)
87
+ fig.update_yaxes(title_text="RDBSin Value", row=2, col=1)
88
+
89
+ fig.show(renderer="colab")
90
+
91
+ # Execute
92
+ process_and_plot_rdbs(file_name)
zoom_x1.png ADDED

Git LFS Details

  • SHA256: ec98f1fbf3bb0557d4bc9bff71210027248d2eeefb5a935c57b9b97416a919a4
  • Pointer size: 131 Bytes
  • Size of remote file: 158 kB
zoom_x2.png ADDED

Git LFS Details

  • SHA256: 021ba6170960580a987b37eb8850c8d42d224a55a35dd4873863bf51c391e34c
  • Pointer size: 131 Bytes
  • Size of remote file: 147 kB
zoom_x3.png ADDED