Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 23:59:00 +0000



Post From: Python for Sierra Chart

[2023-01-12 19:33:42]
User726340 - Posts: 30
I run below test.py few times, and i see same close value before and after sampling.


# test.py

df = get_scid_df(scid_file_path, 1024 * 1024)
print(df[["Close"]][-5:])
df_1min = (
df.resample("1Min")
.agg(
{
"Open": "first",
"High": "max",
"Low": "min",
"Close": "last",
"Volume": "sum",
"Trades": "sum",
"BidVolume": "sum",
"AskVolume": "sum",
}
)
.ffill()
)
print(df_1min[["Close"]][-5:])