
語法 :
If MarketPosition = 1 Then
StopLossPoint = Amount + Commission_B
Order = Entryprice(0) - (StopLossPoint / PointValue)
ExitLong ("多單停損") NEXT Bar at Order Stop
End if
MarketPosition = 1 (多單 , 空單的話改為負數,0 為無單狀態)
StopLossPoint (停損的金額)
Amount (預設停損的金額)Commission_B (手續費)
ExitLong (多單出場)
PointValue (取決於所點選的視窗,如大台為200,小台則為50)
多單停損的話,將 MarketPosition 改為-1 , ExitLong ("多單停損") 改為ExitShort("空單停損") 即可
蠻基本的一個停損語法,可試試看囉 !
沒有留言:
張貼留言