// 本 Mine Script® 代码受 Mozilla 公共许可证 2.0 条款约束
var tab = table.new (position=position.top_right, columns=7, rows=30, frame_color=na, frame_width=1)
msg (int row, int col, string msg_str, clr=color.blue) =>
//if (barstate.islast)
table.cell (table_id=tab, column=col, row=row, text=msg_str, text_color=clr)
// 可四舍五入到最接近的 1、5、10、20……
round_up (pp, round_to=0) => round_to <= 0 ? pp : math.ceil (pp/round_to) * round_to
round_down (pp, round_to=0) => round_to <= 0 ? pp : math.floor (pp/round_to) * round_to
t(val) => str.tostring(val)
tr(val) => str.tostring(math.round(val, 2))
r(val) => math.round_to_mintick(val)
method f(float f) => str.tostring(f)
method f(int i) => str.tostring(i)
method f(bool b) => str.tostring(b)
method f(string s) => str.tostring(s) |