Most Profitable HelloEpicWorld v2.0[Eric] This is the most profitable un-repaint fully support auto trading Algo on earth.
Usage:
Buy and Sell && Stop Loss
1. When it shows buy, you can buy it immediately or wait for a small dump to buy it, stop loss at the red cross below.(Both buy and stop signal support alert autoview bots auto trading)
2. When it shows sell, you can sell it immediately or wait for a small pump to sell it, stop loss at the green cross above.(Both buy and stop signal support alert autoview bots auto trading)
Background Color:
It can be turn on and off in the settings. When it is green, you have a 78% probability to get a win trade on buying the pullback. And a 73% probability to get a win trade on selling the pullback when it's red. So, even missed the buy and sell signal, you can still open a trade in the middle, but I don't recommend this kind of trades, it's no good for Risk/Reward ratio. The best ratio is when the signal show up. Background color is more suitable using to hold your trades after entering.
Forex:
Bitcoin:
Altcoin:
MarketSpeed:
RSIC:
스크립트에서 "bot"에 대해 찾기
3 HULLs & ICHIMOKU divided by PRICEBasically just another form of moving average, for quick swings, built for testing/use with API cryptobots, simple switch from buy to sell.
Hull MA(2 candles back) times 3 plus Ichimoku divided by price(1 candle back) = value1
Hull MA(3 candles back) times 3 plus Ichimoku divided by price(1 candle back) = value2
if value1>value2 then buy else sell
calculates price from 1 candle back, and calculates signal from 2nd and 3rd candle prices, so no repainting? so best on low timeframes.
for when use in bot, would not need 1 candle lag. Lag is for TV chartists to not have to suffer repainting.
Bots do not repaint. they are not "painting" anything, they simply open or close orders, which cannot be "repainted"
but here on TV chart, when you refresh the browser page, the script recalculates, and signals may be repainted.
hopefully this will not repaint. please test. thankyou
MACs EasyMoney - LongTermSignalsIntroducing " MACs EasyMoney - LongTermSignals " Indicator. Specially designed for weekly and 1 Month duration charts . Picks the calls perfectly :)
Latest other updates:
BOT Trading Integration is completed for the following indicators,
1) MACs EasyMoney - Swing Trade Signals
2) MACs EasyMoney - Scalp Trade Signals
Strategy Test Report for the BOT script shows the following results,
* Profitable Percent = 99.42%
* Profitable Factor = 93.76
Thanks,
Mac.
Pharoceus PT-V2 CryptoScalper RSI+BB+SRSI+Stochastic IndicatorThis is the updated Version of the ProfitTrailerV2 RSI+BB+StochRSI+Stochastic Oscillator Signal+Alerts
Description
This is an all-in-one indicator with alerts that most people call signals and it's designed for Cryptocurrency leverage trading. This indicator features, the most popularly used indicators in technical analysis and are the basic technical analysis indicators any successful trader should master before going into more advance technical analysis tools. The Pharoceus ProfitTrailerV2 CryptoScalper RSI+BB+SRSI+Stochastic Oscillator Signal+Alerts features the Bollinger Bands, Relative Strength Index, Stochastic RSI and Stochastic Oscillator, and it was designed for use with Pharoceus ProfitTrailerV2 CryptoScalper and can also be used with all other trading bots or on its own as a powerful market leveraging and trading indicator using alerts.
The ProfitTrailerV2 RSI+BB+SRSI+Stochastic Oscillator Signal+Alerts can be customized to any trader specific trading patterns and offers the ability to choose a combination of indicators from the featured ones to use. With the Buy and Sell Signal feature, trading on any cryptocurrency exchange can be automated and with the alerts feature, the Pharoceus ProfitTrailerV2 CryptoScalper RSI+BB+SRSI+Stochastic Oscillator Signal+Alerts will automated buying and selling signals for any crypto trading bot but I'll always recommend using for making buys only when using with any bot. This indicator/script can be used with any base pair; BTC, ETH, and USD or USDT.
As mentioned above, all four indicators can be combined to find a very safe and secure buy and profitable sell signals, which maximizes your profit margins and overall earnings over time. Also, 2 or 3 could be combined as well, depending on the traders knowledge on how to use each indicator independently to find its best settings. My recommendation would be to test all independently and or together with very little capital to find what works best for you. I recommend this because the cryptocurrency market in a very volatile market and unpredictable, some combination of indicators would work for some certain coin pairs and not all, while others would work better with a different setting and a particular coin pair.
As with all script use at your own risk and only trade what you can afford to lose, while this indicator isn't designed to lose you money and I will not be held liable for any losses due to misuse. I am also not a financial advisor and the ProfitTrailerV2 RSI+BB+SRSI+Stochastic Oscillator Signal+Alerts will be made available soon as it's still undergoing rigorous testing and it's in no way and manner affiliated with any group of individuals or bot.
Trade Smart and with only what you can afford. Donations are also welcome to encourage my work, This is a totally free to use script to help traders, small time or big time that works towards making the indicator sharing world accessible to all who will not definitely be ripped-off and support a community of sharing.
discord.gg
BTC: 199qMzu4gvr3bUXWEpLG5uS6TEKKvw5pbe
ETH: 0xf8339952a224a228f2f8c58a5666a8ffleddebfb
BCH: qqmmds8u3f8m6ek387jtefg07525dvaxzqrshd86gz
Ichimoku Cloud Strategy for CryptoVersion 1.0
This strategy uses the Ichimoku Cloud indicators and is based on a bot i developed. The bot has more entry/exit rules which will hopefully be added in the near future.
Still a profitable strategy even in it's simplest form.
Do not run this strategy on a timeframe < 1h, best timeframe will be 4h
Happy Trading!!
If you find this strategy useful, please consider a donation to:
BTC: 1PGuWcQwb4WZyFYX4ehyqcJWcbX42jW7Y6
ETH: 0x912aD30Ff9A49c69D51ECeE5A65A7E7d5321ED0C
ProfitTrailerV2 RSI+BB+SRSI+Stochastic Oscillator Signal+AlertsThis is an all-in-one indicator with alerts that most people call signals and it's designed for Cryptocurrency leverage trading. This indicator features, the most popularly used indicators in technical analysis and are the basic technical analysis indicators any successful trader should master before going into more advanced technical analysis tool. The ProfitTrailerV2 RSI+BB+SRSI+Stochastic Oscillator Signal+Alerts features the Bollinger Bands, Relative Strength Index, Stochastic RSI and Stochastic Oscillator, and it was designed for use with ProfitTrailer V2 and can also be used with all other trading bots or on its own as a powerful market leveraging and trading indicator using alerts.
The ProfitTrailerV2 RSI+BB+SRSI+Stochastic Oscillator Signal+Alerts can be customized to any trader specific trading patterns and offers the ability to choose a combination of indicators from the featured ones to use. With the Buy and Sell Signal feature, trading on any cryptocurrency exchange can be automated and with the alerts feature, the ProfitTrailerV2 RSI+BB+SRSI+Stochastic Oscillator Signal+Alerts will automated buying and selling signals for any crypto trading bot but I'll always recommend using for making buys only when using with any bot. This indicator/script can be used with any base pair; BTC, ETH, and USD or USDT.
As mentioned above, all four indicators can be combined to find a very safe and secure buy and profitable sell signals, which maximizes your profit margins and overall earnings over time. Also, 2 or 3 could be combined as well, depending on the traders knowledge on how to use each indicator independently to find its best settings. My recommendation would be to test all independently and or together with very little capital to find what works best for you. I recommend this because the cryptocurrency market in a very volatile market and unpredictable, some combination of indicators would work for some certain coin pairs and not all, while others would work better with a different setting and a particular coin pair.
As with all script use at your own risk and only trade what you can afford to lose, while this indicator isn't designed to lose you money and I will not be held liable for any losses due to misuse. I am also not a financial advisor and the ProfitTrailerV2 RSI+BB+SRSI+Stochastic Oscillator Signal+Alerts will be made available soon as it's still undergoing rigorous testing.
CMYK RMI TRIPLE Automated strategy▼ This is the strategy version of the script.
◊ Introduction
This script makes use of three RMI 's, that indicate Overbought/Oversold on different timescales that correspond with Frequency’s that move the market.
◊ Origin
The Relative Momentum Index was developed by Roger Altman and was introduced in his article in the February, 1993 issue of Technical Analysis of Stocks & Commodities magazine.
While RSI counts up and down ticks from close to close, the Relative Momentum Index counts up and down ticks from the close relative to a close x number of days ago.
This results in an RSI that is smoother, and has another setting for fine tuning results.
This bot originated out of Project XIAM , an investigative script that outlined my approach towards Automated Trading Strategies.
Are you interested in writing bots yourself ? check out the beta version of this script.
It has many bugs, but also most of the Skeleton.
◊ Usage
This script is intended for Automated Trading with AUTOVIEW or TVAUTOTRADER , on the 1 minute chart.
◊ Features Summary
Overlay Mode
Indicator Mode
Three RMI's
Trend adjustment
Pyramiding
Ignore first entries
Take Profit
Stop Loss
Interval between Entries
Multiring Fix
Alert signal Seperation
◊ Community
Wanna try this script out ? need help resolving a problem ?
CMYK :: discord.gg
AUTOVIEW :: discordapp.com
TRADINGVIEW UNOFFICIAL :: discord.gg
◊ Setting up Autoview Alerts
Use the study version of this script, To set up The Alerts Autoview Picks up on.
The Signals to work with are :
Open 1 Long
Use this to open one Long Position.
With quantity being : /
Once per bar
Being larger than 0
Comment example : e=exchange b=long q=amount t=market
Open 1 Short
Use this to open one Short Position.
With quantity being : /
Once per bar
Being larger than 0
Comment example : e=exchange b=short q=amount t=market
Close1 Position
Use this to Close The amount of one Open Position.
With quantity* being : /
Once per bar
Being larger than 0
Comment example : e=exchange c=position q=amount t=market
*Beware when using a percental % quantity, instead of an absolute quantity.
Percental Quantities are based on the , Not
And will change in absolute value relative to the amount of open trades.
Close All positions
Use this to Close All Open Positions.
With quantity being :
Once per bar
Being larger than 0
Comment example : e=exchange c=position t=market
For the specific Syntax used in the comment of the alert, visit Autoview .
◊ Setting up TVAutotrader
Use the strategy version of this script, And load it into TVAT .
◊ Backtesting
Use the strategy version of this script for backtesting.
◊ Contact
Wanna try this script out ? need help resolving a problem ?
CMYK :: discord.gg
PT Magic Triggers So its me again. I have decided to create Trend Trigger Script for PT Magic addon for a trading bot Profit Trailer. If you do not own this bot and Addon the following explanation will not help you.
For each Trend you define number of minutes and it then calculates the percentage change between the close price now and X candles before.
Same calculation is for all 6 Triggers i beleive that is all you need :)
Hope it helps you all.
LTC: LYHj4WDN7BPu5294cSpqK3SgWSWdDX56Qt
BTC: 1NPVzeDSsenaCS9QdPro877hkMk93nRLcD
MACD, backtest 2015+ only, cut in half and doubledThis is only a slight modification to the existing "MACD Strategy" strategy plugin!
found the default MACD strategy to be lacking, although impressive for its simplicity. I added "year>2014" to the IF buy/sell conditions so it will only backtest from 2015 and beyond ** .
I also had a problem with the standard MACD trading late, per se. To that end I modified the inputs for fast/slow/signal to double. Example: my defaults are 10, 21, 10 so I put 20, 42, 20 in. This has the effect of making a 30min interval the same as 1 hour at 10,21,10. So if you want to backtest at 4hr, you would set your time interval to 2hr on the main chart. This is a handy way to make shorter time periods more useful even regardless of strategy/testing, since you can view 15min with alot less noise but a better response.
Used on BTCCNY OKcoin, with the chart set at 45 min (so really 90min in the strategy) this gave me a percent profitable of 42% and a profit factor of 1.998 on 189 trades.
Personally, I like to set the length/signals to 30,63,30. Meaning you need to triple the time, it allows for much better use of shorter time periods and the backtests are remarkably profitable. (i.e. 15min chart view = 45min on script, 30min= 1.5hr on script)
** If you want more specific time periods you need to try plugging in different bar values: replace "year" with "n" and "2014" with "5500". The bars are based on unix time I believe so you will need to play around with the number for n, with n being the numbers of bars.
QA & Bot: Fully Integrated SignalsMAXX v4.0 Fusion is an "AI-based multi-strategic ensemble system" that does not rely on a single strategy. The core philosophy of this system is not to define the market as a single character, but to intelligently select the most suitable weapon (strategic) for different phases, such as bull markets, bear markets, and lateral guarantees, and even to improve (optimize) the weapon itself in real time.
High Low + BOS/Sweep aaa//@version=5
indicator("High Low + BOS/Sweep", overlay=true, max_lines_count=500, max_labels_count=500)
// Inputs (giữ nguyên các tuỳ chọn của bạn, chỉ bỏ input màu)
offTop = input.int(2, "Offset đỉnh", minval=0)
offBot = input.int(2, "Offset đáy", minval=0)
w = input.int(2, "Độ dày line", minval=1)
styleBosStr = input.string("Solid", "Kiểu line BOS", options= )
styleSweepStr = input.string("Dashed", "Kiểu line Sweep", options= )
showBosLabel = input.bool(true, "Hiện label BOS")
showSweepLabel = input.bool(true, "Hiện label Sweep")
bosLabelText = input.string("BOS", "Text BOS")
sweepLabelText = input.string("SWEEP", "Text Sweep")
labelSizeStr = input.string("tiny", "Kích thước label", options= )
// NEW: display toggles
showPivot = input.bool(true, "Hiện Pivot")
showBosSweep = input.bool(true, "Hiện BOS / Sweep")
// Convert styles / sizes
bosStyle = styleBosStr == "Dashed" ? line.style_dashed : styleBosStr == "Dotted" ? line.style_dotted : line.style_solid
sweepStyle = styleSweepStr == "Dashed" ? line.style_dashed : styleSweepStr == "Dotted" ? line.style_dotted : line.style_solid
lblSize = labelSizeStr == "small" ? size.small : labelSizeStr == "normal" ? size.normal : labelSizeStr == "large" ? size.large : size.tiny
// State vars
c = close
var int lastSignal = 0
var float sHigh = na
var int sHighBar = na
var float sLow = na
var int sLowBar = na
var float confHigh = na
var int confHighBar = na
var float confLow = na
var int confLowBar = na
var line highLine = na
var line lowLine = na
var label highLabel = na
var label lowLabel = na
// === Đánh dấu loại line: 0 = chưa có, 1 = Sweep, 2 = BOS ===
var int highLineType = 0
var int lowLineType = 0
// === Sweep tracking / pending ===
var bool pendingSweepUp = false
var bool pendingSweepDown = false
var int sweepDetectedBarUp = na
var float sweepTargetHighPrice = na
var int sweepTargetHighBar = na
var int sweepDetectedBarDown = na
var float sweepTargetLowPrice = na
var int sweepTargetLowBar = na
// === Track BOS pivots ===
var int lastBOSHighBar = na
var int lastBOSLowBar = na
// Track swing
if (lastSignal == -1) or (lastSignal == 0)
if na(sHigh) or high > sHigh
sHigh := high
sHighBar := bar_index
if (lastSignal == 1) or (lastSignal == 0)
if na(sLow) or low < sLow
sLow := low
sLowBar := bar_index
// Confirm pivot
condTop = c < low
condBot = c > high
isTop = condTop and (lastSignal != 1)
isBot = condBot and (lastSignal != -1)
// On pivot confirm
if isTop
confHigh := sHigh
confHighBar := sHighBar
highLine := na
highLabel := na
highLineType := 0
if showPivot
label.new(confHighBar, confHigh + syminfo.mintick * offTop, "●", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.red, size=size.small)
lastSignal := 1
sHigh := na
sHighBar := na
sLow := low
sLowBar := bar_index
if isBot
confLow := sLow
confLowBar := sLowBar
lowLine := na
lowLabel := na
lowLineType := 0
if showPivot
label.new(confLowBar, confLow - syminfo.mintick * offBot, "●", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.lime, size=size.small)
lastSignal := -1
sLow := na
sLowBar := na
sHigh := high
sHighBar := bar_index
// Raw sweep detection
rawSweepUp = not na(confHigh) and (na(lastBOSHighBar) or confHighBar != lastBOSHighBar) and high > confHigh and close <= confHigh
rawSweepDown = not na(confLow) and (na(lastBOSLowBar) or confLowBar != lastBOSLowBar) and low < confLow and close >= confLow
if rawSweepUp
pendingSweepUp := true
sweepDetectedBarUp := bar_index
sweepTargetHighPrice := confHigh
sweepTargetHighBar := confHighBar
if rawSweepDown
pendingSweepDown := true
sweepDetectedBarDown := bar_index
sweepTargetLowPrice := confLow
sweepTargetLowBar := confLowBar
// Check sweep validity
checkSweepValidUp() =>
isValid = true
if pendingSweepUp and not na(sweepDetectedBarUp)
maxOffset = bar_index - sweepDetectedBarUp
if maxOffset >= 0
for i = 0 to maxOffset
if close > sweepTargetHighPrice
isValid := false
isValid
checkSweepValidDown() =>
isValid = true
if pendingSweepDown and not na(sweepDetectedBarDown)
maxOffset = bar_index - sweepDetectedBarDown
if maxOffset >= 0
for i = 0 to maxOffset
if close < sweepTargetLowPrice
isValid := false
isValid
// BOS logic
bosUp = not na(confHigh) and c > confHigh
bosDown = not na(confLow) and c < confLow
if bosUp
pendingSweepUp := false
sweepDetectedBarUp := na
sweepTargetHighPrice := na
sweepTargetHighBar := na
lastBOSHighBar := confHighBar
if not na(highLine)
line.delete(highLine)
if not na(highLabel)
label.delete(highLabel)
highLineType := 2
if showBosSweep
highLine := line.new(confHighBar, confHigh, bar_index, confHigh, xloc=xloc.bar_index, extend=extend.none, color=color.black, width=w, style=bosStyle)
if showBosLabel
midBar = math.floor((confHighBar + bar_index) / 2)
highLabel := label.new(midBar, confHigh, bosLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=color.black, style=label.style_none, size=lblSize)
if bosDown
pendingSweepDown := false
sweepDetectedBarDown := na
sweepTargetLowPrice := na
sweepTargetLowBar := na
lastBOSLowBar := confLowBar
if not na(lowLine)
line.delete(lowLine)
if not na(lowLabel)
label.delete(lowLabel)
lowLineType := 2
if showBosSweep
lowLine := line.new(confLowBar, confLow, bar_index, confLow, xloc=xloc.bar_index, extend=extend.none, color=color.black, width=w, style=bosStyle)
if showBosLabel
midBar = math.floor((confLowBar + bar_index) / 2)
lowLabel := label.new(midBar, confLow, bosLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=color.black, style=label.style_none, size=lblSize)
// Sweep draw (pivot-in-between check)
sweepUpTriggered = false
sweepDownTriggered = false
if (isTop or isBot) and pendingSweepUp and not na(sweepTargetHighBar)
hasLowBetween = false
for i = sweepTargetHighBar to bar_index
if not na(confLowBar) and confLowBar == i
hasLowBetween := true
if checkSweepValidUp() and highLineType != 2 and hasLowBetween
if not na(highLine)
line.delete(highLine)
if not na(highLabel)
label.delete(highLabel)
highLineType := 1
if showBosSweep
highLine := line.new(sweepTargetHighBar, sweepTargetHighPrice, bar_index, sweepTargetHighPrice, xloc=xloc.bar_index, extend=extend.none, color=color.black, width=w, style=sweepStyle)
if showSweepLabel
midBar = math.floor((sweepTargetHighBar + bar_index) / 2)
highLabel := label.new(midBar, sweepTargetHighPrice, sweepLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=color.black, style=label.style_none, size=lblSize)
pendingSweepUp := false
sweepDetectedBarUp := na
sweepTargetHighPrice := na
sweepTargetHighBar := na
sweepUpTriggered := true
if (isTop or isBot) and pendingSweepDown and not na(sweepTargetLowBar)
hasHighBetween = false
for i = sweepTargetLowBar to bar_index
if not na(confHighBar) and confHighBar == i
hasHighBetween := true
if checkSweepValidDown() and lowLineType != 2 and hasHighBetween
if not na(lowLine)
line.delete(lowLine)
if not na(lowLabel)
label.delete(lowLabel)
lowLineType := 1
if showBosSweep
lowLine := line.new(sweepTargetLowBar, sweepTargetLowPrice, bar_index, sweepTargetLowPrice, xloc=xloc.bar_index, extend=extend.none, color=color.black, width=w, style=sweepStyle)
if showSweepLabel
midBar = math.floor((sweepTargetLowBar + bar_index) / 2)
lowLabel := label.new(midBar, sweepTargetLowPrice, sweepLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=color.black, style=label.style_none, size=lblSize)
pendingSweepDown := false
sweepDetectedBarDown := na
sweepTargetLowPrice := na
sweepTargetLowBar := na
sweepDownTriggered := true
// Alerts
alertcondition(isTop, "Top", "Top confirmed")
alertcondition(isBot, "Bot", "Bottom confirmed")
alertcondition(bosUp, "BOS Up", "Break of structure up")
alertcondition(bosDown, "BOS Down", "Break of structure down")
alertcondition(sweepUpTriggered, "Sweep Up", "Sweep đỉnh xuất hiện")
alertcondition(sweepDownTriggered, "Sweep Down", "Sweep đáy xuất hiện")
plot(na) // tránh lỗi
High Low + BOS/Sweep//@version=5
indicator("High Low + BOS/Sweep", overlay=true, max_lines_count=500, max_labels_count=500)
// Inputs (giữ nguyên các tuỳ chọn của bạn, chỉ bỏ input màu)
offTop = input.int(2, "Offset đỉnh", minval=0)
offBot = input.int(2, "Offset đáy", minval=0)
w = input.int(2, "Độ dày line", minval=1)
styleBosStr = input.string("Solid", "Kiểu line BOS", options= )
styleSweepStr = input.string("Dashed", "Kiểu line Sweep", options= )
showBosLabel = input.bool(true, "Hiện label BOS")
showSweepLabel = input.bool(true, "Hiện label Sweep")
bosLabelText = input.string("BOS", "Text BOS")
sweepLabelText = input.string("SWEEP", "Text Sweep")
labelSizeStr = input.string("tiny", "Kích thước label", options= )
// NEW: display toggles (giữ nguyên logic, bạn yêu cầu)
showPivot = input.bool(true, "Hiện Pivot")
showBosSweep = input.bool(true, "Hiện BOS / Sweep")
// Convert styles / sizes
bosStyle = styleBosStr == "Dashed" ? line.style_dashed : styleBosStr == "Dotted" ? line.style_dotted : line.style_solid
sweepStyle = styleSweepStr == "Dashed" ? line.style_dashed : styleSweepStr == "Dotted" ? line.style_dotted : line.style_solid
lblSize = labelSizeStr == "small" ? size.small : labelSizeStr == "normal" ? size.normal : labelSizeStr == "large" ? size.large : size.tiny
// State vars (khai báo riêng để tránh lỗi kiểu)
c = close
var int lastSignal = 0
var float sHigh = na
var int sHighBar = na
var float sLow = na
var int sLowBar = na
var float confHigh = na
var int confHighBar = na
var float confLow = na
var int confLowBar = na
var line highLine = na
var line lowLine = na
var label highLabel = na
var label lowLabel = na
// === Đánh dấu loại line: 0 = chưa có, 1 = Sweep, 2 = BOS ===
var int highLineType = 0
var int lowLineType = 0
// === Sweep tracking / pending ===
var bool pendingSweepUp = false
var bool pendingSweepDown = false
var int sweepDetectedBarUp = na
var float sweepTargetHighPrice = na
var int sweepTargetHighBar = na
var int sweepDetectedBarDown = na
var float sweepTargetLowPrice = na
var int sweepTargetLowBar = na
// === Track BOS pivots (pivot bar indexes that became BOS) ===
var int lastBOSHighBar = na
var int lastBOSLowBar = na
// Track swing while searching
if (lastSignal == -1) or (lastSignal == 0)
if na(sHigh) or high > sHigh
sHigh := high
sHighBar := bar_index
if (lastSignal == 1) or (lastSignal == 0)
if na(sLow) or low < sLow
sLow := low
sLowBar := bar_index
// Confirm pivot
condTop = c < low
condBot = c > high
isTop = condTop and (lastSignal != 1)
isBot = condBot and (lastSignal != -1)
// On pivot confirm (KHÔNG reset pendingSweep ở đây)
if isTop
confHigh := sHigh
confHighBar := sHighBar
highLine := na
highLabel := na
highLineType := 0
if showPivot
label.new(confHighBar, confHigh + syminfo.mintick * offTop, "●", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.red, size=size.small)
lastSignal := 1
sHigh := na
sHighBar := na
sLow := low
sLowBar := bar_index
if isBot
confLow := sLow
confLowBar := sLowBar
lowLine := na
lowLabel := na
lowLineType := 0
if showPivot
label.new(confLowBar, confLow - syminfo.mintick * offBot, "●", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.lime, size=size.small)
lastSignal := -1
sLow := na
sLowBar := na
sHigh := high
sHighBar := bar_index
// Raw sweep detection: nếu có râu quét pivot cũ (và đóng lại không vượt) -> đánh dấu pending và lưu pivot cũ
// loại trừ pivot đã từng là BOS (lastBOSHighBar / lastBOSLowBar)
rawSweepUp = not na(confHigh) and (na(lastBOSHighBar) or confHighBar != lastBOSHighBar) and high > confHigh and close <= confHigh
rawSweepDown = not na(confLow) and (na(lastBOSLowBar) or confLowBar != lastBOSLowBar) and low < confLow and close >= confLow
if rawSweepUp
pendingSweepUp := true
sweepDetectedBarUp := bar_index
sweepTargetHighPrice := confHigh
sweepTargetHighBar := confHighBar
if rawSweepDown
pendingSweepDown := true
sweepDetectedBarDown := bar_index
sweepTargetLowPrice := confLow
sweepTargetLowBar := confLowBar
// Functions: check sweep valid (no close crossing pivot from detection to now)
checkSweepValidUp() =>
isValid = true
if pendingSweepUp and not na(sweepDetectedBarUp) and not na(sweepTargetHighPrice)
maxOffset = bar_index - sweepDetectedBarUp
if maxOffset >= 0
for i = 0 to maxOffset
if close > sweepTargetHighPrice
isValid := false
isValid
checkSweepValidDown() =>
isValid = true
if pendingSweepDown and not na(sweepDetectedBarDown) and not na(sweepTargetLowPrice)
maxOffset = bar_index - sweepDetectedBarDown
if maxOffset >= 0
for i = 0 to maxOffset
if close < sweepTargetLowPrice
isValid := false
isValid
// BOS logic (như cũ) — nếu BOS xảy ra thì hủy pending sweep liên quan
bosUp = not na(confHigh) and c > confHigh
bosDown = not na(confLow) and c < confLow
if bosUp
// cancel pending sweep
pendingSweepUp := false
sweepDetectedBarUp := na
sweepTargetHighPrice := na
sweepTargetHighBar := na
// mark pivot as BOS (do not allow future sweep using same pivot)
lastBOSHighBar := confHighBar
// delete existing sweep display if present
if not na(highLine)
line.delete(highLine)
if not na(highLabel)
label.delete(highLabel)
// draw BOS (only if display enabled) — dùng màu mặc định: black
highLineType := 2
if showBosSweep
highLine := line.new(confHighBar, confHigh, bar_index, confHigh, xloc=xloc.bar_index, extend=extend.none, color=color.black, width=w, style=bosStyle)
if showBosLabel
midBar = math.floor((confHighBar + bar_index) / 2)
highLabel := label.new(midBar, confHigh, bosLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=color.black, style=label.style_none, size=lblSize)
if bosDown
pendingSweepDown := false
sweepDetectedBarDown := na
sweepTargetLowPrice := na
sweepTargetLowBar := na
lastBOSLowBar := confLowBar
if not na(lowLine)
line.delete(lowLine)
if not na(lowLabel)
label.delete(lowLabel)
lowLineType := 2
if showBosSweep
lowLine := line.new(confLowBar, confLow, bar_index, confLow, xloc=xloc.bar_index, extend=extend.none, color=color.black, width=w, style=bosStyle)
if showBosLabel
midBar = math.floor((confLowBar + bar_index) / 2)
lowLabel := label.new(midBar, confLow, bosLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=color.black, style=label.style_none, size=lblSize)
// === Sweep draw (with pivot-in-between check) ===
if (isTop or isBot) and pendingSweepUp and not na(sweepTargetHighBar)
hasLowBetween = false
// scan bars between sweepTargetHighBar and current bar to find ANY confirmed low pivot (confLowBar)
for i = sweepTargetHighBar to bar_index
if not na(confLowBar) and confLowBar == i
hasLowBetween := true
if checkSweepValidUp() and highLineType != 2 and hasLowBetween
// delete existing line if any
if not na(highLine)
line.delete(highLine)
if not na(highLabel)
label.delete(highLabel)
// mark as sweep
highLineType := 1
// draw sweep only if display enabled (màu mặc định: black)
if showBosSweep
highLine := line.new(sweepTargetHighBar, sweepTargetHighPrice, bar_index, sweepTargetHighPrice, xloc=xloc.bar_index, extend=extend.none, color=color.black, width=w, style=sweepStyle)
if showSweepLabel
midBar = math.floor((sweepTargetHighBar + bar_index) / 2)
highLabel := label.new(midBar, sweepTargetHighPrice, sweepLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=color.black, style=label.style_none, size=lblSize)
// clear pending
pendingSweepUp := false
sweepDetectedBarUp := na
sweepTargetHighPrice := na
sweepTargetHighBar := na
if (isTop or isBot) and pendingSweepDown and not na(sweepTargetLowBar)
hasHighBetween = false
for i = sweepTargetLowBar to bar_index
if not na(confHighBar) and confHighBar == i
hasHighBetween := true
if checkSweepValidDown() and lowLineType != 2 and hasHighBetween
if not na(lowLine)
line.delete(lowLine)
if not na(lowLabel)
label.delete(lowLabel)
lowLineType := 1
if showBosSweep
lowLine := line.new(sweepTargetLowBar, sweepTargetLowPrice, bar_index, sweepTargetLowPrice, xloc=xloc.bar_index, extend=extend.none, color=color.black, width=w, style=sweepStyle)
if showSweepLabel
midBar = math.floor((sweepTargetLowBar + bar_index) / 2)
lowLabel := label.new(midBar, sweepTargetLowPrice, sweepLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=color.black, style=label.style_none, size=lblSize)
pendingSweepDown := false
sweepDetectedBarDown := na
sweepTargetLowPrice := na
sweepTargetLowBar := na
// Alerts
alertcondition(isTop, "Top", "Top confirmed")
alertcondition(isBot, "Bot", "Bottom confirmed")
alertcondition(bosUp, "BOS Up", "Break of structure up")
alertcondition(bosDown, "BOS Down", "Break of structure down")
plot(na) // tránh lỗi
VB Bots Watchlist 2025 — RangesOf course. Here is a complete Pine Script v6 indicator for TradingView that displays the On-Balance Volume (OBV) for a selectable list of the top 50 Binance coins by market capitalization.
You can copy and paste this code directly into your Pine Editor in TradingView.
Key Features:
Pine Script Version 6: Written in the latest version of Pine Script.
Dropdown Menu: Easily select which of the top 50 coins you want to see the OBV for from the indicator's settings.
Independent Data: The OBV is calculated for the selected coin, regardless of the chart you are currently viewing.
Clear Plot: Displays the OBV in a separate pane for easy analysis.
High Low + BOS/Sweep 2//@version=5
indicator("High Low + BOS/Sweep (fixed pivot check)", overlay=true, max_lines_count=500, max_labels_count=500)
// Inputs
offTop = input.int(2, "Offset đỉnh", minval=0)
offBot = input.int(2, "Offset đáy", minval=0)
w = input.int(2, "Độ dày line", minval=1)
c_bos_up = input.color(color.red, "Màu BOS phá đỉnh")
c_bos_down = input.color(color.lime, "Màu BOS phá đáy")
c_sweep_up = input.color(color.orange, "Màu Sweep đỉnh")
c_sweep_down = input.color(color.aqua, "Màu Sweep đáy")
styleBosStr = input.string("Solid", "Kiểu line BOS", options= )
styleSweepStr = input.string("Dashed", "Kiểu line Sweep", options= )
showBosLabel = input.bool(true, "Hiện label BOS")
showSweepLabel = input.bool(true, "Hiện label Sweep")
bosLabelText = input.string("BOS", "Text BOS")
sweepLabelText = input.string("SWEEP", "Text Sweep")
labelSizeStr = input.string("tiny", "Kích thước label", options= )
// Convert styles / sizes
bosStyle = styleBosStr == "Dashed" ? line.style_dashed : styleBosStr == "Dotted" ? line.style_dotted : line.style_solid
sweepStyle = styleSweepStr == "Dashed" ? line.style_dashed : styleSweepStr == "Dotted" ? line.style_dotted : line.style_solid
lblSize = labelSizeStr == "small" ? size.small : labelSizeStr == "normal" ? size.normal : labelSizeStr == "large" ? size.large : size.tiny
// State vars
c = close
var int lastSignal = 0
var float sHigh = na
var int sHighBar = na
var float sLow = na
var int sLowBar = na
var float confHigh = na
var int confHighBar = na
var float confLow = na
var int confLowBar = na
var line highLine = na
var line lowLine = na
var label highLabel = na
var label lowLabel = na
// === Đánh dấu loại line: 0 = chưa có, 1 = Sweep, 2 = BOS ===
var int highLineType = 0
var int lowLineType = 0
// === Sweep tracking / pending ===
var bool pendingSweepUp = false
var bool pendingSweepDown = false
var int sweepDetectedBarUp = na
var float sweepTargetHighPrice = na
var int sweepTargetHighBar = na
var int sweepDetectedBarDown = na
var float sweepTargetLowPrice = na
var int sweepTargetLowBar = na
// === NEW: track BOS pivots ===
var int lastBOSHighBar = na
var int lastBOSLowBar = na
// Track swing
if (lastSignal == -1) or (lastSignal == 0)
if na(sHigh) or high > sHigh
sHigh := high
sHighBar := bar_index
if (lastSignal == 1) or (lastSignal == 0)
if na(sLow) or low < sLow
sLow := low
sLowBar := bar_index
// Confirm pivot
condTop = c < low
condBot = c > high
isTop = condTop and (lastSignal != 1)
isBot = condBot and (lastSignal != -1)
// On pivot confirm
if isTop
confHigh := sHigh
confHighBar := sHighBar
highLine := na
highLabel := na
highLineType := 0
label.new(confHighBar, confHigh + syminfo.mintick * offTop, "●", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.red, size=size.small)
lastSignal := 1
sHigh := na
sHighBar := na
sLow := low
sLowBar := bar_index
if isBot
confLow := sLow
confLowBar := sLowBar
lowLine := na
lowLabel := na
lowLineType := 0
label.new(confLowBar, confLow - syminfo.mintick * offBot, "●", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.lime, size=size.small)
lastSignal := -1
sLow := na
sLowBar := na
sHigh := high
sHighBar := bar_index
// Raw sweep detection
rawSweepUp = not na(confHigh) and (na(lastBOSHighBar) or confHighBar != lastBOSHighBar) and high > confHigh and close <= confHigh
rawSweepDown = not na(confLow) and (na(lastBOSLowBar) or confLowBar != lastBOSLowBar) and low < confLow and close >= confLow
if rawSweepUp
pendingSweepUp := true
sweepDetectedBarUp := bar_index
sweepTargetHighPrice := confHigh
sweepTargetHighBar := confHighBar
if rawSweepDown
pendingSweepDown := true
sweepDetectedBarDown := bar_index
sweepTargetLowPrice := confLow
sweepTargetLowBar := confLowBar
// Check sweep validity
checkSweepValidUp() =>
isValid = true
if pendingSweepUp and not na(sweepDetectedBarUp)
maxOffset = bar_index - sweepDetectedBarUp
if maxOffset >= 0
for i = 0 to maxOffset
if close > sweepTargetHighPrice
isValid := false
isValid
checkSweepValidDown() =>
isValid = true
if pendingSweepDown and not na(sweepDetectedBarDown)
maxOffset = bar_index - sweepDetectedBarDown
if maxOffset >= 0
for i = 0 to maxOffset
if close < sweepTargetLowPrice
isValid := false
isValid
// BOS logic
bosUp = not na(confHigh) and c > confHigh
bosDown = not na(confLow) and c < confLow
if bosUp
pendingSweepUp := false
sweepDetectedBarUp := na
sweepTargetHighPrice := na
sweepTargetHighBar := na
lastBOSHighBar := confHighBar
if not na(highLine)
line.delete(highLine)
if not na(highLabel)
label.delete(highLabel)
highLine := line.new(confHighBar, confHigh, bar_index, confHigh, xloc=xloc.bar_index, extend=extend.none, color=c_bos_up, width=w, style=bosStyle)
highLineType := 2
if showBosLabel
midBar = math.floor((confHighBar + bar_index) / 2)
highLabel := label.new(midBar, confHigh, bosLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=c_bos_up, style=label.style_none, size=lblSize)
if bosDown
pendingSweepDown := false
sweepDetectedBarDown := na
sweepTargetLowPrice := na
sweepTargetLowBar := na
lastBOSLowBar := confLowBar
if not na(lowLine)
line.delete(lowLine)
if not na(lowLabel)
label.delete(lowLabel)
lowLine := line.new(confLowBar, confLow, bar_index, confLow, xloc=xloc.bar_index, extend=extend.none, color=c_bos_down, width=w, style=bosStyle)
lowLineType := 2
if showBosLabel
midBar = math.floor((confLowBar + bar_index) / 2)
lowLabel := label.new(midBar, confLow, bosLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=c_bos_down, style=label.style_none, size=lblSize)
// === Sweep draw (with pivot-in-between check) ===
if (isTop or isBot) and pendingSweepUp and not na(sweepTargetHighBar)
hasLowBetween = false
for i = sweepTargetHighBar to bar_index
if not na(confLowBar) and confLowBar == i
hasLowBetween := true
if checkSweepValidUp() and highLineType != 2 and hasLowBetween
if not na(highLine)
line.delete(highLine)
if not na(highLabel)
label.delete(highLabel)
highLine := line.new(sweepTargetHighBar, sweepTargetHighPrice, bar_index, sweepTargetHighPrice, xloc=xloc.bar_index, extend=extend.none, color=c_sweep_up, width=w, style=sweepStyle)
if showSweepLabel
midBar = math.floor((sweepTargetHighBar + bar_index) / 2)
highLabel := label.new(midBar, sweepTargetHighPrice, sweepLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=c_sweep_up, style=label.style_none, size=lblSize)
highLineType := 1
pendingSweepUp := false
sweepDetectedBarUp := na
sweepTargetHighPrice := na
sweepTargetHighBar := na
if (isTop or isBot) and pendingSweepDown and not na(sweepTargetLowBar)
hasHighBetween = false
for i = sweepTargetLowBar to bar_index
if not na(confHighBar) and confHighBar == i
hasHighBetween := true
if checkSweepValidDown() and lowLineType != 2 and hasHighBetween
if not na(lowLine)
line.delete(lowLine)
if not na(lowLabel)
label.delete(lowLabel)
lowLine := line.new(sweepTargetLowBar, sweepTargetLowPrice, bar_index, sweepTargetLowPrice, xloc=xloc.bar_index, extend=extend.none, color=c_sweep_down, width=w, style=sweepStyle)
if showSweepLabel
midBar = math.floor((sweepTargetLowBar + bar_index) / 2)
lowLabel := label.new(midBar, sweepTargetLowPrice, sweepLabelText, xloc=xloc.bar_index, yloc=yloc.price, textcolor=c_sweep_down, style=label.style_none, size=lblSize)
lowLineType := 1
pendingSweepDown := false
sweepDetectedBarDown := na
sweepTargetLowPrice := na
sweepTargetLowBar := na
// Alerts
alertcondition(isTop, "Top", "Top confirmed")
alertcondition(isBot, "Bot", "Bottom confirmed")
alertcondition(bosUp, "BOS Up", "Break of structure up")
alertcondition(bosDown, "BOS Down", "Break of structure down")
plot(na) // tránh lỗi
Stocks Watchlist @ Sumith.KVStocks Watchlist helps to Monitor Multiple Stocks with all Technicals Indicators at a Single Screen...
Strategies Available...
1. Change & Change%
2. RSI (Relative Strength Index)
3. VWAP
4. Volume
5. Super Trend
6. MACD
7. EMA Trends
8. ATR Bot Alerts
Stocks Dashboard @ Sumith.KVStocks Dashboard helps to Monitor Multiple Stocks with all Technicals Indicators at a Single Screen...
Strategies Available ...
1. Change & Change%
2. RSI (Relative Strength Index)
3. VWAP
4. Volume
5. 200SMA
6. Super Trend
7. ADX
8. Alligator
9. MACD
10. OHLC
11. EMA Trends
12. ATR Bot Alerts
The Table Values will update based on the timeframe chosen. Also the list can be customized based on the Stocks Preferences.
Ravi AlgoBot📌 Indicator Description (Publish Notes)
Indicator Name:
EoR / EoS Entry & SL/Target Manager (Put=Red, Call=Green)
Purpose:
यह indicator उन traders के लिए बनाया गया है जो अपनी manual levels (EoR, EoR+1 for Put, और EoS, EoS-1 for Call) को chart पर plot करना चाहते हैं और उनके आधार पर Entry, Stop Loss और Target manage करना चाहते हैं।
How it works:
आप manual prices (EoR, EoR+1, EoS, EoS-1) input fields में डालेंगे।
Put levels (EoR, EoR+1) लाल रंग में दिखेंगे।
Call levels (EoS, EoS-1) हरे रंग में दिखेंगे।
हर price पर chart पर horizontal line + label बनेगा।
आप अपने Stop Loss और Target prices भी manual डाल सकते हैं (Call और Put दोनों के लिए अलग-अलग)।
जब भी price किसी entry/SL/Target level को touch करेगा:
Chart पर signal shape बनेगा (triangle)
एक alertcondition trigger होगा।
आप TradingView में Alerts create करके इन alerts को webhook URL से connect कर सकते हैं।
Example: जब EoR Put level touch हो → webhook के ज़रिए broker/bot में auto order लग जाएगा।
SL और Target levels भी इसी तरह alerts से manage होंगे।
Use Case:
Manual level-based intraday या positional trading
Automated trading setup (via TradingView alerts → Webhook → Broker API)
Put/Call entry, target, SL को clearly visualize और monitor करना
Disclaimer:
यह indicator trading automation tool नहीं है। Actual buy/sell orders Pine Script से नहीं लग सकते। Order execution केवल TradingView Alerts और external webhook के integration से ही possible है। कृपया पहले paper-trade और test करें।
RedFlagCounter-trend strategy
Condition to open a long position:
Buys if the price drops by a specified percentage from the previous candle’s close. Only one purchase can be made within a single candle.
Condition to close a position:
Places a separate individual closing limit order for each purchase, or uses one common take-profit order for the whole position.
⚠️ Attention : Stop-loss is not implemented in the current first version of the strategy.
Options description:
Drop_percent , % — Percentage drop in price from the From point
From — The reference point on the closed candle from which the Drop_percent is calculated (Open, Close, High, Low)
Tp , % — Take-profit level as a percentage
Count — Number of allowed additional purchases (scaling in)
Each_tp — Mode switch:
True — a separate take-profit is placed for each purchase
False — one common take-profit is placed based on the average entry price of the position
All-In-One MA Stack ScalperWhat is this Indicator?
This tool is an advanced, multi-layered breakout and trend-following indicator designed for lower timeframes. It identifies high-conviction buy and sell signals by combining moving average stacking with a suite of professional-grade filters.
How Does It Work?
A signal is generated only when ALL of the following conditions are met:
Moving Average Stack (5M Chart):
Buy: The close price is above all five moving averages (MAs: 100, 48, 36, 24, 12).
Sell: The close price is below all five MAs.
Volatility Filter (ATR):
Signals only print when the current ATR (14) is at least 80% of its 100-period average, ensuring you only trade in actively moving markets.
Candle Structure Filter:
The current candle must have a real body that is at least 35% of the candle’s total range, filtering out dojis and indecision bars.
Big Candle Filter:
The candle’s total range must be at least 40% of the current ATR, avoiding signals on minor, insignificant moves.
Volume Filter:
The current volume must be at least 80% of its 50-period average, filtering out signals during illiquid or quiet market conditions.
Minimum Distance from All MAs:
Price must be a minimum distance (20% ATR) away from each MA, confirming a clean breakout and avoiding signals in tight MA clusters or ranging markets.
RSI Momentum Filter:
Buy: RSI(14) must be greater than 55.
Sell: RSI(14) must be less than 45.
This ensures trades are only taken in the direction of momentum.
ADX Trend Filter:
ADX(14,14) must be above 20, ensuring signals only print in trending conditions (not in chop/range).
Minimum Bars Between Signals:
Only one signal per direction is allowed every 10 bars to avoid overtrading and signal clustering.
What Does This Achieve?
Reduces noise and false signals common in basic MA cross or stack systems.
Captures only strong, high-momentum, and high-conviction moves.
Helps you avoid chop, range, and news whipsaws by combining multiple market filters.
Perfect for advanced scalpers, intraday trend followers, or as a trade filter for algos/EAs.
How to Use It:
Apply to your 5-minute chart.
Green BUY signals: Only when all bullish conditions align.
Red SELL signals: Only when all bearish conditions align.
Use as a stand-alone system or as a filter for your own entries.
Recommended For:
Scalpers & intraday traders who want only the best opportunities.
EA and bot builders seeking reliable signal logic.
Manual traders seeking confirmation of high-probability breakouts.
Tip:
Adjust any of the filters (e.g., RSI/ADX thresholds, minBars, minDist) to make it more/less selective for your style or market.
hh ema 2 (No TP)hi, my first strategy. Only btc. it will be idea for btc. and it can use for bot system.
My script//@version=5
strategy("Algo Bot Starter (EMA+ATR, RR, Webhook)",
overlay=true,
initial_capital=10000,
commission_type=strategy.commission.percent,
commission_value=0.02,
calc_on_every_tick=false,
calc_on_order_fills=true,
pyramiding=0,
process_orders_on_close=true)
//================ Inputs ================
emaFastLen = input.int(20, "EMA Fast", minval=1)
emaSlowLen = input.int(50, "EMA Slow", minval=1)
atrLen = input.int(14, "ATR Length", minval=1)
atrMultSL = input.float(2.0, "SL = ATR x", step=0.1)
rr = input.float(1.5, "Risk:Reward (TP = RR x Risk)", step=0.1, minval=0.2)
riskPct = input.float(1.0, "Risk % per Trade", step=0.1, minval=0.1, maxval=5)
slipPips = input.float(0.0, "Extra buffer (price units)", step=0.0001)
sessionFilt = input.session("0000-2400", "Trading Session")
useSession = input.bool(false, "Use Session Filter?")
closeOnFlip = input.bool(true, "Close & Reverse on signal flip?")
useBarClose = input.bool(true, "Signal on Bar Close? (recommended)")
//================ Helpers ================
inSess = useSession ? time(timeframe.period, sessionFilt) : true
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)
atr = ta.atr(atrLen)
// Cross conditions (optionally on bar close)
bull = useBarClose ? ta.crossover(emaFast, emaSlow) : ta.cross(emaFast, emaSlow) and (emaFast > emaSlow)
bear = useBarClose ? ta.crossunder(emaFast, emaSlow) : ta.cross(emaFast, emaSlow) and (emaFast < emaSlow)
//================ Risk & Position Sizing ================
// ملاحظة: TradingView ما يعرف رصيدك الحقيقي، فاعتمدنا على initial_capital أو عدّل أدناه يدويًا
equity = strategy.equity
riskAmount = equity * (riskPct/100.0)
// سنحسب الكمية حسب المسافة إلى وقف الخسارة بالوحدات السعرية (تقريب عام)
calcQty(entryPrice, slPrice) =>
riskPerUnit = math.abs(entryPrice - slPrice)
riskPerUnit := risk
Trend River Pullback (Avramis-style) v1//@version=5
strategy("Trend River Pullback (Avramis-style) v1",
overlay=true, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0.02,
pyramiding=0, calc_on_order_fills=true, calc_on_every_tick=true, margin_long=1, margin_short=1)
// ===== Inputs
// EMA "река"
emaFastLen = input.int(8, "EMA1 (быстрая)")
ema2Len = input.int(13, "EMA2")
emaMidLen = input.int(21, "EMA3 (средняя)")
ema4Len = input.int(34, "EMA4")
emaSlowLen = input.int(55, "EMA5 (медленная)")
// Откат и импульс
rsiLen = input.int(14, "RSI длина")
rsiOB = input.int(60, "RSI порог тренда (лонг)")
rsiOS = input.int(40, "RSI порог тренда (шорт)")
pullbackPct = input.float(40.0, "Глубина отката в % ширины реки", minval=0, maxval=100)
// Риск-менеджмент
riskPct = input.float(1.0, "Риск на сделку, % от капитала", step=0.1, minval=0.1)
atrLen = input.int(14, "ATR длина (стоп/трейлинг)")
atrMultSL = input.float(2.0, "ATR множитель для стопа", step=0.1)
tpRR = input.float(2.0, "Тейк-профит R-множитель", step=0.1)
// Трейлинг-стоп
useTrail = input.bool(true, "Включить трейлинг-стоп (Chandelier)")
trailMult = input.float(3.0, "ATR множитель трейлинга", step=0.1)
// Торговые часы (по времени биржи TradingView символа)
useSession = input.bool(false, "Ограничить торговые часы")
sessInput = input.session("0900-1800", "Сессия (локальная для биржи)")
// ===== Calculations
ema1 = ta.ema(close, emaFastLen)
ema2 = ta.ema(close, ema2Len)
ema3 = ta.ema(close, emaMidLen)
ema4 = ta.ema(close, ema4Len)
ema5 = ta.ema(close, emaSlowLen)
// "Река": верх/низ как конверт по средним
riverTop = math.max(math.max(ema1, ema2), math.max(ema3, math.max(ema4, ema5)))
riverBot = math.min(math.min(ema1, ema2), math.min(ema3, math.min(ema4, ema5)))
riverMid = (riverTop + riverBot) / 2.0
riverWidth = riverTop - riverBot
// Трендовые условия: выстроенность EMAs
bullAligned = ema1 > ema2 and ema2 > ema3 and ema3 > ema4 and ema4 > ema5
bearAligned = ema1 < ema2 and ema2 < ema3 and ema3 < ema4 and ema4 < ema5
// Импульс
rsi = ta.rsi(close, rsiLen)
// Откат внутрь "реки"
pullbackLevelBull = riverTop - riverWidth * (pullbackPct/100.0) // чем больше %, тем глубже внутрь
pullbackLevelBear = riverBot + riverWidth * (pullbackPct/100.0)
pullbackOkBull = bullAligned and rsi >= rsiOB and low <= pullbackLevelBull
pullbackOkBear = bearAligned and rsi <= rsiOS and high >= pullbackLevelBear
// Триггер входа: возврат в импульс (пересечение быстрой EMA)
longTrig = pullbackOkBull and ta.crossover(close, ema1)
shortTrig = pullbackOkBear and ta.crossunder(close, ema1)
// Сессия
inSession = useSession ? time(timeframe.period, sessInput) : true
// ATR для стопов
atr = ta.atr(atrLen)
// ===== Position sizing по риску
// Расчет размера позиции: риск% от капитала / (стоп в деньгах)
capital = strategy.equity
riskMoney = capital * (riskPct/100.0)
// Предварительные уровни стопов
longSL = close - atrMultSL * atr
shortSL = close + atrMultSL * atr
// Цена тика и размер — приблизительно через syminfo.pointvalue (может отличаться на разных рынках)
tickValue = syminfo.pointvalue
// Избежать деления на 0
slDistLong = math.max(close - longSL, syminfo.mintick)
slDistShort = math.max(shortSL - close, syminfo.mintick)
// Кол-во контрактов/лотов
qtyLong = riskMoney / (slDistLong * tickValue)
qtyShort = riskMoney / (slDistShort * tickValue)
// Ограничение: не меньше 0
qtyLong := math.max(qtyLong, 0)
qtyShort := math.max(qtyShort, 0)
// ===== Entries
if inSession and longTrig and strategy.position_size <= 0
strategy.entry("Long", strategy.long, qty=qtyLong)
if inSession and shortTrig and strategy.position_size >= 0
strategy.entry("Short", strategy.short, qty=qtyShort)
// ===== Exits: фиксированный TP по R и стоп
// Храним цену входа
var float entryPrice = na
if strategy.position_size != 0 and na(entryPrice)
entryPrice := strategy.position_avg_price
if strategy.position_size == 0
entryPrice := na
// Цели
longTP = na(entryPrice) ? na : entryPrice + tpRR * (entryPrice - longSL)
shortTP = na(entryPrice) ? na : entryPrice - tpRR * (shortSL - entryPrice)
// Трейлинг: Chandelier
trailLong = close - trailMult * atr
trailShort = close + trailMult * atr
// Итоговые уровни выхода
useTrailLong = useTrail and strategy.position_size > 0
useTrailShort = useTrail and strategy.position_size < 0
// Для лонга
if strategy.position_size > 0
stopL = math.max(longSL, na) // базовый стоп
tStop = useTrailLong ? trailLong : longSL
// Выход по стопу/трейлу и ТП
strategy.exit("L-Exit", from_entry="Long", stop=tStop, limit=longTP)
// Для шорта
if strategy.position_size < 0
stopS = math.min(shortSL, na)
tStopS = useTrailShort ? trailShort : shortSL
strategy.exit("S-Exit", from_entry="Short", stop=tStopS, limit=shortTP)
// ===== Visuals
plot(ema1, "EMA1", display=display.all, linewidth=1)
plot(ema2, "EMA2", display=display.all, linewidth=1)
plot(ema3, "EMA3", display=display.all, linewidth=2)
plot(ema4, "EMA4", display=display.all, linewidth=1)
plot(ema5, "EMA5", display=display.all, linewidth=1)
plot(riverTop, "River Top", style=plot.style_linebr, linewidth=1)
plot(riverBot, "River Bot", style=plot.style_linebr, linewidth=1)
fill(plot1=plot(riverTop, display=display.none), plot2=plot(riverBot, display=display.none), title="River Fill", transp=80)
plot(longTP, "Long TP", style=plot.style_linebr)
plot(shortTP, "Short TP", style=plot.style_linebr)
plot(useTrailLong ? trailLong : na, "Trail Long", style=plot.style_linebr)
plot(useTrailShort ? trailShort : na, "Trail Short", style=plot.style_linebr)
// Маркеры сигналов
plotshape(longTrig, title="Long Trigger", style=shape.triangleup, location=location.belowbar, size=size.tiny, text="L")
plotshape(shortTrig, title="Short Trigger", style=shape.triangledown, location=location.abovebar, size=size.tiny, text="S")
// ===== Alerts
alertcondition(longTrig, title="Long Signal", message="Long signal: trend aligned + pullback + momentum")
alertcondition(shortTrig, title="Short Signal", message="Short signal: trend aligned + pullback + momentum")
Support and Resistance levels from Options DataINTRODUCTION
This script is designed to visualize key support and resistance levels derived from options data on TradingView charts. It overlays lines, labels, and boxes to highlight levels such as Put Walls (gamma support), Call Walls (gamma resistance), Gamma Flip points, Vanna levels, and more.
These levels are intended to help traders identify potential areas of price magnetism, reversal, or breakout based on options market dynamics. All calculations and visualizations are based on user-provided data pasted into the input field, as Pine Script cannot directly fetch external options data due to platform limitations (explained below).
For convenience, my website allows users to interact with a bot that will generate the string for up to 30 tickers at once getting nearly real-time data on demand (data is cached for 15min). With the output string pasted into this indicator, it's a bliss to shuffle through your portfolio and see those levels for each ticker.
The script is open-source under TradingView's terms, allowing users to study, modify, and improve it. It draws inspiration from common options-derived metrics like gamma exposure and vanna, which are widely discussed in financial literature. No external code is copied without rights; all logic is original or based on standard mathematical formulas.
How the Options Levels Are Calculated
The levels displayed by this script are not computed within Pine Script itself—instead, they rely on pre-calculated values provided by the user (via a pasted data string). These values are derived from options chain data fetched from financial APIs (e.g., using libraries like yfinance in Python). Here's a step-by-step overview of how these levels are generally calculated externally before being input into the script:
Fetching Options Data:
Historical and current options chain data for a ticker (e.g., strikes, open interest, volume, implied volatility, expirations) is retrieved for near-term expirations (e.g., up to 90 days).
Current stock price is obtained from recent history.
Gamma Support (Put Wall) and Resistance (Call Wall):
Gamma Calculation: For each option, gamma (the rate of change of delta) is computed using the Black-Scholes formula:
gamma = N'(d1) / (S * sigma * sqrt(T))
where S is the stock price, K is the strike, T is time to expiration (in years), sigma is implied volatility, r is the risk-free rate (e.g., 0.0445), and N'(d1) is the normal probability density function.
Weighted gamma is multiplied by open interest and aggregated by strike.
The Put Wall is the strike below the current price with the highest weighted gamma from puts (acting as support).
The Call Wall is the strike above the current price with the highest weighted gamma from calls (acting as resistance).
Short-term versions focus on strikes closer to the money (e.g., within 10-15% of the price).
Gamma Flip Level:
Net dealer gamma exposure (GEX) is calculated across all strikes:
GEX = sum (gamma * OI * 100 * S^2 * sign * decay)
where sign is +1 for calls/-1 for puts, and decay is 1 / sqrt(T).
The flip point is the price where net GEX changes sign (from positive to negative or vice versa), interpolated between strikes.
Vanna Levels:
Vanna (sensitivity of delta to volatility) is calculated:
vanna = -N'(d1) * d2 / sigma
where d2 = d1 - sigma * sqrt(T).
Weighted by open interest, the highest positive and negative vanna strikes are identified.
Other Levels:
S1/R1: Significant strikes with high combined open interest and volume (80% OI + 20% volume), below/above price for support/resistance.
Implied Move: ATM implied volatility scaled by S * sigma * sqrt(d/365) (e.g., for 7 days).
Call/Put Ratio: Total call contracts divided by put contracts (OI + volume).
IV Percentage: Average ATM implied volatility.
Options Activity Level: Average contracts per unique strike, binned into levels (0-4).
Stop Loss: Dynamically set below the lowest support (e.g., Put Wall, Gamma Flip), adjusted by IV (tighter in low IV).
Fib Target: 1.618 extension from Put Wall to Call Wall range.
Previous day levels are stored for comparison (e.g., to detect Call Wall movement >2.5% for alerts).
Effect as Support and Resistance in Technical Trading
Options levels like gamma walls influence price action due to market maker hedging:
Put Wall (Gamma Support): High put gamma below price creates a "magnet" effect—market makers buy stock as price falls, providing support. Traders might look for bounces here as entry points for longs.
Call Wall (Gamma Resistance): High call gamma above price leads to selling pressure from hedging, acting as resistance. Rejections here could signal trims, sells or even shorts.
Gamma Flip: Where gamma exposure flips sign, often a volatility pivot—crossing it can accelerate moves (bullish above, bearish below).
Vanna Levels: Positive/negative vanna indicate volatility sensitivity; crosses may signal regime shifts.
Implied Move: Shows expected range; prices outside suggest overextension.
S1/R1 and Fib Target: Volume/OI clusters act as classic S/R; Fib extensions project upside targets post-breakout.
In trading, these are not guarantees—combine with TA (e.g., volume, trends). High activity levels imply stronger effects; low CP ratio suggests bearish sentiment. Alerts trigger on proximities/crosses for awareness, not advice.
Limitations of the TradingView Platform for Data Pulling
TradingView's Pine Script is sandboxed for security and performance:
No direct internet access or API calls (e.g., can't fetch yfinance data in-script).
Limited to chart data/symbol info; no real-time options chains.
Inputs are static per load; updates require manual pasting.
Caching isn't persistent across sessions.
This prevents dynamic data pulling, ensuring scripts remain lightweight but requiring external tools for fresh data.
Creative Solution for On-Demand Data Pulling
To overcome these limitations, users can use external tools or scripts (e.g., Python-based) to fetch and compute levels on demand. The tool processes tickers, generates a formatted string (e.g., "TICKER:level1,level2,...;TIMESTAMP:unix;"), and users paste it into the script's input. This keeps data fresh without violating platform rules, as computation happens off-platform. For example, run a local script to query APIs and output the string—adaptable for any ticker.
Script Functionality Breakdown
Inputs: Custom data string (parsed for levels/timestamp); toggles for short-term/previous/Vanna/stop loss; style options (colors, transparency).
Parsing: Extracts levels for the chart symbol; gets timestamp for "updated ago" display.
Drawing: Lines/labels for levels; boxes for gamma zones/implied move; clears old elements on updates.
Info Panel: Top-right summary with metrics (CP ratio, IV, distances, activity); emojis for quick status.
Alerts: Conditions for proximities, crosses, bounces (e.g., 0.5% bounce from Put Wall).
Performance: Uses vars for persistence; efficient for real-time.
This script is educational—test thoroughly. Not financial advice; past performance isn't indicative of future results. Feedback welcome via TradingView comments.