我想在每天的某个当地时间(例如 08:00 GMT+1)画一条垂直线。
自从我上一篇关于垂直线的文章以来, pine-script 已更新为包含vline(),但是,这里的问题是获取正确的时间。大多数服务器(针对外汇)似乎都位于美国,并且交易视图本地时间设置(显示在左下角)似乎完全独立于 pine-script 中所做的操作。
//@version=4
study("Time Adjusted Vertical Line", overlay=true)
vline(BarIndex, Color, LineStyle, LineWidth) => // Verticle Line, 54 lines maximum allowable per indicator
return = line.new(BarIndex, -1000, BarIndex, 1000, xloc.bar_index, extend.both, Color, LineStyle, LineWidth)
if(bar_index%10==0.0)
vline(bar_index, #FF8000ff, line.style_solid, 1) // Variable assignment not required
Run Code Online (Sandbox Code Playgroud)
我无法使上述工作正常,但我至少可以显示以下几行:
//@version=4
study(title="Time Based Session Bars", shorttitle="NowOpen", overlay=true)
line_height = 2 // We must define a height that reaches far above the highest price level in main …Run Code Online (Sandbox Code Playgroud) pine-script ×1