CPR但在凌晨4点策划,而不是市场开放
该脚本正确地绘制了CPR,因此奏效了。但是,仅在市场开放后才吸引CPR。但是,计算枢轴所需的数据可以在前一天关闭市场。
我必须在以下脚本中修改什么,以便交易视图可以在每天凌晨4点计算和绘制CPR?
study(title="Central Pivot Range", shorttitle="CPR", overlay=true)
sd = input(true, title="Show Daily Pivots?")
//Pivot Range Calculations - Mark Fisher
pivot = (high + low + close ) / 3.0
bc = (high + low ) / 2.0
tc = (pivot - bc) + pivot
//Daily Pivot Range
dtime_pivot = security(tickerid, 'D', pivot[1])
dtime_bc = security(tickerid, 'D', bc[1])
dtime_tc = security(tickerid, 'D', tc[1])
offs_daily = 0
plot(sd and dtime_pivot ? dtime_pivot : na, title="Daily Pivot",style=circles, color=fuchsia,linewidth=3)
plot(sd and dtime_bc ? dtime_bc : na, title="Daily BC",style=circles, color=blue,linewidth=3)
plot(sd and dtime_tc ? dtime_tc : na, title="Daily TC",style=circles, color=blue,linewidth=3)
谢谢你!
This script works fantastic as it plots the CPR correctly; however, it draws the CPR only after the market opens. However, the data needed to calculate the pivots is available at market close the previous day.
What do I have to modify in the following script so that the trading view can calculate and plot the CPR at 4 am daily?
study(title="Central Pivot Range", shorttitle="CPR", overlay=true)
sd = input(true, title="Show Daily Pivots?")
//Pivot Range Calculations - Mark Fisher
pivot = (high + low + close ) / 3.0
bc = (high + low ) / 2.0
tc = (pivot - bc) + pivot
//Daily Pivot Range
dtime_pivot = security(tickerid, 'D', pivot[1])
dtime_bc = security(tickerid, 'D', bc[1])
dtime_tc = security(tickerid, 'D', tc[1])
offs_daily = 0
plot(sd and dtime_pivot ? dtime_pivot : na, title="Daily Pivot",style=circles, color=fuchsia,linewidth=3)
plot(sd and dtime_bc ? dtime_bc : na, title="Daily BC",style=circles, color=blue,linewidth=3)
plot(sd and dtime_tc ? dtime_tc : na, title="Daily TC",style=circles, color=blue,linewidth=3)
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
并不是您要寻找的内容,但这将开始在会议的最后一个栏上绘制第二天的枢轴。您可以将其用作编码特定需求的起点。
Not entirely what you're looking for, but this will start drawing next day's pivots on the last bar of the session. You can use this as a starting point to code your specific needs.