エクセル株式トレード応用編(発注用の共通関数)


プログラムソース

””””””””””””””””””””””””””””””””
‘m01ボタン制御(標準モジュール)
””””””””””””””””””””””””””””””””

””””””””””””””””””””””””””””””””
‘ 新規・買い
””””””””””””””””””””””””””””””””
Sub s01新規買い()
Call sc新規発注(wc新規, wc買い, Cells(3, 5))
End Sub

””””””””””””””””””””””””””””””””
‘ 決済・売り
””””””””””””””””””””””””””””””””
Sub s02決済売り()
Call sc新規発注(wc決済, wc売り, Cells(3, 5))
End Sub

””””””””””””””””””””””””””””””””
‘ 新規・売り
””””””””””””””””””””””””””””””””
Sub s03新規売り()
Call sc新規発注(wc新規, wc売り, Cells(3, 5))
End Sub

””””””””””””””””””””””””””””””””
‘ 決済・買い
””””””””””””””””””””””””””””””””
Sub s04決済買い()
Call sc新規発注(wc決済, wc買い, Cells(3, 5))
End Sub

”ここまで、 m01ボタン制御(標準モジュール)

””””””””””””””””””””””””””””””””
‘m02岡三発注(標準モジュール)
””””””””””””””””””””””””””””””””

”定数
Public Const wcパスワード As String = “testpass” ”パスワード
Public Const wc新規 As String = “1” ”新規
Public Const wc決済 As String = “2” ”決済
Public Const wc買い As String = “3” ”買い
Public Const wc売り As String = “1” ”売り


””””””””””””””””””””””””””””””””
‘ 新規発注(共通関数)
””””””””””””””””””””””””””””””””
Sub sc新規発注(wa新規決済 As String, wa売買 As String, wa枚数 As String)
Dim w発注Id As String ”発注ID
w発注Id = “HA” & Format(Date, “yyyymmdd”) & Format(Time, “hhmmss”)

Call FNEWORDER(“N225mini”, 0, wa新規決済, “A”, “1”, wa売買, 13, 0, wa枚
数, 1, 1, “1”, wcパスワード, w発注Id, “1”, “”, 13, 0)

End Sub


‘ここまで、 m02岡三発注(標準モジュール)