vdubus

Vdub FX Sniper VX3 / Strategy

19252 60 2233
Original coding
Vdub FX SniperVX2 Color v2

*Modified signal generator

Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
//╭╮╱╱╭╮╭╮╱╱╭╮
//┃╰╮╭╯┃┃┃╱╱┃┃
//╰╮┃┃╭┻╯┣╮╭┫╰━┳╮╭┳━━╮
//╱┃╰╯┃╭╮┃┃┃┃╭╮┃┃┃┃━━┫
//╱╰╮╭┫╰╯┃╰╯┃╰╯┃╰╯┣━━┃
//╱╱╰╯╰━━┻━━┻━━┻━━┻━━╯
//╭━━━┳╮╱╱╱╱╱╱╱╭╮
//┃╭━╮┃┃╱╱╱╱╱╱╱┃┃
//┃┃╱╰┫╰━┳━━┳━╮╭━╮╭━━┫┃
//┃┃╱╭┫╭╮┃╭╮┃╭╮┫╭╮┫┃━┫┃
//┃╰━╯┃┃┃┃╭╮┃┃┃┃┃┃┃┃━┫╰╮
//╰━━━┻╯╰┻╯╰┻╯╰┻╯╰┻━━┻━╯
//━╯
// http://www.vdubus.co.uk/
strategy(title='Vdub FX SniperVX3 / Strategy  v3', shorttitle='Vdub_FX_SniperVX3_Strategy', overlay=true, pyramiding=0, initial_capital=1000, currency=currency.USD)

//Candle body resistance Channel-----------------------------//
len = 34
src = input(close, title="Candle body resistance Channel")
out = sma(src, len)
last8h = highest(close, 13)
lastl8 = lowest(close, 13)
bearish = cross(close,out) == 1 and falling(close, 1)
bullish = cross(close,out) == 1 and rising(close, 1)
channel2=input(false, title="Bar Channel On/Off")
ul2=plot(channel2?last8h:last8h==nz(last8h[1])?last8h:na, color=black, linewidth=1, style=linebr, title="Candle body resistance level top", offset=0)
ll2=plot(channel2?lastl8:lastl8==nz(lastl8[1])?lastl8:na, color=black, linewidth=1, style=linebr, title="Candle body resistance level bottom", offset=0)
//fill(ul2, ll2, color=black, transp=95, title="Candle body resistance Channel")

//-----------------Support and Resistance 
RST = input(title='Support / Resistance length:', type=integer, defval=10) 
RSTT = valuewhen(high >= highest(high, RST), high, 0)
RSTB = valuewhen(low <= lowest(low, RST), low, 0)
RT2 = plot(RSTT, color=RSTT != RSTT[1] ? na : red, linewidth=1, offset=+0)
RB2 = plot(RSTB, color=RSTB != RSTB[1] ? na : green, linewidth=1, offset=0)

//--------------------Trend colour ema------------------------------------------------// 
src0 = close, len0 = input(13, minval=1, title="EMA 1")
ema0 = ema(src0, len0)
direction = rising(ema0, 2) ? +1 : falling(ema0, 2) ? -1 : 0
plot_color = direction > 0  ? lime: direction < 0 ? red : na
plot(ema0, title="EMA", style=line, linewidth=1, color = plot_color)

//-------------------- ema 2------------------------------------------------//
src02 = close, len02 = input(21, minval=1, title="EMA 2")
ema02 = ema(src02, len02)
direction2 = rising(ema02, 2) ? +1 : falling(ema02, 2) ? -1 : 0
plot_color2 = direction2 > 0  ? lime: direction2 < 0 ? red : na
plot(ema02, title="EMA Signal 2", style=line, linewidth=1, color = plot_color2)

