![](/img/trans.png)
[英]ArrayFormula of Average on Infinite Truly Dynamic Range in Google Sheets
[英]Average True Range - Google Sheets
我從 Google Doc 幫助論壇復制了以下關於如何使用 Google 表格計算 ATR 的公式。 該公式適用於低於 20 的天數,對於高於 20 的天數,它返回以下錯誤:
函數 ARRAY_ROW 參數 2 的行大小不匹配。 預期:22。實際:21。
你能幫我解決這個錯誤嗎? 交易已將我吸引到 google 表格和 Excel 中,目前以下內容超出了我的技能范圍,我仍在使用 IF 語句。
論壇鏈接: https : //productforums.google.com/forum/#!topic/ docs/ gENldwEI040;context-place= forum/ docs
$B1 - 代碼單元
40 - 期間(天)
=average(ARRAYFORMULA(query(query(transpose(abs(query({query({Googlefinance($B1,"High",today(),today()-(40)),Googlefinance($B1,"low",today(),today()-(40+6))},"select Col1,Col2,Col4 order by Col1 desc limit "&40&" "),query(Googlefinance($B1,"close",today(),today()- (40+6)),"select Col2 order by Col1 desc limit "&40&" offset 1 label Col2 'closeyest' ")}, "select Col2-Col3, Col2-Col4, Col3-Col4"))), "select max(Col"&join(",max(Col",row(indirect("A1:A"&40))&")")))))
這是工作
=average(ARRAYFORMULA(query(query(transpose(abs(query({query({Googlefinance($B1,"High",today()-(100),today()),
Googlefinance($B1,"low",today()-(100),today())},
"select Col1,Col2,Col4 order by Col1 desc limit "&40&" "), query(Googlefinance($B1,"close",today()-(100),today()),
"select Col2 order by Col1 desc limit "&40&" offset 1 label Col2 'closeyest' ")},
"select Col2-Col3, Col2-Col4, Col3-Col4"))),
"select max(Col"&join(",
max(Col",row(indirect("A1:A"&40))&")")))))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.