Questions tagged [ohlc]
84 questions
0
votes
1 answer
Pandas ohlc resampling: Getting 00:00:00 time and incorrect date when resampling tick data
This is what I'm using to add the data to my tick data frame:
dfTick = {
'time': data['time'],
'mid': data['mid'],
}
tick = pd.DataFrame(dfTick).set_index('time')
tick.index = pd.DatetimeIndex(tick.index)
current_candle =…

niteling
- 19
- 4
0
votes
1 answer
how to change color of candlestick based on ajax data in amcharts 4?
I want to change color of some candlestick on charts based on colors that come as a data from backend, Because I do some calculation in backend, and find some candles different than others. so how can I do that?
here is a code in codepen that…

Ali
- 602
- 6
- 18
0
votes
1 answer
Can i use crosshairs with OHLC/candlestick charts using ChartJS
I have installed the crosshair plugin and am using chartJS 3.0 to take advantage of the candlestick charts but the crosshair does not appear. are these things compatible together? my data appear no problem but the crosshair never appears. how do i…

Jared Gibb
- 47
- 5
0
votes
1 answer
Copy a row to multiple rows based on value
I cannot figure out a problem on stocks data. We have a dataframe with high, low and dates data. I want to make two new columns with max from 24_H and min from 24_L of whole week (min and max of whole week from days of week and copy it to every…

tnkr
- 5
- 2
0
votes
1 answer
Calculating a different timeframe from given OHLC Data in Google Sheets ( Query String ?)
I'm constantly fetching OHLC Data and trying to convert it into a different timeframe while staying dynamic. While calculating it manually is not a problem, it won´t stay dynamic this way with updating data. I've tried to query it out, but I'm…

Cyanmar
- 3
- 2
0
votes
1 answer
How to change pandas resampling on a UTC OHLC Time Series based on Daylight Saving
I have a 1-minute OHLC CSV file with date using UTC
df = pd.read_csv('...', usecols=['Date','Open','High','Low','Close'],
index_col=['Date'], parse_dates=['Date'])
I am resampling it using:
ohlc_head = {'Open':'first', 'High':'max',…

Adam
- 3,872
- 6
- 36
- 66
0
votes
1 answer
How can I create range trading bars in PostgreSQL?
I'm trying to create a trading bar by grouping data every X range the price has moved. The data is from tick and every tick has a timestamp and a price vaue.
The data set looks like this:
date price
"2020-02-03 02:00:00.207" …

Pedro Pablo Severin Honorato
- 377
- 3
- 16
0
votes
1 answer
how can fix the error that open_price equal to close_price when resample data by clickhouse time function?
query_sql = f"""
WITH
toDateTime('{start.date()} 21:00:00') AS StartTimestamp,
toDateTime('{end_date} 15:00:00') AS EndTimestamp
SELECT
local_symbol,
…

somewheve
- 125
- 6
0
votes
1 answer
How do i convert m1 OHLC data to m15 or any timeframe OHLC in pandas?
I'm trying to convert M1 OHLC data to M15 using the pandas resample function but not getting anywhere, this is what I've got:
df = pd.read_csv("EURUSD.csv")
df = df.set_index("DatetimeIndex")
print("\tDone!")
df = df.resample('1H').agg({'Open':…

Hamish Anderson
- 3
- 1
0
votes
0 answers
Convert 5m OHLC data to 15m, Python
I have a csv file with 5m ohlc data, it looks like this:
T,O,H,L,C
2018-01-01 00:00:00+00:00, 13838.5, 13961, 13838, 13873
2018-01-01 00:05:00+00:00, 13873, 13920, 13800, 13800
2018-01-01 00:10:00+00:00, 13800, 13800.5, 13675, 13771.5
2018-01-01…

Pavel
- 3
- 4
0
votes
0 answers
Pandas Dataframe Time Series: Resampling with non 00:00 start times and missing days?
My data: Data on a ticker at 3 min intervals. date/open/high/low/close
Goal: Resample to daily
I was able to figure out how to resample to daily using
df_spy_D= df_spy_3min.resample('D').agg({'open':'first',
…

tigertiger
- 73
- 1
- 9
0
votes
1 answer
What are efficient ways to clean financial Data (Open High Low Close)?
I got multiple Timeseries Dataframes which are like different assets.
The problem is that there are holes in the data (which are not there on the other assets).
Question: What are some qualitative ways to clean the data so that i can fill the…

Benoid
- 209
- 1
- 4
- 11
0
votes
1 answer
A string doesn't have the attribute .loc
I have different dataframes that follow the example: 'AAPLdf, AMZNdf, GOOGLdf, ...' etc
I just want to be able to enter the ticker as an input so that I don't have write the same code a million times.
import matplotlib.pyplot as plt
from mpl_finance…

Fares Van Lierde
- 15
- 3
0
votes
1 answer
pandas OHLC plot only high values with time
I have a text file with the following real-time data.
1,16:20:35
2,16:20:40
3,16:21:41
4,16:21:50
5,16:21:52
6,16:22:20
7,16:22:42
8,16:23:44
I want to plot only the high values against time. The following is what I tried.
import pandas as…

Totura
- 19
- 1
- 7
0
votes
1 answer
Selective Groupby-Aggregate using Python Pandas DataFrame
How can we aggregate all the rows after 4pm of one day till before 10am of the next day in the DataFrame by performing OHLC operations on the grouped rows?
This will convert the original DataFrame from
symbol datetime open high low …

Nyxynyx
- 61,411
- 155
- 482
- 830