//=============Hull MA//
show_hma = input(false, title="Display Hull MA Set:")
hma_src = input(close, title="Hull MA's Source:")
hma_base_length = input(8, minval=1, title="Hull MA's Base Length:")
hma_length_scalar = input(5, minval=0, title="Hull MA's Length Scalar:")
hullma(src, length)=>wma(2*wma(src, length/2)-wma(src, length), round(sqrt(length)))
plot(not show_hma ? na : hullma(hma_src, hma_base_length+hma_length_scalar*6), color=black, linewidth=2, title="Hull MA")

//============ signal Generator ==================================//
Piriod=input('720')
ch1 = security(tickerid, Piriod, open)
ch2 = security(tickerid, Piriod, close)
longCondition = crossover(security(tickerid, Piriod, close),security(tickerid, Piriod, open))
if (longCondition)
    strategy.entry("BUY", strategy.long)
shortCondition = crossunder(security(tickerid, Piriod, close),security(tickerid, Piriod, open))
if (shortCondition)
    strategy.entry("SELL", strategy.short)

///////////////////////////////////////////////////////////////////////////////////////////
Hausky
a year ago
Looks great, is it repainting? Looks almost too good! Anyways I think you should add a stop loss to the strategy ;)
Reply
vdubus PRO Hausky
a year ago
I haven't tested this out fully as yet. The signal generated work well together with the Rejection spike strategy integrated into the system
Rejection Spike Strategy - By Russ Horn

snapshot
Reply
cristian.d vdubus
a year ago
If I change the input settings, it does not change anything in the signals... I wanted to have more signals (for stocks), intraday signals, with current settings , there is a signal every few days. Is there a way to make the change of settings work on the strategy signal generating? Thank you.
+7 Reply
ChartArt Hausky
a year ago
Yes, this strategy repaints, same as the popular ANN strategy by Sirolf2009. It uses future data from a higher time frame which vdubus named "signal generator". I was stunned by the performance and looked at the code. The backtest results were too good to be true :)

Besides this issue that the backtest data isn't reliable due to the repainting, I assume that this strategy still performs very good in live trading. Thanks for sharing this strategy with everyone, vdubus!
+9 Reply
zmm20 ChartArt
2 months ago
@ChartArt, Yep. All this strategy does is buy if the close price is higher than the open price, and sell if the close price is lower than the open price. Because of the way Tradingview implements custom timeframes, all the strategy is doing is comparing open/close values that are known at the BEGINNING of the interval, so the results are completely worthless. I wrote my own strategy just like this that gets even better results, it's only 4 lines long lol.
+1 Reply
MarxBabu Hausky
3 months ago
IMPORTANT : EACH ONE OF YOUR VOTE bring this most powerful feature come true and be available in Tradingview.This is best indicator and Screener option needed.Please vote your count in this link please
https://getsatisfaction.com/tradingview/topics/supertrend-v1-0-v5-0-most-powerful-and-profitable-indicator?rfm=1
+2 Reply
Evgenich
a year ago
GoodJob!!! Can i see more signals on m5 timeframe?
Reply
vdubus PRO Evgenich
a year ago
Have a play with the period time frame currently set at 720. For a m5 id say change it to 240, 120 or even 60 mins
+1 Reply
Evgenich vdubus
a year ago
Thank you. Good luck
+1 Reply
Hausky
a year ago
I think it is repainting, cause I just had a long signal, and 1 hour later it is gone :/
+3 Reply
Hausky Hausky
a year ago
snapshot
+2 Reply
Hausky Hausky
a year ago
The buy signal is marked with a green arrow, and is now gone as you see
+2 Reply
vdubus PRO Hausky
a year ago
the signal generated are a simple cross over, I have noticed it disappearing also,, but it is also my understanding that TV indicators don't exact;y re- paint so my best assumption is the cross over wasn't conclusive. May also help by refreshing the page.
Reply
ChartArt vdubus
a year ago
They repaint. Always. As soon as you use a higher time-frame you have repainting. Because the MTF close is never known ... until the close. The Tradingview backtest engine can only use the final close of a higher time-frame, where as when using it live it always repaints. I had a great idea for a system last year until I had to learn this repainting made my idea too unreliable in live-trading.
Reply
vdubus PRO Hausky
a year ago
Also help if you have another form of indication when building up a case for entry
snapshot
Reply
rishi12 vdubus
8 months ago
give me template
Reply
YaroslavG
a year ago
The strategy is written in 6 lines of code. the rest is not used. Men disagree is the same as
GetTrendStrategy
for period 720
+4 Reply
vdubus PRO YaroslavG
a year ago
The signal are inconsistent as with the original indicator that this strategy has been applied to but should give you a basic idea of the performance. Thank you
Reply
YaroslavG vdubus
a year ago
I understand your idea. Thank you!
Reply
UrbiGT
a year ago
Repainting
+6 Reply
doremisolla
a year ago
This strategy is invalid. It uses data from the NEXT 12 hours and then it decides to go long if the next 12 hours market will go up, and short if the next 12 hours the market will go down.
If you paint the ch1 and ch2 series you'll understand why some signals disappear and why the statistics are so incredible.
Nice try, but it doesn't work. :-(
+7 Reply
vdubus PRO doremisolla
a year ago
yes please don't trade the signal alone without doing you own analysis
+1 Reply
Seal PRO doremisolla
9 months ago
Vdubus is this true? It looks very impressive but wasn't aware that signals change in history. Thanks
Reply
FDK
9 months ago
This is amazing! Keep up the great work!
Reply
reccos07
9 months ago
can you make this into an ea for mt4? or is there anyway to atleast get this indicator on mt4?
please get back to me, i love this thing!!!! fantastic job vdubus
+1 Reply
has anyone figured out how to code a strategy that closes a position at the end of everyday?
Reply
ZoharCho PRO Zack_The_Lego
9 months ago
PUT THIS 2 LINES AT THE FIRST LINES OF THE CODE
stopalltime=hour
stopmintime=minute

