MattDeLong

2% candle

Part of my strategy involves entering a trade based on a candle on a 5-min chart being < 2% (ignoring major volatility).
I got tired of calculating the range of a single candle either in my head or on a calculator, so I wrote this up. Feel free to share it.

Shows the %move of any single candle, default horizontal lines are 1% & 2%, can be changed by clicking the gear icon next to the indicator after you have added the indicator to your chart. Works on any timeframe, 5m, 1h, 1d, etc , obviously
the higher the timeframe, the larger the move.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
//@version=2
//author = https://www.tradingview.com/u/MattDeLong/
//Shows the %move of any single candle, default horizontal lines are 1% & 2%, can be changed by clicking the gear icon next
//to the indicator after you have added the indicator to your chart. Works on any timeframe, 5m, 1h, 1d, etc , obviously 
//the higher the timeframe, the larger the move
study("2% candle", overlay=false)

move1 = input(1, 'Horizontal Line1 %', type=integer)
move2 = input(2, 'Horizontal Line2 %', type=integer)

move(k) =>
    (high[k] - low[k]) / high[k] * 100

p1 = plot(move(0), color=gray)
p2 = plot(move2, color=gray)
p3 = plot(move1, color=silver)
fill(p1, p2, color=#8b0000)
fill(p2, p3, color=red)