Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then MsgBox "[閉じる]ボタンを使用してください" Cancel = True End If End Sub
VBA 時間部分はテキストで指定するけど、日付はNow()から取る
Dim start_date, end_date, yyyymmdd yyyymmdd = Format(Now, "yyyy/mm/dd") start_date = CDate(yyyymmdd + " " + UserForm_RetryInfo.TextBox_Start) end_date = CDate(yyyymmdd + " " + UserForm_RetryInfo.TextBox_End)
ネタ元
MFC 文字列が数値かどうかチェック
// 数値ならTRUE BOOL isNumeric(CString& str) { char* p; strtof(str.GetBuffer(0), &p); return *p == 0; }
pythonで aviからmp4変換(h.264)
pip で OpenCV のインストール必要
qiita.com
pip install opencv-python pip install opencv-contrib-python
openh264のDLLが必要。
#ライブラリのインポート import cv2 #VideoCaptureオブジェクトを取得 cap = cv2.VideoCapture('tmp.avi') #動画のプロパティを取得 width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) fps = cap.get(cv2.CAP_PROP_FPS) #書き出し設定 fourcc = cv2.VideoWriter_fourcc("H","2","6","4") writer = cv2.VideoWriter('tmp.mp4', fourcc, fps, (width, height)) while True: ret, frame = cap.read() writer.write(frame) if not ret: break writer.release() cap.release()
必要なDLLのバージョンは一回実行してみて、出力をみて確認。
ここからDL
github.com
python yfinance でのデータ取得
インストール
$ pip install yfinance --upgrade --no-cache-dir
サンプル
import yfinance as yf #ダウのヒストリカル取得 stock_price = yf.download("^DJI", start="2000-1-3", end="2099-12-31") # CSVで出力 stock_price.to_csv(aOutPath)
ネタ元
datatechlog.com
discipline-and-action.com
pypi.org
pandas-datareader でyahoo financeからデータが抜けない件、
— shinshin (@stkinvest_blog) 2022年12月18日
yfinanceで代替できる。dataframe使っている人はyf.pdr_override()でコード変更の負担を減らしてくれる。
詳しくは公式documentで。https://t.co/javLS3jKNF
pyinstallerでEndUpdateResourceWがなんたらとエラーがでる場合日本語パスが影響してるかも
英字だけのフォルダで実行したら解決した
上場日に初値がつかなかった場合の気配値の上限価格
上場日の初値決定前の気配運用による、上限価格と下限価格
- 気配値の上限価格:公開価格の2.3倍
- 気配値の下限価格:公開価格の0.75倍
上場2日目の初値決定前の気配運用。
- 気配値の上限価格:上場日の最終気配値の2.3倍
- 気配値の下限価格:上場日の最終気配値の0.75倍