PUT THIS LINE AT THE END OF YOUR CODE:
strategy.close_all(when=stopalltime>14 and stopmintime>50) //no swing command , CHANGE IT TO THE DESIRED TIME (14:50) ...
+8 Reply
bowler2p ZoharCho
2 months ago
@ZoharCho,

Ooooh,.....Did I need that.

Thank you,

Very newbei
Reply
scarf PRO
7 months ago
Is there any reason why the BUY and SELL markers have stopped drawing properly? Example: http://i.imgur.com/rsD86Nl.png
Reply
sirolf2009 PRO scarf
7 months ago
Did you set your chart to use percentages?
+1 Reply
sirolf2009 PRO
7 months ago
I have created a ticket about the repainting issue, Please upvote it so that it might actually get fixed: https://getsatisfaction.com/tradingview/topics/strategies-and-indicators-are-repainting
+1 Reply
vdubus PRO sirolf2009
7 months ago
I have already stated not to trade the signals they are unreliable to trade by themselves. this is not a tradingview issue more the indicator it's self. I have no intention of updating this strategy
Reply
Puffy23 PRO vdubus
5 months ago
If you can't trade the signals doesn't that make this an indicator and not a strategy?
+1 Reply
rcchong
7 months ago
your strategy seems working great on 15min crude oil and silver,
its not working on daily,
seems that it works on futures with round the clock trading and
have certain period of hours during the day which have very thin
volume
+1 Reply
scarf PRO rcchong
5 months ago
You need to change the Period input from 720 mins to something higher. 720 is 12 hours so won't work properly on a higher timeframe (which is 24 hours, obviously)
Reply
UrbiGT
7 months ago
Hi my name is repaint.

