是否有可能为未来划清界限? [英] Is it possible to draw a line into the future?

查看:37
本文介绍了是否有可能为未来划清界限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于日内时间框架.
是否可以在会话的第一个条形上绘制一条水平线,直到该会话结束为止?
因此,基本上是在未来"中划出一条线.

像这样:

解决方案

这似乎是可能的.
下面的代码基于

For intraday timeframes.
Is it possible to draw a horizontal line on the first bar of the session, that has a length until the end of that session?
So, essentially drawing a line into the 'future'.

Something like this:

解决方案

It seems to be possible.
Code below is based on the answer of PineCoders-LucF to one of my previous questions line.new draws 2 lines instead of 1

//@version=4
study("FutureLine", overlay=true)

start = timestamp(2020,03,13,10,30,0)
stop = timestamp(2020,03,16,16,00,0)
level = 2575

var line ln = line.new(start, level, stop, level, xloc=xloc.bar_time)

if barstate.islast
    line.set_x1(ln, start)
    line.set_x2(ln, stop)

Which results in

这篇关于是否有可能为未来划清界限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