顯示腳本算式分母為0無法計算,請問該如何修正?

  •   90 
  • 最後發表   獨棟小豪宅  2023 四月 10
獨棟小豪宅 發文於   2023/04/05

value1 = ema(close,5);

value2 = ema(close,10);

value3 = ema(close,20);

value4 = ema(close,60);

value5 = ema(close,120);

value6 = ema(close,240);

 

if value1 = 0 or value2 = 0 or value3 = 0 or value4 = 0 or value5 = 0 or value6 = 0then return;

 

if value1 > value2 and value2 > value3 and value3 > value4 and value4 > value5 and value5 > value6

then plot1(close,"■雙多頭");

 

if value4 > value5 and value5 > value6

then plot2(close,"■長多");

 

if value1 > value2 and value2 > value3

then plot3(close,"▲短多");

 

if value1 < value2 and value2 < value3 and value3 < value4 and value4 < value5 and value5 < value6

then plot4(close,"■雙空頭");

 

if value4 < value5 and value5 < value6

then plot5(close,"■長空");

 

if value1 < value2 and value2 < value3

then plot6(close,"▼短空");

 

//○爆量+ ↑跳空======================================================================================

if close > close[1] * 1.034 and high > high[1] and close > open and close > value4 and value4 > value5 and value5 > value6 and (volume > 2 * volume[1] or volume crosses above average(volume,5))

then

plot7(close,"●爆量");

 

if close > value4 and low > value4 and close > open and low > high[1] and value4 > value5 and value5 > value6

then

plot8(close,"↑跳空");

 

if close > close[1] * -1.034 and low < low[1] and close < open and close < value4 and value4 < value5 and value5 < value6 and (volume > 2 * volume[1] or volume crosses above average(volume,5))

then

plot9(close,"●爆量");

 

if close < value4 and high < value4 and close < open and high < low[1] and value4 < value5 and value5 < value6

then

plot10(close,"↓跳空");

XQ小幫手 發文於   2023/04/10

Hello 獨棟小豪宅,

 

小幫手這邊測試沒有發生您所說的狀況。(參考附圖)

簡單看了下您的腳本中也有沒有用到除法,所以應該不會發生這樣的錯誤。

如果可以的話,麻煩告知您是用在什麼商品、什麼頻率上讓小幫手測試。

感謝。

附加文件

發表回覆
Close