Piriod=input('720')
ch1 = security(tickerid, Piriod, open)
ch2 = security(tickerid, Piriod, close)
longCondition = crossover(security(tickerid, Piriod, close),security(tickerid, Piriod, open))
if (longCondition)
strategy.entry("BUY", strategy.long)
shortCondition = crossunder(security(tickerid, Piriod, close),security(tickerid, Piriod, open))
if (shortCondition)
strategy.entry("SELL", strategy.short)
+9 Reply
profprof UrbiGT
4 months ago
How do I remove and test the strategy without repainting?
+1 Reply
Yes, looks great!
VDUBUS a question: the signals appears in realtime (last candle) or upon a past one? In other words: the strategy have some "candle delay?"
Very good work!! Great your tuning about period/timing setting!
Reply
jarno.rossi PRO morphinestyle
5 months ago
yes please VDUBUS, clarify the way your system repaints. How many candles (or time) after the signal we can consider it definitive?
Reply
EduardoCuevas
5 months ago
Hello vdubus. I tried to copy the script and paste it to the pine editor, but it gives me an error message. Please help. Thank you. Eddie122275@gmail.com
Reply
scarf PRO EduardoCuevas
5 months ago
It's easier to click the share icon and choose 'Make It Mine': http://i.imgur.com/VelLhUA.png
Reply
mo_trade
4 months ago
hi. is this a repaint?
Reply
mo_trade mo_trade
4 months ago
how do i apply this on mt4?
Reply
ilker.drsn PRO
4 months ago
Why the signal is lost
Reply
mo_trade
3 months ago
Hi.. do you have the MT4 or 5 version?
Reply
MarxBabu
3 months ago
This works very accurate in Weekly chart. The only strategy that predicts future level buy or sell level using Zone Analysis.
ZONE Supply Demand Strategy1
Reply
jeffumu
2 months ago
Anybody with Mr mani pine script should please share it.
My email is jeffumu@yahoo.co.uk
Reply
totomaze
2 months ago
Great script !
I would like to understand how the security is calculated function is calculated. Unfortunatelly the doc doesn't show the implementation (https://www.tradingview.com/study-script-reference/#fun_security). Do you know where I could find more information on how to calculate the security function ?

I would like to make this function in javascript.
Reply
VinobaPrinson
2 months ago
i have 4 100% accurate binary option 1 min trading method . know i need to create some indicator for that can you help me . my email id is viprinson@gmail.com Contact no +918754916662
+1 Reply
mkdeep04 VinobaPrinson
2 months ago
which software u using present mt4 ? or ..
Reply
jrocksas
2 months ago
Hi, why does the signal come after 3 bars? what can i do to make it work?
Reply
Nikolay480909
2 months ago
Сможешь объяснить как работать по ней?
Reply
Since PRO Nikolay480909
2 months ago
@Nikolay480909, Не питай излишних иллюзий к скрипту, сигналы перерисовываются.
Reply
dazjw2311
2 months ago
what the moving averages 9 and 18?
Reply
zmm20
2 months ago
As many other people have said, the strategy is invalid. It uses future data to make trade decisions - i.e. the close value is known at the beginning of the tick to determine the trade for that tick -

longCondition = crossover(security(tickerid, Piriod, close),security(tickerid, Piriod, open))
shortCondition = crossunder(security(tickerid, Piriod, close),security(tickerid, Piriod, open))

So gives no useful data when used realtime, aka repaints
Reply
Deep51
a month ago
I am new to Trading View.I copied the programme onto Pine but it does not accept it.A message comes up saying try adding @version 2, but this is already on there.Could you please suggest what to do.Thanks.
Reply
AdrianoRenzi
16 days ago
nosense, too nice to be true. The code use 720 future data in order to decide the position.
fake
Reply
vdubus PRO AdrianoRenzi
16 days ago
It's already been stated that this strategy doesn't work. Try reading
Reply
VessiBoki169
10 hours ago
https://www.youtube.com/watch?v=l9st2vhD4MU&t=218s some one tell me which script is this video one
+1 Reply
vdubus PRO VessiBoki169
7 hours ago
@VessiBoki169, why don't ask Mr mani of london ? He seems to like stealing peoples scripts and selling them as his own.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out