RSI / Stoch / SRSI / MFI / Aroon Overlay [SigmaDraconis]Combines 4 popular indicators (RSI, Stoch, SRSI, MFI) and 1 peculiar one (Aroon) in 1 for those who want to save indicators but not only.
This is an evolution of my (simpler) "RSI / Stoch / Stoch RSI (SRSI) Overlay " that you can find on my scripts.
Added bands for oversold/overbought areas (70/30 common for RSI and 80/20 for SRSI and MFI), as well as a middle 50 horizontal line.
Neutral bands around 55-45 added as well that can be hidden for less clutter. I also recommend a more transparent coloring for these since Pine script doesn't allow default transparency for horizontal lines.
By default only RSI and Stoch are activated, you can activate Aroon, MFI and SRSI on the inputs window.
Some extra notes:
* RSI, Stoch and MFI can help to strengthen one's decision as well as Aroon to predict a possible trend reversal, SRSI can show when RSI has high probability of being topped or bottomed when oversold/overbought but don't forget to look at volume and how the trend progresses that can keep SRSI above 80 or below 20 while RSI and price continues to trend, divergences are most helpful here to find possible reversal areas.
* This chart depicts some interesting divergences, as well as Stoch tops and bottoms and confluences between RSI/MFI and Stoch on some over-extended tops and bottoms that shown being good reversal zones.
RSI resistances are shown as well, failing to break above 60 or the neutral zone (this is a bearish BTC trend chart after all) or failing to gain support to break up certain levels (RSI notes a more bullish trend when consistently above 60 and more bearish below 40).
If you like it and use it to profit, please tip me below :)
Tip jars:
BTC: 15nMBiEGVrdGcu9C1h6QRcTNRvugHkqrMQ
ETH: 0xC33845946c48B61fBCbEA0367ec2238CaF2b73bc
BTS: sigma-draconis
在腳本中搜尋"股价站上60月线"
Chop and explodeThe purpose of this script is to decipher chop zones from runs/movement/explosion
The chop is RSI movement between 40 and 60
tight chop is RSI movement between 45 and 55. There should be an explosion after RSI breaks through 60 (long) or 40 (short). Tight chop bars are colored black, a series of black bars is tight consolidation and should explode imminently. The longer the chop the longer the explosion will go for. tighter the better.
Loose chop (whip saw/yellow bars) will range between 40 and 60.
the move begins with blue bars for long and purple bars for short.
Couple it with your trading system to help stay out of chop and enter when there is movement. Use with "Simple Trender."
Best of luck in all you do. Get money.
Build A BotThis is the Robot we built during the 60 Minute Build-A-Bot webinar on September 12, 2018. We had a great time, and a lot of participation and the best part was that we finished up this robot and even ran a backtest in exactly 60 minutes! We built this robot based on recommendations and suggestions from those who were attending live. Lots of pieces in this robot, but you can always tinker with it, remove stuff, add things, whatever you want!
This version uses the CCI as a trigger for trade entry. The other version uses the Hull Moving Average as a trigger for trade entry.
Volume Zone Oscillator and Price Zone (VZO/PZO) [NeoButane]" Volume Precedes Price is the conceptual idea for the oscillator."
"The main idea of the VZO was to try to change the OBV to look like an oscillator rather than an indicator, also to include time; primarily to identify which zone the volume is located in during a specific period "
How to read this indicator:
Positive reading -> bullish
Negative reading -> bearish
-60 or 60 is seen as the limit of the oscillator range, and a pullback should be expected from there.
Plus and minus signs have been added to the top and bottom for VZO and PZO, with an adjustable threshold to trigger.
Alert conditions have been added to this indicator for ease of use.
Volume Zone Oscillator, write-up by the author (recommended reading)
http:capitalsynergy.com/resources/IFTA09VZO.pdf
Volume Zone Oscillator, uses and formula
https:www.investopedia.com/articles/active-trading/072815/how-interpret-volume-zone-oscillator.asp
Price Zone Oscillator, uses and formula
https:www.investopedia.com/terms/p/price-zone-oscillator.asp
Fib,Guppy Multiple MA(FGMMA)(A/D & Volume Weight,SMA,EMA)[cI8DH]Features:
- 3 + 12 MAs (12 is chosen because Guppy has 12 MAs)
- MA types can be set to Simple, Exponential, Weighted, and Smoothed
- Volume weight can be applied to all available MAs (the built-in VWMA uses Simple MA)
- It is possible to count in only effective portions of the volume in the equation by using Accum/Dist Volume Weight
- Secondary smoothing (useful when volume weight is enabled)
- Predefined MA sets based on Fibonacci sequence (2,3,5,8,.., 377), Guppy (3,5,8,10,12,15 &30,35,40,45,50,60), and cI8DH (2,3,5,8,12,17 & 30,34,39,45,52,60)
Recommended settings:
- hlc3 as input source captures all the essential information encapsulated in a candle. I'd use hlc3 as the default option. In uptrend, "low" and in downtrend, "high" might give more relevant results when using MAs for structural analysis of a market. For commonly used MAs (EMA20, SMA50,100,200), "close" should be used due to their self-fulfilling prophecy effect.
- When you have volume weight above 0, you may want to use secondary smoothing.
- Try not to use Simple MA for smaller lengths (below 20). Sharp changes in the past (right before the period specified by the length) will affect the current value of MA dramatically leading to confusion.
- I am using the first 3 MAs for SMA 50,100,200. You can disable them from the MA type selector all at once when using Fib or Guppy ribbons.
MA-based analysis:
There are different ways of structuring a market. Geometrical (trend lines, channels, fans, patterns, etc) and Fib retracement-based structuring is very common among traders. MAs give an alternative way of analyzing markets. MA ribbons such as Guppy (6 slow and 6 fast-moving MAs) are popular for analyzing market flow. IMO default Guppy sets are a bit random as the numbers do not have an elegant sequence. So I proposed my sets based on increasing sequene spacing (+1). These two MA ribbons are good for market flow analysis but the spacing of the MAs are not ideal for structuring a market. Ribbons based on the Fib sequence is a better choice for structuring a market. This is the equivalent of Fib channels but in a more dynamic form. Among other things, MA Fib ribbon can be used to assess market momentum and to compare different stages of a market. Here are two "educational-only" examples:
Notes:
- Smoothed MA with length L = Exponential MA with length 2*L-1
- Read the background section in my ADP indicator to understand how A/D Volume is calculated
Better RSI with bullish / bearish market cycle indicator This script improves the default RSI. First. it identifies regions of the RSI which are oversold and overbought by changing the color of RSI from white to red. Second, it adds additional reference lines at 20,40,50,60, and 80 to better gauge the RSI value. Finally, the coolest feature, the middle 50 line is used to indicate which cycle the price is currently at. A green color at the 50 line indicates a bullish cycle, a red color indicators a bearish cycle, and a white color indicates a neutral cycle.
The cycles are determined using the RSI as follows:
if RSI is overbought, cycle switches to bullish until RSI falls below 40, at which point it becomes neutral
if RSI is oversold, cycle switches bearish until RSI rises above 60, at which point it becomes neutral
a neutral cycle is exited at either overbought or oversold conditions
Very useful, please give it a try and let me know what you think
MG - Multiple time frame Stochastic RSIAllows user to view stochastic RSI from two different time frames.
Each stochastic RSI indicator is fully customizable, offering the following options:
- Timeframe
- RSI source
- RSI length
- Stochastic length
- Stochastic average length
- Stochastic smoothing length
Usage:
Comparing stochastic RSI across two different time frames can sharpen trades. For example, if you configure a 60 min and 5/15 min stochastic RSI pair, you might enter a long trade when the 60 min stoch RSI crosses up and exit / take profit when the 5 min stock RSI crosses down.
NG [Simple Harmonic Oscillator]The SHO is a bounded oscillator for the simple harmonic index that calculates the period of the market’s cycle.
The oscillator is used for short and intermediate terms and moves within a range of -100 to 100 percent.
The SHO has overbought and oversold levels at +40 and -40, respectively.
At extreme periods, the oscillator may reach the levels of +60 and -60.
The zero level demonstrates an equilibrium between the periods of bulls and bears.
The SHO oscillates between +40 and -40.
The crossover at those levels creates buy and sell signals.
In an uptrend, the SHO fluctuates between 0 and +40 where the bulls are controlling the market.
On the contrary, the SHO fluctuates between 0 and -40 during downtrends where the bears controlthe market.
Reaching the extreme level -60 in an uptrend is a sign of weakness.
Ichimoku Cloud w/SelIchimoku Cloud with selection for:
Regular:
conversionPeriods = 9,
basePeriods = 26
laggingSpan2Periods = 52,
displacement = 26
Crypto:
conversionPeriods = 10,
basePeriods = 30,
laggingSpan2Periods = 60,
displacement = 30
Crypto Doubled:
conversionPeriods = 20,
basePeriods = 60,
laggingSpan2Periods = 120,
displacement = 30
3 Linear Regression CurveFast 3LRC - 15/30/60 standard settings - 15/30 give a lot of noise, but give you a some time to prepare for the 60 to flip
DEMA Double Exponential Moving Average Strategy@Moneros 2017
Based on The DEMA is a fast-acting moving average that is more responsive to market changes than a traditional moving average
en.wikipedia.org
!!!! IN ORDER TO AVOID REPAITING ISSUES !!!!
!!!! DO NOT VIEW IN LOWER RESOLUTIONS THAN res/2 PARAMETER !!!!
for example res = 120 view >= 60m res = 60 view >= 30m
the length of the DEMA sampling shouldn't be longer than a candle
Best profits tested on BTCUSD
res = 105 slowPeriod = 2 fastPeriod = 32
res = 125 slowPeriod = 3 fastPeriod = 21
res = 120 slowPeriod = 2 fastPeriod = 32
res = 130 slowPeriod = 1 fastPeriod = 24
res = 40 slowPeriod = 4 fastPeriod = 93
res = 60 slowPeriod = 1 fastPeriod = 67
BTCUSD
RSI in Bull and Bear Market V2.0RSI oversold at 60/40 in bullish market
And Overbought at 40/60 in Bearish market
for more info of this Strategy
WaveTrend [MastroFran]Great indicator to show short term price movements. 5 day moving average oscillator. When green crosses red and under the 60 mark, buy with caution. when over the 60 mark and red crosses green sell immediately for highest profits.
Hersheys CoCo VolumeCoCo Volume shows you volume movement of your symbol after subtracting the movement from another symbol, preferrably the sector or market the stock belongs to.
My latest update to my CoCoVolume Indicator. It calculates today's volume percent over the 60 period average for both your symbol and index, and displays that difference. If the percent is over the max it highlights the color, showing BIG action for that stock.
The last version was calculating the percent volume difference from yesterday to today for the stock and index and displaying the difference. The prior method had large swings on low volume stocks... this one shows the independent volume action much better. The default values will suit most stocks.
You can set three variables...
- the index symbol, default is SPY
- the period for averaging, default is 60
- the max volume percent, default is 500
Good trading!
Brian Hershey
close-hl2 Price actionStill not tested, but looks very good ; it is the difference between EMA median price and EMA close in different time frame, I used 240, 60, and the current Time frame ,plus one more customed period ; can forcast the price movement , but it s not in scale, so it can not show how much higher or lower the price can goes but just the next direction. I think intraday on 5 ,15 ,60 better then high frame.If you need to try on Daily frame have to change the period to higher then Daily
Everyday 0002 _ MAC 1st Trading Hour WalkoverThis is the second strategy for my Everyday project.
Like I wrote the last time - my goal is to create a new strategy everyday
for the rest of 2016 and post it here on TradingView.
I'm a complete beginner so this is my way of learning about coding strategies.
I'll give myself between 15 minutes and 2 hours to complete each creation.
This is basically a repetition of the first strategy I wrote - a Moving Average Crossover,
but I added a tiny thing.
I read that "Statistics have proven that the daily high or low is established within the first hour of trading on more than 70% of the time."
(source: )
My first Moving Average Crossover strategy, tested on VOLVB daily, got stoped out by the volatility
and because of this missed one nice bull run and a very nice bear run.
So I added this single line: if time("60", "1000-1600") regarding when to take exits:
if time("60", "1000-1600")
strategy.exit("Close Long", "Long", profit=2000, loss=500)
strategy.exit("Close Short", "Short", profit=2000, loss=500)
Sweden is UTC+2 so I guess UTC 1000 equals 12.00 in Stockholm. Not sure if this is correct, actually.
Anyway, I hope this means the strategy will only take exits based on price action which occur in the afternoon, when there is a higher probability of a lower volatility.
When I ran the new modified strategy on the same VOLVB daily it didn't get stoped out so easily.
On the other hand I'll have to test this on various stocks .
Reading and learning about how to properly test strategies is on my todo list - all tips on youtube videos or blogs
to read on this topic is very welcome!
Like I said the last time, I'm posting these strategies hoping to learn from the community - so any feedback, advice, or corrections is very much welcome and appreciated!
/pbergden
Previous candle - D-T.R.A.D.I.N.G//@version=6
indicator("Previous candle - byDen (Body % line & Wick size) ", overlay=true, max_boxes_count=200, max_lines_count=200, max_labels_count=200)
// ---------------- Inputs ----------------
showHighLow = input.bool(true, "Show High/Low lines")
showHLBox = input.bool(true, "Show High-Low Box (full range)")
showMidLine = input.bool(true, "Show Middle Line")
showCloseLine = input.bool(true, "Show Close Line")
showBodyPct = input.bool(true, "Show Body % Line")
enableWickBox = input.bool(true, "Show Wick-Body Box (previous candle)")
keepLastWick = input.bool(false, "Keep last Wick-Box when disabled")
bodyPct = input.float(25.0, "Body % Level", step=0.1, minval=0.0, maxval=100.0)
// colors / styles
cHighLow = input.color(color.white, "H/L Line Color")
hlStyleStr = input.string("solid", "H/L Style", options= )
hlWidth = input.int(1, "H/L Width", minval=1, maxval=5)
cMid = input.color(color.yellow, "Mid Line Color")
midStyleStr = input.string("dashed", "Mid Style", options= )
midWidth = input.int(1, "Mid Width", minval=1, maxval=5)
cClose = input.color(color.yellow, "Close Line Color")
closeStyleStr = input.string("dotted", "Close Style", options= )
closeWidth = input.int(1, "Close Width", minval=1, maxval=5)
cBoxBorder = input.color(color.red, "HL Box Border")
cBoxFill = color.new(input.color(color.gray, "HL Box Fill"), 85)
cBullBox = color.new(input.color(color.green, "Bull WickBox"), 80)
cBearBox = color.new(input.color(color.red, "Bear WickBox"), 80)
cWboxBorder = input.color(color.white, "WickBox Border")
cBodyPct = input.color(color.blue, "Body % Line Color")
bodyPctStyle = input.string("dashed", "Body % Line Style", options= )
bodyPctWidth = input.int(1, "Body % Line Width", minval=1, maxval=5)
// table colors / pip size
cPipBox = input.color(color.new(color.blue, 80), "Table Background Color")
cPipText = input.color(color.white, "Table Text Color")
pipSize = input.float(0.1, "Pip size (XAUUSD=0.1)", step=0.01)
wickLabelText = input.string("Wick", "Opis za wick")
bodyLabelText = input.string("H/L-Body%", "Opis za H/L-Body%")
descFontSizeStr = input.string("small", "Table Description Font Size", options= )
valFontSizeStr = input.string("normal", "Table Value Font Size", options= )
// custom texts for line labels
txtHigh = input.string("High", "Label Text - High")
txtLow = input.string("Low", "Label Text - Low")
txtMid = input.string("Mid", "Label Text - Mid")
txtClose = input.string("Close", "Label Text - Close")
txtBody = input.string("Body%", "Label Text - Body %")
lineFontSizeStr = input.string("small", "Line Label Font Size", options= )
lineLabelPos = input.string("above", "Line Label Position", options= )
lineLabelAlign = input.string("center", "Line Label Align", options= )
// ---------------- Candle Display Options ----------------
highDisplay = input.string("Both", "High Line Display", options= )
lowDisplay = input.string("Both", "Low Line Display", options= )
midDisplay = input.string("Both", "Mid Line Display", options= )
closeDisplay = input.string("Both", "Close Line Display", options= )
bodyDisplay = input.string("Both", "Body % Line Display", options= )
hlBoxDisplay = input.string("Both", "HL Box Display", options= )
wickBoxDisplay = input.string("Both", "Wick Box Display", options= )
// timeframe filter
enabledTFs = input.string("1,5,15,30,60,240,D", "Enable on timeframes")
// ---------------- Helpers ----------------
is_tf_enabled(tfStr) =>
str.contains("," + enabledTFs + ",", "," + tfStr + ",")
line_style_from_str(s) =>
s == "dotted" ? line.style_dotted : s == "dashed" ? line.style_dashed : line.style_solid
get_font_size(fs) =>
fs == "tiny" ? size.tiny : fs == "small" ? size.small : fs == "large" ? size.large : fs == "huge" ? size.huge : size.normal
get_label_style(a) =>
a == "left" ? label.style_label_left : a == "right" ? label.style_label_right : label.style_label_center
get_y_pos(basePrice, pos) =>
pos == "above" ? basePrice + (syminfo.mintick * 10) : basePrice - (syminfo.mintick * 10)
// ---------------- Data ----------------
tf = timeframe.period
= request.security(syminfo.tickerid, tf, , lookahead=barmerge.lookahead_off)
midLevel = (prevH + prevL) / 2
isBull = prevC > prevO
// ---------------- Persistent ----------------
var line lHigh = na
var line lLow = na
var line lMid = na
var line lClose = na
var line lBodyPct = na
var box bHL = na
var box wickBox = na
var table wickTable = na
var label labHigh = na
var label labLow = na
var label labMid = na
var label labClose = na
var label labBodyPct = na
offsetBars = input.int(20, "Bars right", minval=1, maxval=500)
leftX_base = bar_index
rightX_base = bar_index + offsetBars
if na(wickTable)
wickTable := table.new(position.bottom_right, 2, 2, border_width=1, frame_color=color.white)
// ---------------- DRAW ----------------
if barstate.isconfirmed and is_tf_enabled(tf)
// delete previous labels
if not na(labHigh)
label.delete(labHigh)
labHigh := na
if not na(labLow)
label.delete(labLow)
labLow := na
if not na(labMid)
label.delete(labMid)
labMid := na
if not na(labClose)
label.delete(labClose)
labClose := na
if not na(labBodyPct)
label.delete(labBodyPct)
labBodyPct := na
// --- DRAW HIGH ---
drawHigh = (highDisplay=="Both") or (highDisplay=="Bullish" and isBull) or (highDisplay=="Bearish" and not isBull)
if showHighLow and drawHigh
if not na(lHigh)
line.delete(lHigh)
lHigh := line.new(leftX_base, prevH, rightX_base, prevH, xloc=xloc.bar_index, color=cHighLow, width=hlWidth, style=line_style_from_str(hlStyleStr))
labHigh := label.new(rightX_base, get_y_pos(prevH,lineLabelPos), txtHigh, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cHighLow, size=get_font_size(lineFontSizeStr))
// --- DRAW LOW ---
drawLow = (lowDisplay=="Both") or (lowDisplay=="Bullish" and isBull) or (lowDisplay=="Bearish" and not isBull)
if showHighLow and drawLow
if not na(lLow)
line.delete(lLow)
lLow := line.new(leftX_base, prevL, rightX_base, prevL, xloc=xloc.bar_index, color=cHighLow, width=hlWidth, style=line_style_from_str(hlStyleStr))
labLow := label.new(rightX_base, get_y_pos(prevL,lineLabelPos), txtLow, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cHighLow, size=get_font_size(lineFontSizeStr))
// --- DRAW MID ---
drawMid = (midDisplay=="Both") or (midDisplay=="Bullish" and isBull) or (midDisplay=="Bearish" and not isBull)
if showMidLine and drawMid
if not na(lMid)
line.delete(lMid)
lMid := line.new(leftX_base, midLevel, rightX_base, midLevel, xloc=xloc.bar_index, color=cMid, width=midWidth, style=line_style_from_str(midStyleStr))
labMid := label.new(rightX_base, get_y_pos(midLevel,lineLabelPos), txtMid, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cMid, size=get_font_size(lineFontSizeStr))
// --- DRAW CLOSE ---
drawClose = (closeDisplay=="Both") or (closeDisplay=="Bullish" and isBull) or (closeDisplay=="Bearish" and not isBull)
if showCloseLine and drawClose
if not na(lClose)
line.delete(lClose)
lClose := line.new(leftX_base, prevC, rightX_base, prevC, xloc=xloc.bar_index, color=cClose, width=closeWidth, style=line_style_from_str(closeStyleStr))
labClose := label.new(rightX_base, get_y_pos(prevC,lineLabelPos), txtClose, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cClose, size=get_font_size(lineFontSizeStr))
// --- DRAW BODY% ---
float bodySize = math.abs(prevC-prevO)
float levelPct = na
drawBody = (bodyDisplay=="Both") or (bodyDisplay=="Bullish" and isBull) or (bodyDisplay=="Bearish" and not isBull)
if showBodyPct and bodySize>0 and drawBody
if not na(lBodyPct)
line.delete(lBodyPct)
levelPct := isBull ? (prevC - (bodyPct/100)*bodySize) : (prevC + (bodyPct/100)*bodySize)
lBodyPct := line.new(leftX_base, levelPct, rightX_base, levelPct, xloc=xloc.bar_index, color=cBodyPct, width=bodyPctWidth, style=line_style_from_str(bodyPctStyle))
labBodyPct := label.new(rightX_base, get_y_pos(levelPct,lineLabelPos), txtBody, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cBodyPct, size=get_font_size(lineFontSizeStr))
// --- BOXES ---
drawHLBox = (hlBoxDisplay=="Both") or (hlBoxDisplay=="Bullish" and isBull) or (hlBoxDisplay=="Bearish" and not isBull)
if showHLBox and drawHLBox
if not na(bHL)
box.delete(bHL)
bHL := box.new(leftX_base, prevH, rightX_base, prevL, xloc=xloc.bar_index, border_color=cBoxBorder, bgcolor=cBoxFill)
drawWickBox = (wickBoxDisplay=="Both") or (wickBoxDisplay=="Bullish" and isBull) or (wickBoxDisplay=="Bearish" and not isBull)
if enableWickBox and drawWickBox
float topP = isBull ? prevH : prevC
float botP = isBull ? prevC : prevL
if not na(topP) and not na(botP)
if not na(wickBox)
box.delete(wickBox)
wickBox := box.new(leftX_base, topP, rightX_base, botP, xloc=xloc.bar_index, border_color=cWboxBorder, bgcolor=(isBull?cBullBox:cBearBox))
else if not enableWickBox and not keepLastWick and not na(wickBox)
box.delete(wickBox)
wickBox := na
// --- TABLE (vedno na obeh) ---
float wickPips = isBull ? prevH-prevC : prevC-prevL
float bodyPips = na
if not na(levelPct)
bodyPips := isBull ? math.round((prevH-levelPct)/pipSize) : math.round((levelPct-prevL)/pipSize)
table.cell(wickTable, 0, 0, wickLabelText, text_color=cPipText, bgcolor=cPipBox, text_size=get_font_size(descFontSizeStr))
table.cell(wickTable, 1, 0, str.tostring(wickPips/pipSize), text_color=cPipText, bgcolor=cPipBox, text_size=get_font_size(valFontSizeStr))
if not na(bodyPips)
table.cell(wickTable, 0, 1, bodyLabelText, text_color=cPipText, bgcolor=cPipBox, text_size=get_font_size(descFontSizeStr))
table.cell(wickTable, 1, 1, str.tostring(bodyPips), text_color=cPipText, bgcolor=cPipBox, text_size=get_font_size(valFontSizeStr))
Previous candle - byDen (Body % line & Wick size)
//@version=6
indicator("Previous candle - byDen (Body % line & Wick size) ", overlay=true, max_boxes_count=200, max_lines_count=200, max_labels_count=200)
// ---------------- Inputs ----------------
showHighLow = input.bool(true, "Show High/Low lines")
showHLBox = input.bool(true, "Show High-Low Box (full range)")
showMidLine = input.bool(true, "Show Middle Line")
showCloseLine = input.bool(true, "Show Close Line")
showBodyPct = input.bool(true, "Show Body % Line")
enableWickBox = input.bool(true, "Show Wick-Body Box (previous candle)")
keepLastWick = input.bool(false, "Keep last Wick-Box when disabled")
bodyPct = input.float(25.0, "Body % Level", step=0.1, minval=0.0, maxval=100.0)
// colors / styles
cHighLow = input.color(color.white, "H/L Line Color")
hlStyleStr = input.string("solid", "H/L Style", options= )
hlWidth = input.int(1, "H/L Width", minval=1, maxval=5)
cMid = input.color(color.yellow, "Mid Line Color")
midStyleStr = input.string("dashed", "Mid Style", options= )
midWidth = input.int(1, "Mid Width", minval=1, maxval=5)
cClose = input.color(color.yellow, "Close Line Color")
closeStyleStr = input.string("dotted", "Close Style", options= )
closeWidth = input.int(1, "Close Width", minval=1, maxval=5)
cBoxBorder = input.color(color.red, "HL Box Border")
cBoxFill = color.new(input.color(color.gray, "HL Box Fill"), 85)
cBullBox = color.new(input.color(color.green, "Bull WickBox"), 80)
cBearBox = color.new(input.color(color.red, "Bear WickBox"), 80)
cWboxBorder = input.color(color.white, "WickBox Border")
cBodyPct = input.color(color.blue, "Body % Line Color")
bodyPctStyle = input.string("dashed", "Body % Line Style", options= )
bodyPctWidth = input.int(1, "Body % Line Width", minval=1, maxval=5)
// wick label
cPipBox = input.color(color.new(color.blue, 80), "Wick Box Color")
cPipText = input.color(color.white, "Wick Text Color")
pipSize = input.float(0.1, "Pip size (XAUUSD=0.1)", step=0.01)
// Label settings
showLabels = input.bool(true, "Show Line Labels")
labelAbove = input.bool(true, "Labels Above Line?")
fontSizeStr = input.string("normal", "Label Font Size", options= )
labelAlignX = input.string("center", "Label Alignment", options= )
// custom texts for labels
txtHigh = input.string("High", "Label Text - High")
txtLow = input.string("Low", "Label Text - Low")
txtMid = input.string("Mid", "Label Text - Mid")
txtClose = input.string("Close", "Label Text - Close")
txtBody = input.string("Body %", "Label Text - Body %")
// Wick pips font size (same options)
wickFontSizeStr = input.string("normal", "Wick Pips Font Size", options= )
// timeframe filter
enabledTFs = input.string("1,5,15,30,60,240,D", "Enable on timeframes")
// ---------------- Helpers ----------------
is_tf_enabled(tfStr) =>
str.contains("," + enabledTFs + ",", "," + tfStr + ",")
line_style_from_str(s) =>
s == "dotted" ? line.style_dotted : s == "dashed" ? line.style_dashed : line.style_solid
get_label_style(_align) =>
_align == "left" ? label.style_label_left : _align == "right" ? label.style_label_right : label.style_label_center
get_font_size(fs) =>
if fs == "tiny"
size.tiny
else if fs == "small"
size.small
else if fs == "large"
size.large
else if fs == "huge"
size.huge
else
size.normal
// ---------------- Data ----------------
tf = timeframe.period
= request.security(syminfo.tickerid, tf, , lookahead=barmerge.lookahead_off)
midLevel = (prevH + prevL) / 2
isBull = prevC > prevO
// ---------------- Persistent ----------------
var line lHigh = na
var line lLow = na
var line lMid = na
var line lClose = na
var line lBodyPct = na
var box bHL = na
var box wickBox = na
var table wickTable = na
// labels
var label labHigh = na
var label labLow = na
var label labMid = na
var label labClose = na
var label labBody = na
offsetBars = input.int(20, "Bars right", minval=1, maxval=500)
leftX_base = bar_index
rightX_base = bar_index + offsetBars
if na(wickTable)
wickTable := table.new(position.bottom_right, 1, 1, border_width=1, frame_color=color.white)
// ---------------- DRAW ----------------
if barstate.isconfirmed and is_tf_enabled(tf)
// clean old labels
if not na(labHigh)
label.delete(labHigh)
if not na(labLow)
label.delete(labLow)
if not na(labMid)
label.delete(labMid)
if not na(labClose)
label.delete(labClose)
if not na(labBody)
label.delete(labBody)
// style for labels
labStyle = get_label_style(labelAlignX)
labSize = get_font_size(fontSizeStr)
wickSize = get_font_size(wickFontSizeStr)
yOffset = labelAbove ? 1 : -1
if showHighLow
if not na(lHigh)
line.delete(lHigh)
if not na(lLow)
line.delete(lLow)
lHigh := line.new(leftX_base, prevH, rightX_base, prevH, xloc=xloc.bar_index, color=cHighLow, width=hlWidth, style=line_style_from_str(hlStyleStr))
lLow := line.new(leftX_base, prevL, rightX_base, prevL, xloc=xloc.bar_index, color=cHighLow, width=hlWidth, style=line_style_from_str(hlStyleStr))
if showLabels
labHigh := label.new(rightX_base, prevH + yOffset*syminfo.mintick, txtHigh, xloc=xloc.bar_index, yloc=yloc.price, style=labStyle, textcolor=cHighLow, size=labSize)
labLow := label.new(rightX_base, prevL + yOffset*syminfo.mintick, txtLow, xloc=xloc.bar_index, yloc=yloc.price, style=labStyle, textcolor=cHighLow, size=labSize)
if showMidLine
if not na(lMid)
line.delete(lMid)
lMid := line.new(leftX_base, midLevel, rightX_base, midLevel, xloc=xloc.bar_index, color=cMid, width=midWidth, style=line_style_from_str(midStyleStr))
if showLabels
labMid := label.new(rightX_base, midLevel + yOffset*syminfo.mintick, txtMid, xloc=xloc.bar_index, yloc=yloc.price, style=labStyle, textcolor=cMid, size=labSize)
if showCloseLine
if not na(lClose)
line.delete(lClose)
lClose := line.new(leftX_base, prevC, rightX_base, prevC, xloc=xloc.bar_index, color=cClose, width=closeWidth, style=line_style_from_str(closeStyleStr))
if showLabels
labClose := label.new(rightX_base, prevC + yOffset*syminfo.mintick, txtClose, xloc=xloc.bar_index, yloc=yloc.price, style=labStyle, textcolor=cClose, size=labSize)
if showBodyPct
if not na(lBodyPct)
line.delete(lBodyPct)
float bodySize = math.abs(prevC - prevO)
if bodySize > 0
float levelPct = isBull ? (prevC - (bodyPct/100.0) * bodySize) : (prevC + (bodyPct/100.0) * bodySize)
lBodyPct := line.new(leftX_base, levelPct, rightX_base, levelPct, xloc=xloc.bar_index, color=cBodyPct, width=bodyPctWidth, style=line_style_from_str(bodyPctStyle))
if showLabels
labBody := label.new(rightX_base, levelPct + yOffset*syminfo.mintick, txtBody + " " + str.tostring(bodyPct), xloc=xloc.bar_index, yloc=yloc.price, style=labStyle, textcolor=cBodyPct, size=labSize)
if showHLBox
if not na(bHL)
box.delete(bHL)
bHL := box.new(leftX_base, prevH, rightX_base, prevL, xloc=xloc.bar_index, border_color=cBoxBorder, bgcolor=cBoxFill)
if not enableWickBox
if not na(wickBox) and not keepLastWick
box.delete(wickBox)
wickBox := na
else
float topP = isBull ? prevH : prevC
float botP = isBull ? prevC : prevL
if not na(topP) and not na(botP)
if not na(wickBox)
box.delete(wickBox)
wickBox := box.new(leftX_base, topP, rightX_base, botP, xloc=xloc.bar_index, border_color=cWboxBorder, bgcolor=(isBull ? cBullBox : cBearBox))
// wick izračun (v pipih)
float wickPips = isBull ? prevH - prevC : prevC - prevL
float wickInPips = math.round(wickPips / pipSize)
// prikaži samo številko v desnem spodnjem kotu (z nastavljivo velikostjo)
table.cell(wickTable, 0, 0, str.tostring(wickInPips), text_color=cPipText, bgcolor=cPipBox, text_size=wickSize)
Bộ lọc Stoch RSI + MACD + Volume + MFI//@version=6
indicator("Bộ lọc Stoch RSI + MACD + Volume + MFI", overlay=false)
// Input
lenStoch = input.int(14, "Stoch RSI Length")
lenMACD = input.int(12, "MACD Fast Length")
lenSignal = input.int(9, "MACD Signal Length")
lenMFI = input.int(14, "MFI Length")
minVol = input.int(1000000, "Khối lượng tối thiểu")
// Stochastic RSI
k = ta.stoch(close, high, low, lenStoch)
d = ta.sma(k, 3)
// MACD
macd = ta.ema(close, lenMACD) - ta.ema(close, 26)
signal = ta.ema(macd, lenSignal)
// ✅ MFI (chỉ cần volume và length)
mfi = ta.mfi(volume, lenMFI)
// Điều kiện lọc
buyCond = (k < 20 and macd > signal and volume > minVol and mfi > 60)
sellCond = (k > 80 and macd < signal and mfi < 40)
// Xuất tín hiệu
plotchar(buyCond, "BUY", "▲", location=location.bottom, color=color.green, size=size.large)
plotchar(sellCond, "SELL", "▼", location=location.top, color=color.red, size=size.large)
Swing Dashboard - Pro Trader Metrics with MTF & Enhanced VolumeDESCRIPTION:
A comprehensive real-time dashboard designed for swing traders and active investors trading US equities. Displays all critical metrics in one customizable panel overlay - no need to clutter your chart with multiple indicators.
KEY FEATURES:
📊 Relative Strength Analysis:
Stock vs Market (SPY/QQQ/IWM/DIA)
Stock vs Sector (automatic sector ETF detection)
Sector vs Market comparison
Customizable lookback period (5-60 days)
📈 Price & Range Metrics:
Daily range, change, and gap percentages
Distance from SMA20, SMA50, VWAP
52-week position percentage
ATR% and ADR% for volatility assessment
Range/ADR ratio for breakout detection
💪 Advanced Volume Analysis:
RVOL (full day volume vs 20-day average)
Volume Strength (bar-by-bar analysis)
Volume Trend (5-day vs 20-day momentum)
Customizable RVOL alert thresholds
Non-repainting volume calculations
⚙️ Multi-Timeframe (MTF) Mode:
View daily charts with 5-min or 15-min metric updates
Perfect for monitoring positions without switching timeframes
All calculations remain accurate across timeframes
🎨 Fully Customizable:
Choose which metrics to display
9 position options for the dashboard
Adjustable text size and colors
Toggle individual metrics on/off
Sector-specific ETF mapping for accurate RS calculations
TECHNICAL SPECIFICATIONS:
✅ Non-repainting - all calculations use confirmed bar data
✅ No lookahead bias or future data
✅ Optimized for US stocks with proper sector mapping
✅ Works on any timeframe (best on 5m-Daily)
✅ Pine Script v6 with best practices
✅ Handles edge cases and missing data gracefully
IDEAL FOR:
Swing traders monitoring multiple positions
Day traders needing quick metric overview
Investors tracking relative strength and momentum
Anyone who wants institutional-grade metrics in one place
SECTOR ETF MAPPING:
Automatically maps to correct sector ETFs: XLK, XLF, XLV, XLY, XLP, XLE, XLB, XLI, XLRE, XLC, XLU
HOW TO USE:
Green = Positive/Strong | Red = Negative/Weak | White = Neutral
RS > 0 = Outperforming benchmark/sector
RVOL > 1.5x = High volume day
VWAP% negative = Price below VWAP (mean reversion opportunity)
R/ADR > 100% = Extended range (potential exhaustion)
Perfect for traders who need professional-grade analysis without chart clutter.
TAGS:
dashboard, swing, relativestrengrh, sectoranalysis, volume, rvol, multitimeframe, mtf, tradingdashboard, metrics, daytrading, swingtrading, momentum, vwap, atr, volatility, volumeanalysis
MGG_FX//@version=5
indicator('MGG_FX', overlay=true, max_bars_back=1000, max_labels_count=500, max_lines_count=500, max_boxes_count=500)
var GRP1 = "ASIAN RANGE"
showLines = input(title='Show Lines', defval=true, group=GRP1)
showBackground = input(title='Show Background', defval=true, group=GRP1)
showMiddleLine = input(title='Show Middle Line', defval=true, group=GRP1)
extendLines = input(title='Extend Line', defval=true, group=GRP1)
rangeTime = input.session(title='Session Time', defval='1700-0100', group=GRP1)
extendTime = input.session(title='Extend Until', defval='0100-0500', group=GRP1)
linesWidth = input.int(1, 'Box And Lines Width', minval=1, maxval=4, group=GRP1)
boxLineColor = input(color.new(#434651,50), 'Box Line Color', group=GRP1)
middleLineColor = input(color.new(#434651,50), 'Middle Line Color', group=GRP1)
backgroundColor = input(color.new(#9598a1,90), 'Box Background Color', group=GRP1)
var GRP5 = "LONDON"
showLines4 = input(title='Show Lines', defval=true, group=GRP5)
showBackground4 = input(title='Show Background', defval=true, group=GRP5)
rangeTime4 = input.session(title='Session Time', defval='0300-0400', group=GRP5)
linesWidth4 = input.int(1, 'Box And Lines Width', minval=1, maxval=4, group=GRP5)
boxLineColor4 = input(color.new(#b2b5be, 95), 'Box Line Color', group=GRP5)
backgroundColor4 = input(color.new(#b2b5be, 90), 'Box Background Color', group=GRP5)
var GRP6 = "NEWYORK"
showLines5 = input(title='Show Lines', defval=true, group=GRP6)
showBackground5 = input(title='Show Background', defval=true, group=GRP6)
rangeTime5 = input.session(title='Session Time', defval='0900-1000', group=GRP6)
linesWidth5 = input.int(1, 'Box And Lines Width', minval=1, maxval=4, group=GRP6)
boxLineColor5 = input(color.new(#b2b5be, 95), 'Box Line Color', group=GRP6)
backgroundColor5 = input(color.new(#b2b5be, 90), 'Box Background Color', group=GRP6)
////////////////////////////////////////////
inSession = not na(time(timeframe.period, rangeTime))
inExtend = not na(time(timeframe.period, extendTime))
startTime = 0
startTime := inSession and not inSession ? time : startTime
//Box lines
var line lowHLine = na
var line topHLine = na
var line leftVLine = na
var line rightVLine = na
var line middleHLine = na
var box bgBox = na
var low_val = 0.0
var high_val = 0.0
if inSession and not inSession
low_val := low
high_val := high
high_val
// Plot lines
if inSession and timeframe.isintraday
if inSession
line.delete(lowHLine)
line.delete(topHLine)
line.delete(leftVLine)
line.delete(rightVLine)
line.delete(middleHLine)
box.delete(bgBox)
if low < low_val
low_val := low
low_val
if high > high_val
high_val := high
high_val
//Create Box
//x1, y1, x2, y2
if showBackground
bgBox := box.new(startTime, high_val, time, low_val, xloc=xloc.bar_time, bgcolor=backgroundColor, border_width=0)
if showLines
lowHLine := line.new(startTime, low_val, time, low_val, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=linesWidth)
topHLine := line.new(startTime, high_val, time, high_val, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=linesWidth)
leftVLine := line.new(startTime, high_val, startTime, low_val, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=linesWidth)
rightVLine := line.new(time, high_val, time, low_val, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=linesWidth)
//Create Middle line
if showMiddleLine
middleHLine := line.new(startTime, (high_val + low_val) / 2, time, (high_val + low_val) / 2, xloc=xloc.bar_time, color=middleLineColor, style=line.style_solid, width=linesWidth)
else
if inExtend and extendLines and not inSession and timeframe.isintraday
time1 = line.get_x1(lowHLine)
time2 = line.get_x2(lowHLine)
price = line.get_y1(lowHLine)
line.delete(lowHLine)
lowHLine := line.new(time1, price, time, price, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=linesWidth)
time1 := line.get_x1(topHLine)
time2 := line.get_x2(topHLine)
price := line.get_y1(topHLine)
line.delete(topHLine)
topHLine := line.new(time1, price, time, price, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=linesWidth)
time1 := line.get_x1(middleHLine)
time2 := line.get_x2(middleHLine)
price := line.get_y1(middleHLine)
line.delete(middleHLine)
middleHLine := line.new(time1, price, time, price, xloc=xloc.bar_time, color=middleLineColor, style=line.style_solid, width=linesWidth)
middleHLine
////////////////////////////////////////////
inSession4 = not na(time(timeframe.period, rangeTime4))
startTime4 = 0
startTime4 := inSession4 and not inSession4 ? time : startTime4
//Box lines
var line lowHLine4 = na
var line topHLine4 = na
var line leftVLine4 = na
var line rightVLine4 = na
var line middleHLine4 = na
var box bgBox4 = na
var low_val4 = 0.0
var high_val4 = 0.0
if inSession4 and not inSession4
low_val4 := low
high_val4 := high
high_val4
// Plot lines
if inSession4 and timeframe.isintraday
if inSession4
line.delete(lowHLine4)
line.delete(topHLine4)
line.delete(leftVLine4)
line.delete(rightVLine4)
line.delete(middleHLine4)
box.delete(bgBox4)
if low < low_val4
low_val4 := low
low_val4
if high > high_val4
high_val4 := high
high_val4
//Create Box
//x1, y1, x2, y2
if showBackground4
bgBox4 := box.new(startTime4, high_val4, time, low_val4, xloc=xloc.bar_time, bgcolor=backgroundColor4, border_width=0)
if showLines4
lowHLine4 := line.new(startTime4, low_val4, time, low_val4, xloc=xloc.bar_time, color=boxLineColor4, style=line.style_solid, width=linesWidth4)
topHLine4 := line.new(startTime4, high_val4, time, high_val4, xloc=xloc.bar_time, color=boxLineColor4, style=line.style_solid, width=linesWidth4)
leftVLine4 := line.new(startTime4, high_val4, startTime4, low_val4, xloc=xloc.bar_time, color=boxLineColor4, style=line.style_solid, width=linesWidth4)
rightVLine4 := line.new(time, high_val4, time, low_val4, xloc=xloc.bar_time, color=boxLineColor4, style=line.style_solid, width=linesWidth4)
////////////////////////////////////////////
inSession5 = not na(time(timeframe.period, rangeTime5))
startTime5 = 0
startTime5 := inSession5 and not inSession5 ? time : startTime5
//Box lines
var line lowHLine5 = na
var line topHLine5 = na
var line leftVLine5 = na
var line rightVLine5 = na
var line middleHLine5 = na
var box bgBox5 = na
var low_val5 = 0.0
var high_val5 = 0.0
if inSession5 and not inSession5
low_val5 := low
high_val5 := high
high_val5
// Plot lines
if inSession5 and timeframe.isintraday
if inSession5
line.delete(lowHLine5)
line.delete(topHLine5)
line.delete(leftVLine5)
line.delete(rightVLine5)
line.delete(middleHLine5)
box.delete(bgBox5)
if low < low_val5
low_val5 := low
low_val5
if high > high_val5
high_val5 := high
high_val5
//Create Box
//x1, y1, x2, y2
if showBackground5
bgBox5 := box.new(startTime5, high_val5, time, low_val5, xloc=xloc.bar_time, bgcolor=backgroundColor5, border_width=0)
if showLines5
lowHLine5 := line.new(startTime5, low_val5, time, low_val5, xloc=xloc.bar_time, color=boxLineColor5, style=line.style_solid, width=linesWidth5)
topHLine5 := line.new(startTime5, high_val5, time, high_val5, xloc=xloc.bar_time, color=boxLineColor5, style=line.style_solid, width=linesWidth5)
leftVLine5 := line.new(startTime5, high_val5, startTime5, low_val5, xloc=xloc.bar_time, color=boxLineColor5, style=line.style_solid, width=linesWidth5)
rightVLine5 := line.new(time, high_val5, time, low_val5, xloc=xloc.bar_time, color=boxLineColor5, style=line.style_solid, width=linesWidth5)
///////////////////////////////////////////////
//INPUTS
ffRange = input.session(title='Time: ', defval='0200-0201', inline='a', group='FF')
ffcolor = input.color(color.new(#b2b5be,20),title="Color:",inline="s_1",group="FF")
ffStyle = input.string(title="-", defval=line.style_solid, options= ,inline="s_1",group="FF")
mmm1Range = input.session(title='Time: ', defval='0430-0431', inline='a', group='MMM1')
mmm1color = input.color(color.new(#b2b5be,20),title="Color:",inline="s_1",group="MMM1")
mmm1Style = input.string(title="-", defval=line.style_solid, options= ,inline="s_1",group="MMM1")
mmm2Range = input.session(title='Time: ', defval='0630-0631', inline='a', group='MMM2')
mmm2color = input.color(color.new(#b2b5be,20),title="Color:",inline="s_1",group="MMM2")
mmm2Style = input.string(title="-", defval=line.style_solid, options= ,inline="s_1",group="MMM2")
mmm3Range = input.session(title='Time: ', defval='0800-0801', inline='a', group='MMM3')
mmm3color = input.color(color.new(#b2b5be,20),title="Color:",inline="s_1",group="mmm3")
mmm3Style = input.string(title="-", defval=line.style_solid, options= ,inline="s_1",group="MMM3")
lcRange = input.session(title='Time: ', defval='1100-1101', inline='a', group='LC')
lccolor = input.color(color.new(#b2b5be,20),title="Color:",inline="s_1",group="LC")
lcStyle = input.string(title="-", defval=line.style_solid, options= ,inline="s_1",group="LC")
//Plot lines
in_session_ff = time(timeframe.period, ffRange)
sessionffActive = in_session_ff and timeframe.multiplier <= 240
var line ff = na
if sessionffActive and sessionffActive == false
ff := line.new(bar_index,high+0.001,bar_index,low-0.001,color=ffcolor, style=ffStyle)
in_session_mmm1 = time(timeframe.period, mmm1Range)
sessionmmm1Active = in_session_mmm1 and timeframe.multiplier <= 240
var line mmm1 = na
if sessionmmm1Active and sessionmmm1Active == false
mmm1 := line.new(bar_index,high+0.001,bar_index,low-0.001,color=mmm1color, style=mmm1Style)
in_session_mmm2 = time(timeframe.period, mmm2Range)
sessionmmm2Active = in_session_mmm2 and timeframe.multiplier <= 240
var line mmm2 = na
if sessionmmm2Active and sessionmmm2Active == false
mmm2 := line.new(bar_index,high+0.001,bar_index,low-0.001,color=mmm2color, style=mmm2Style)
in_session_mmm3 = time(timeframe.period, mmm3Range)
sessionmmm3Active = in_session_mmm3 and timeframe.multiplier <= 240
var line mmm3 = na
if sessionmmm3Active and sessionmmm3Active == false
mmm3 := line.new(bar_index,high+0.001,bar_index,low-0.001,color=mmm3color, style=mmm3Style)
in_session_lc = time(timeframe.period, lcRange)
sessionlcActive = in_session_lc and timeframe.multiplier <= 240
var line lc = na
if sessionlcActive and sessionlcActive == false
lc := line.new(bar_index,high+0.001,bar_index,low-0.001,color=lccolor, style=lcStyle)
//////////////////////////////////////////////////////////////////////
// Inputs
var GRP10 = "Daily Open"
daily = input.string(title='View', defval='Daily Open', group=GRP10)
_offset = input.int(0, title='Offset', minval=0, maxval=2)
o_color = input.color(color.new(#000000, 0), "Open Color", inline="1", group = GRP10)
// FUNCTIONS
t = time
isNewbar = not na(t) and (na(t ) or t > t )
tfInMinutes(simple string tf = "") =>
float chartTf =
timeframe.multiplier * (
timeframe.isseconds ? 1. / 60 :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 60. * 24 :
timeframe.isweekly ? 60. * 24 * 7 :
timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
float result = tf == "" ? chartTf : request.security(syminfo.tickerid, tf, chartTf)
inTimeframe(_t) => tfInMinutes(_t) > tfInMinutes(timeframe.period)
// Range
reso(exp, res) => request.security(syminfo.tickerid, res, exp, lookahead=barmerge.lookahead_on)
getData(_t, _var) =>
o = reso(open , _t)
show = _var != "Off" and inTimeframe(_t)
_time = time(_t)
newbar = na(_time ) or _time > _time
oc = _var == 'Daily Open'
// ---------- Daily ----------
= getData("D", daily)
if d_newbar
if d_oc
line.new(x1=time, y1=d_o, x2=time_close("D"), y2=d_o, xloc=xloc.bar_time, style=line.style_dotted, color=o_color)
//-------------------- WATERMARK--------------------
////////////////////////////////////////////////////
//text inputs
title = input.string("JDVID_FX", "Tittle", group = "NICK NAME")
subtitle = input.string("𝗖𝗬𝗖𝗟𝗘 | 𝗧𝗜𝗠𝗜𝗡𝗚 | 𝗣𝗥𝗘𝗖𝗜𝗦𝗜𝗢𝗡", "Subtitle", group = "text")
//symbol info
symInfoCheck = input.bool(title="Show Symbol Info", defval=true, group = "watermark position")
symInfo = syminfo.ticker + " | " + timeframe.period + (timeframe.isminutes ? "M" : na)
date = str.format("{0}/{1}/{2}", dayofmonth(time_close), month(time_close), year(time_close))
//text positioning
textVPosition = input.string("top", "Vertical Position", options = , group = "watermark position")
textHPosition = input.string("center", "Horizontal Position", options = , group = "watermark position")
//symbol info positioning
symVPosition = input.string("bottom", "Vertical Position", options = , group = "symbol position")
symHPosition = input.string("center", "Horizontal Position", options = , group = "symbol position")
//cell size
cellWidthPercent = input.float(0, "Cell Width (%)", minval = 0, maxval = 100, tooltip = "The width of the cell as a % of the indicator's visual space. Optional. By default, auto-adjusts the width based on the text inside the cell. Value 0 has the same effect.", group = "cell size")
cellHeightPercent = input.float(0, "Cell Height (%)", minval = 0, maxval = 100, tooltip = "The height of the cell as a % of the indicator's visual space. Optional. By default, auto-adjusts the height based on the text inside of the cell. Value 0 has the same effect.", group = "cell size")
//title settings
c_title = input(color.new(color.black, 0), "Title Color", group = "title settings")
s_title = input.string("large", "Title Size", options = , group = "title settings")
a_title = input.string("center","Title Alignment", options = , group = "title settings")
//subtitle settings
c_subtitle = input(color.new(color.black, 30), "Subtitle Color", group = "subtitle settings")
s_subtitle = input.string("small", "Subtitle Size", options = , group = "subtitle settings")
a_subtitle = input.string("center","Subtitle Alignment", options = , group = "subtitle settings")
//symbol settings
c_symInfo = input(color.new(color.black, 30), "Subtitle Color", group = "symbol settings")
s_symInfo = input.string("normal", "Subtitle Size", options = , group = "symbol settings")
a_symInfo = input.string("center","Subtitle Alignment", options = , group = "symbol settings")
c_bg = input(color.new(color.blue, 100), "Background", group = "background")
//text watermark creation
var table textWatermark = table.new(textVPosition + "_" + textHPosition, 1, 3)
table.cell(textWatermark, 0, 0, title, width = cellWidthPercent, height = cellHeightPercent, text_color = c_title, text_halign = a_title, text_size = s_title, bgcolor = c_bg)
table.cell(textWatermark, 0, 1, subtitle, width = cellWidthPercent, height = cellHeightPercent, text_color = c_subtitle, text_halign = a_subtitle, text_size= s_subtitle, bgcolor = c_bg)
//symbol info watermark creation
var table symWatermark = table.new(symVPosition + "_" + symHPosition, 5, 5)
if symInfoCheck
table.cell(symWatermark, 0, 1, symInfo, width = cellWidthPercent, height = cellHeightPercent, text_color = c_symInfo, text_halign = a_symInfo, text_size = s_symInfo, bgcolor = c_bg)
table.cell(symWatermark, 0, 0, date, width = cellWidthPercent, height = cellHeightPercent, text_color = c_symInfo, text_halign = a_symInfo, text_size = s_symInfo, bgcolor = c_bg)
Relative Strength Index_ShRelative Strength Index updated to keep upper level at 60 while lower at 40
Alpha - Multi-Asset Adaptive Trading Strategy# Alpha - Multi-Asset Adaptive Trading Strategy
Overview
Alpha is a comprehensive trading strategy that combines multiple technical analysis components with pre-optimized settings for over 70 different trading instruments across cryptocurrencies, forex, and stocks. The strategy employs an adaptive approach using modified trend detection algorithms, dynamic support/resistance zones, and multi-timeframe confirmation.
Key Features & Originality
1. Adaptive Trend Detection System
- Modified trend-following algorithm with amplitude-based channel deviation
- Dynamic channel width adjustment based on ATR (Average True Range)
- Dual-layer trend confirmation using both price action and momentum indicators
2. Pre-Configured Asset Optimization
The strategy includes carefully backtested parameter sets for:
- **Cryptocurrencies**: BTC, ETH, and 40+ altcoin pairs
- **Forex Pairs**: Major and minor currency pairs
- **Stocks**: TSLA, AAPL, GOOG
- **Commodities**: Gold, Silver, Platinum
- Each configuration is optimized for specific timeframes (5m, 15m, 30m, 45m, 1h)
3. Advanced Risk Management
- Multiple take profit levels (4 targets with customizable position sizing)
- Dynamic stop-loss options (ATR-based or percentage-based)
- Position size allocation across profit targets (default: 30%, 30%, 30%, 10%)
4. Multi-Timeframe Analysis Dashboard
- Real-time analysis across 4 configurable timeframes
- Comprehensive performance metrics display
- Visual representation of current market conditions
5. Market Condition Filtering
- RSI-based trend strength filtering
- ATR-based volatility filtering
- Sideways market detection to avoid choppy conditions
- Customizable filter combinations (ATR only, RSI only, both, or disabled)
How to Use
Initial Setup
1. **Select Asset Configuration**: Choose your trading pair from the "Strategies" dropdown menu
2. **Enable Strategy**: Enter "Alpha" in the code confirmation field
3. **Adjust Timeframe**: Match your chart timeframe to the selected strategy configuration
Parameter Customization
- **Trendline Settings**: Adjust amplitude and channel deviation for sensitivity
- **TP/SL Method**: Choose between ATR-based or percentage-based targets
- **Filtering Options**: Select appropriate market filters for your trading style
- **Backtest Period**: Set the number of days for strategy testing (max 60)
Signal Interpretation
- **BUY/SELL Labels**: Primary entry signals based on trend changes
- **Support/Resistance Zones**: Visual zones showing key price levels
- **Dashboard**: Real-time display of position status, targets, and performance metrics
Important Considerations
Limitations and Warnings
- **Backtesting Period**: Results shown are based on historical data from the specified backtest period
- **No Guarantee**: Past performance does not guarantee future results
- **Market Conditions**: Strategy performance varies with market volatility and trending conditions
- **Repainting**: Some signals may repaint if "Wait For Confirmed Bar" is disabled
Risk Warnings
- The pre-configured settings are starting points and may require adjustment for current market conditions
- Always use appropriate position sizing and risk management
- Test thoroughly on demo accounts before live trading
- Monitor and adjust parameters regularly as market dynamics change
Technical Components
Core Indicators Used
- Modified trend detection with amplitude-based channels
- RSI (Relative Strength Index) for momentum confirmation
- ATR (Average True Range) for volatility measurement
- Support/Resistance detection using pivot points
- Bollinger Band variant for trend confirmation
Alert Functionality
The strategy includes comprehensive alert options for:
- Entry signals (long and short)
- Take profit levels (TP1, TP2, TP3, TP4)
- Stop loss triggers
- Integration with trading bots via webhook messages
Recommended Usage
Best Practices
1. Start with the pre-configured settings for your chosen asset
2. Run backtests over different time periods to verify performance
3. Use the dashboard to monitor real-time strategy performance
4. Adjust filters based on current market conditions
5. Always use stop losses and proper risk management
Timeframe Recommendations
- **Short-Term**: Use 5m, 15m configurations for scalping
- **Mid-Term**: Use 30m, 45m configurations for day trading
- **Long-Term**: Use 1h configurations for swing trading
Updates and Support
The strategy parameters are regularly reviewed and optimized. Users should periodically check for updates to ensure they have the latest configurations.
Disclaimer
This strategy is for educational and informational purposes only. Trading involves substantial risk of loss. Users should conduct their own research and consider their financial situation before trading. The author is not responsible for any trading losses incurred using this strategy.