0

我正在尝试编写一个显示阻力区域的指示器

抵抗区域应该是方框(三角形)

指标检测最高红色蜡烛的主要思想,其上部故事超过蜡烛长度的 50%

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TEST

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

redbar = close < open
greenbar = close > open
low_tale = min(close,open) - low
upper_tale = high - max(open,close)
candle_length = high - low


hiLen = input(title="High Length", type=input.integer, defval=25)
hiHighs = highest(high, hiLen)[1]

loLen = input(title="Low Length", type=input.integer, defval=25)
loLows = lowest(low, loLen)[1]


if redbar and upper_tale > ( 0.5 * candle_length ) and high > hiHighs
    label.new(bar_index, high, "Short", yloc = yloc.abovebar, color = color.red, style = label.style_arrowdown)

现在显示的演示图像

它显示红色箭头,但我希望它显示一个框

这就是我想做的

在此处输入图像描述

  • 我想用它的盒子显示最后 4 根蜡烛,如图所示,条件相同,但我可以增加或减少它作为输入

** 当然,盒子的顶部是目标蜡烛的高点,盒子的低点是目标蜡烛的低点

4

1 回答 1

0

检查它 - https://www.tradingview.com/script/db9fuGm0-Price-Action-Inside-Bar-Boxes/

此脚本自动在 IB 模式内的条形周围绘制矩形,但可以根据您的任务进行更改

于 2021-10-08T12:09:08.667 回答