「自動売買ロボット作成マニュアル」正誤表

訂正

----------------------------------

本文86ページに記載されている、MACDの計算方法に一部誤りがありました。正しくは以下の通りです。

[86ページ]

×
前日のEMA+((前日終値-前日のEMA)×2÷(1+n)


前日のEMA+((当日終値-前日のEMA)×2÷(1+n)

----------------------------------

本文377ページ、380ページに記載されている、監視を実行するマクロのコードに誤りがありました。正しくは以下の通りです。

[377ページ]

×
If a.Cells(ii + 11, 7).Value > a.Cells(ii + 11, 18).Value _
Or a.Cells(ii + 30, 7).Value < a.Cells(ii + 30, 19).Value Then
longexit:


If a.Cells(ii + 11, 7).Value > a.Cells(ii + 11, 18).Value _
Or a.Cells(ii + 11, 7).Value < a.Cells(ii + 11, 19).Value Then
longexit:

-----------------------

[380ページ]

×
If a.Cells(ii + 11, 7).Value < a.Cells(ii + 11, 18).Value _
Or a.Cells(ii + 30, 7).Value > a.Cells(ii + 30, 19).Value Then
shortexit:


If a.Cells(ii + 11, 7).Value < a.Cells(ii + 11, 18).Value _
Or a.Cells(ii + 11, 7).Value > a.Cells(ii + 11, 19).Value Then
shortexit:

----------------------------------

本文197ページの1行目に記載されているコードは

「Public Equity As Long, Contracts As Long, Profit As Long」ではなく
「Public Equity As Double, Contracts As Double, Profit As Double」でした。

Long型で宣言すると、一部の場合においてオーバーフローを起こす可能性があるため、Double型での宣言に変更しました。

----------------------------------

本文84ページの14行以降に記載されている、範囲指定の方法は

「length(1) - 1」ではなく
「length(1) + 1」でした。

また、それ以降の範囲指定方法についても同様です。

----------------------------------

本文91(93)ページの「マル14、15」のコードが
サンプルシートのものと異なります。

○[サンプルにあるコード]

For i = length_temp + 4 To lastrow
 If i >= length(3) + length_temp Then
  Cells(i, 16) = Cells(i, 14) - Cells(i, 15)
  Cells(i, 17) = WorksheetFunction.Average(Range("P" & i, "P" & i - length(3) + 1))
 Else
  Cells(i, 16) = Cells(i, 14) - Cells(i, 15)
 End If
Next

×[本文にあるコード]

For i = length_temp + 4 To lastrow
 If i = length_temp + length_temp + 4 Then
  Cells (i, 16) = Cells (i, 14) - Cells (i, 15)
 ElseIf i >= length(3) + length_temp + 4 Then
  Cells (i, 16) = Cells (i, 14) - Cells (i, 15)
  Cells (i, 17) = WorksheetFunction .Average (Range ("P" & i , "P" & i - length (3) + 1) )
 Else
  Cells(i, 16) = Cells(i, 14) - Cells(i, 15)
 End If
Next

----------------------------------

本文116ページの10~11行目に記載されている内容は
「pDI > 0 かつ mDI > 0」ではなく、
「pDI < 0 かつ mDI < 0」でした。

なお、これによるコードの修正はございません。

----------------------------------

本文197ページ 図表5-4 におけるコードの一部は

「Public s_price(4) as Integer」ではなく、
「Public s_price(4) as Long」でした。

----------------------------------

本文349ページに記載されている、
ストキャスティクスマクロの修正における変更は

「length(1) = input_temp(6)」ではなく
「length(1) = input_temp(4)」でした。

----------------------------------

本文367ページに記載されている、
「Result」シートの書き込み位置の指定は以下の通りです。


If b.Range("B3") = "" Then
endrow = 3
Else
endrow = b.Range("B2").End(xlDown).Row + 1
End If

×
endrow = b.Range("B2").End(xlDown).Row + 1

----------------------------------

本文219、231、241、345、351、359ページに記載されている、売買枚数を算出するためのコードは以下の通りです。


Contracts = WorksheetFunction.RoundDown(((Equity * Risk_Ratio) / (StopLoss)), Unit_Degits)

×
Contracts = WorksheetFunction.RoundDown(((Equity * Risk_Ratio) / (StopLoss * Units)), Unit_Degits)

----------------------------------

サンプルシートでは上記の問題が訂正されています。
詳細に関しましてはそちらをご覧ください。

お詫びして訂正いたします。

 
 

改良

----------------------------------

第5章~第7章において、建玉数を建てるだけの資金残高が不足している場合、強制的に建玉数を「0」としていましたが、これを「資金残高で建てられるだけの枚数」に変更しました。

詳しくは該当箇所をサンプルシートで確認してください。