作者ywood (黄蜂)
看板Option
标题[问题] hts 停损停利的语法问题
时间Tue Mar 31 11:21:31 2009
我的做法是停损采取绝对点数的停损
但是停利的部分是采用突破高低点的方式
//停损
If MarketPosition = 1 Then
OrderPrice =Entryprice(0)- value3
Exitlong ("XS") next Bar at OrderPrice Stop
End if
If MarketPosition = -1 Then
OrderPrice = EntryPrice(0) + value3
ExitShort ("XB") next Bar at OrderPrice Stop
End if
//停利
If MarketPosition = 1 and value5<=r1 Then
OrderPrice =highest(h,rday)
Exitlong ("XS1") next Bar at OrderPrice limit
End if
If MarketPosition = -1 and value5<=r1 Then
OrderPrice = lowest(l,rday)
ExitShort ("XB1") next Bar at OrderPrice limit
End if
但是不知道为什麽停利的部分好像都会有问题
有时候会停利但是有时候却又没有
不知道有没有人可以帮忙确认一下
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.117.170.203
※ ywood:转录至看板 Trading 03/31 11:29
1F:→ idleidle:阿政那边有1篇,你可以用他的语法先测看看 03/31 11:31
2F:推 dyhsu:最高的h 最低的l 要指前一根的才行 03/31 12:37
3F:推 escirca:回楼上,用next bar不需一定要用前一根资料 03/31 20:58
4F:→ escirca:回原po,看起来没问题,建议你用print资料出来找问题 03/31 20:59
5F:→ escirca:因为你用limit和stop,会不会是点位没碰到? 03/31 21:01
6F:推 dyhsu:highest(h,time) 永远都不会碰到 highest(h,t)[1]才有可能 03/31 22:30
7F:→ utat:我觉得去程式版问比较容易找到答案~"~毕竟这里不懂程式的人 04/01 00:13
8F:→ utat:占比较多~"~ 04/01 00:13