Questions tagged [ohlc]

84 questions
1
vote
2 answers

Using Pandas, generate weekly open, high, low, close and simple moving average of Close for each day in historical data

From daily stock OHLC data as under, Date                      Daily Open          Daily High            Daily Low             Daily Close 31-Oct-22            17910.2                 18022.8                 17899.9                …
X Y
  • 23
  • 3
1
vote
0 answers

Customizing OHLC chart interactive controls in Plotly

I am using Plotly OHLC charts with Jupyter Notebook. Currently, Plotly offers some interactive controls on its OHLC charts: While Plotly is doing a good job here, these controls are not what most the trades expect. The lack of standard OHLC…
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
1
vote
2 answers

Converter bid/ask to OHLC formula

I can get bid and ask data from my market data provider but I want to convert this in OHLC values. What is the good calculation using bid/ask? I saw in a post that for a specific period: Open = (first bid + first ask) / 2. High = Highest bid Low =…
Teddol
  • 17
  • 2
1
vote
0 answers

How to resample OHLC data with multiple stocks in index?

I haven't been able to find anything too similar to this I have OHLC data pulled from y-finance for multiple stocks. This results in a multi-index of columns of OHLC data and stock names Python Script ''' import requests import pandas as pd import…
Jon 310
  • 11
  • 2
1
vote
2 answers

How to use pd.DateTime.replace(second=0)?

Given this dataset: ... I want to create open, high and low columns, resampled to the beginning minute of each row. Note that we cannot just simply use .resample() in this case. What I'm looking to end up with is a dataset that looks like…
wildcat89
  • 1,159
  • 16
  • 47
1
vote
1 answer

How do I aggregate open and close values in QuestDB using SAMPLE BY

I'm working on a price data project, trying to store OHLC 1 minute data and then sampling it over various intervals. I decided to try QuestDB for its neat time-series features such as SAMPLE BY but am running into a wall. I want to use SAMPLE BY to…
Maximka
  • 119
  • 10
1
vote
1 answer

OHLC of Multiple Scrips Using Pandas Resample function

I have ticks data of 2 scrips (scrip_names are abc and xyz). Since the ticks data is at a "second" level, I want to convert this to OHLC (Open, High, Low, Close) at 1 Minute level. When the ticks data contains only 1 scrip, I use the following code…
lenmet
  • 33
  • 1
  • 7
1
vote
0 answers

Resampling by group ends up returning Type error

I have a dataframe like this : Symbol Time Open High Low Close Volume LOD 10MA 20MA Sessions 0 AEHR 2021-08-20 09:31:00 5.52 5.52 5.52 5.52 3383 5.52 NaN NaN 1 …
1
vote
1 answer

Fill out dataframe by searching another dataframe by first testing for condition

I am trying to test different sell Simple Moving Average criteria based on the given buy date. I have a database of buy data as follows (df_buy). I want to fill out the NaN values. (FCU = First Close Under) Symbol Time buy_price …
1
vote
1 answer

Get stock Low of Day (LOD) price for incomplete daily bar using minute bar data (multiple stocks, multiple sessions in one df) SettingWithCopyWarning

I have a dataframe of minute data for multiple Stocks, each stock has multiple sessions. See sample below Symbol Time Open High Low Close Volume LOD 2724312 AEHR 2019-09-23 09:31:00 1.42 1.42 1.42 1.42 …
1
vote
1 answer

Resampling of OHLC data

I want to convert 1h OHLC data to xh OHLC data. I am using the resample method like it was proposed in similar threads, but it does not lead to the wanted result. The data: open high low close Volume…
xbrokz
  • 13
  • 3
1
vote
1 answer

How to get OHLC monthly high and low data using tq_transmute from tidyquant package in R

I am new to analyzing time series data and am looking for some help pull the monthly high and low prices from some OHLC data. When I try and aggregate the monthly open, high, low, and close prices, only the values from the last date of each month…
1
vote
1 answer

Is there any good way to perform calculation and assign values on time series data chunks?

I want to perform some calculation on time series data, and copy the output on specific rows, I have tried several things like resampling data to get the values. Below are the codes and outputs that I was trying to get. It would be very helpful to…
1
vote
2 answers

Pandas: find nearest higher high (OHLC)

I'm trying to find the fastest solution to iterate over each row of Open High Low Close data and count out how many rows exist between the current row's high and the next high that’s greater than or equal to the original. Here is a shortened code…
Rudolph
  • 13
  • 4
1
vote
0 answers

Pandas Auto Reverse Resample from Last Timestamp

This issue has been partially addressed elsewhere but I'm having difficulty finding a way to make this work with OHLC financial market data. I want to take 5-minute data and resample it into 4-hour data with the assumption that new data arrives…