作者goodddog (domiante)
看板Trading
標題[問題] HTS程式碼錯誤求教
時間Sun Mar 22 23:53:23 2015
出錯的程式碼:
if marketposition=0 and RSI(C,10)[1]<30 then
print(Date,time,RSI(c,10),RSI(c,10)[1])
end if
顯示出來的RSI(c,10)值正確, 但RSI(c,10)[1]值卻有一堆都是0
圖表上是10000根5分鐘K棒...此錯誤不知要如何改正?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 106.104.41.24
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Trading/M.1427039606.A.07E.html
1F:→ are2: 試試RSI(c[1],10) 03/24 00:56
2F:→ goodddog: 還是錯誤... 03/25 12:41
3F:→ shyart: 有試過用 variable AA 接 RSI(c,10), 然後用 AA[1] 嗎? 03/30 15:32
4F:→ goodddog: 試過,還是一樣 04/01 11:37
5F:→ goodddog: print那一行若放在if判斷式以外顯示結果就正常 04/01 11:38
6F:→ shyart: 好怪... 所以同一個 print 在 if 外 跟 if 內是不同的 04/07 07:58
7F:→ shyart: 這好難想像喔, 不過我個人的習慣會在print 中 加marker 04/07 08:00
8F:→ shyart: 如"before if""in if""after if" 的說明確定 print的位置 04/07 08:02
9F:→ shyart: 可以試試看 如果還是一樣的結果 那就這問題就難找一點了 04/07 08:04