我编写了一个代码,该代码获取前一天的高位,低位,收盘价并计算如下所示的枢轴点
study("My Script",overlay=true)
// Getting previous 2 days day high low close
prev_daily_high = security(syminfo.tickerid, 'D', high)
prev_daily_low = security(syminfo.tickerid, 'D', low)
prev_daily_close = security(syminfo.tickerid, 'D', close)
// Calculation of central pivot bottom Central and top Central
cp=(prev_daily_high+prev_daily_low+prev_daily_close)/3
bc=(prev_daily_high+prev_daily_low)/2
tc=2*cp-bc
我想计算两天的简单移动平均线。我已经尝试过以下代码,但不确定是否正确的方法
MAC = sma(cp, 2)
MAB = sma(bc, 2)
MAT = sma(tc, 2)