Plotlyを使ったUSDJPY 2022年のチャートを描くコードを作成した。トレードにはとても使え無さそうだ。
import datetime
import pytz
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import time
import plotly.graph_objects as go
# Importing training data
df = pd.read_csv("USDJPY_Daily_202201030000_202212300000.csv", delimiter="\t").dropna()
df = df.iloc[:,:-2]
df.columns = ["date","open","high","low","close","volume"]
fig = go.Figure(data=[go.Candlestick(x=df['date'],
open=df['open'], high=df['high'],
low=df['low'], close=df['close'],
increasing_line_width = 1,
increasing_line_color = 'red',
increasing_fillcolor = 'red',
decreasing_line_width = 1,
decreasing_line_color = 'blue',
decreasing_fillcolor = 'blue')
])
fig.update_layout(
title = "USDJPY daily OHLC plot in 2022",
yaxis_title = 'USDJPY',
)
fig.show()