停損停利訊號程式碼
保留字介紹
StopLossAmount 代表總損失的金額
Commission_B 代表手續費
PointValue 每1點的價值,例如台指期1點為200元
EntryPrice 特定部位的進場價格
Orderprice 表示每xxxxx元相當於幾點
以台指期為例,pointvalue=200,假設多單停利利潤設定為10000元所以orderprice=50,è200*50=10000
停損訊號程式碼
Parameter DollarRisk(10000) Variables StopLossAmount(0), OrderPrice(0)
If MarketPosition = 1 Then StopLossAmount = DollarRisk + Commission_B OrderPrice = Entryprice(0) - (StopLossAmount PointValue) ExitLong (停損L) this Bar at OrderPrice Stop End if
If MarketPosition = -1 Then StopLossAmount = DollarRisk + Commission_S OrderPrice = EntryPrice(0) + (StopLossAmount PointValue) ExitShort (停損S) this Bar at OrderPrice Stop End if
If MarketPosition = 1 Then StopLossAmount = DollarRisk + Commission_B OrderPrice = Entryprice(0) - (StopLossAmount PointValue) ExitLong (停損L) this Bar at OrderPrice Stop End if
停利訊號程式碼 Parameter profit(10000) Variables OrderPrice(0)
If MarketPosition = 1 Then OrderPrice = Entryprice(0) + (profit PointValue) ExitLong (停利L) this Bar OrderPrice limit End if
If MarketPosition = -1 Then OrderPrice = EntryPrice(0) - (profit PointValue) ExitShort (停利S) this Bar OrderPrice limit End if
If MarketPosition = 1 Then OrderPrice = Entryprice(0) + (profit PointValue) ExitLong (停利L) this Bar OrderPrice limit End if
|
- Jun 30 Wed 2010 11:42
●停損停利訊號程式碼
全站熱搜
留言列表
發表留言