微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在松树脚本中绘制直到昨天而不是当天的标签

如何解决如何在松树脚本中绘制直到昨天而不是当天的标签

study("temp",overlay=true)
startDate=input(title="StartDate",type=input.time,defval=timestamp("01 Jan 2000 09:15:00 
  UTC+5:30"))
// newDay=change(time("D"))!= 0
// _year=valuewhen(newDay,year[1],0)
// _month = valuewhen(newDay,month[1],0)
// yday = valuewhen(newDay,dayofmonth[1],0)
// yesterdays_ts = timestamp(_year,_month,yday,15,30)
endDate=timestamp("UTC+5:30",year,month,dayofmonth,30,00)
labelSession=input(title="Time session to analysis",type=input.session,defval="0915-1525")
inSession(sess)=> na(time(timeframe.period,sess + ":23456")) == false 
  and time >= startDate and time<= endDate 
  dayLow()=>security(syminfo.ticker,"D",low,lookahead=true)
if inSession(labelSession) and not inSession(labelSession)[1]  
   label.new(bar_index,dayLow()-20,"Hello",style=label.style_label_left,textalign=text.align_left,color=#d0cec2,textcolor=color.black)

如果我运行我的代码,我会得到这样的输出out put image”,但我想打印标签直到昨天,只是如何实现

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。