Ideas Scripts Chart Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Feature Request FAQ Help & Wiki Twitter

Transient Zones v1.1

32669 115
Simple indicator to visualize Transient Zones (TZ) and Potential Transient Zones (PTZ).
The last 3 numbers in the header represent: probability of true TZ (black), probability of PTZ (navy) and probability of PTZ resolving (gray).

Version 1.1:
- Added TZ/PTZ occurrence probability thanks to SPYderCrusher

Todo:
- Mid bar transient zones detection
- Draw rectangles for zones (once rectangle drawing gets implemented in pine script) or use dot/circle lines
- Mark forming PTZs more clearly

Previous version 1.0:
```//By Jurij w/ TZ percent occurrence by SPYderCrusher
study("Transient Zones v1.1", "TZ", overlay=true)

//inputs
h_left = input(title="H left", type=integer, defval=10)
h_right = input(title="H right", type=integer, defval=10)
sample_period = input(title="Sample bars for % TZ", type=integer, defval=5000)
show_ptz = input(title="Show PTZ", type=bool, defval=true)
show_channel = input(title="Show channel", type=bool, defval=true)

//barCount = nz(barCount[1]) + 1
//check history and realtime PTZ
h_left_low = lowest(h_left)
h_left_high = highest(h_left)
newlow = low <= h_left_low
newhigh = high >= h_left_high
plotshape(newlow and show_ptz, style=shape.triangledown, location=location.belowbar, color=red)
plotshape(newhigh and show_ptz, style=shape.triangleup, location=location.abovebar, color=green)
channel_high = plot(show_channel ? h_left_low : 0, color=silver)
channel_low = plot (show_channel ? h_left_high : 0, color=silver)

//check true TZ back in history
central_bar_low = low[h_right + 1]
central_bar_high = high[h_right + 1]
full_zone_low = lowest(h_left + h_right + 1)
full_zone_high = highest(h_left + h_right + 1)
central_bar_is_highest = central_bar_high >= full_zone_high
central_bar_is_lowest = central_bar_low <= full_zone_low
plotarrow(central_bar_is_highest ? -1 : 0, offset=-h_right-1)
plotarrow(central_bar_is_lowest ? 1 : 0, offset=-h_right-1)

//TZ probability calc
x = central_bar_is_highest ? 1 : 0
high_bar_tz_count = cum(x)

y = central_bar_is_lowest ? 1 : 0
low_bar_tz_count = cum(y)

total_tz = high_bar_tz_count + low_bar_tz_count
percent_tz_high = (high_bar_tz_count / sample_period) * 100
//plot(percent_tz_high, color = lime, transp=100)
percent_tz_low = (low_bar_tz_count / sample_period) * 100
//plot(low_bar_tz_count, color=red, transp=100)
percent_total_tz = (percent_tz_high + percent_tz_low)
plot(percent_total_tz, color=black, transp=100)

//PTZ probability calc
i = newhigh ? 1 : 0
high_bar_ptz_count = cum(i)

j = newlow ? 1 : 0
low_bar_ptz_count = cum(j)

total_ptz = high_bar_ptz_count + low_bar_ptz_count
percent_ptz_high = (high_bar_ptz_count / sample_period) * 100
//plot(percent_ptz_high, color=green, transp=100)
percent_ptz_low = (low_bar_ptz_count / sample_period) * 100
//plot(percent_ptz_low, color=maroon, transp=100)
percent_total_ptz = (percent_ptz_high + percent_ptz_low)
plot(percent_total_ptz, color=navy,  transp=100)

//PTZ resolving probability calc
percent_ptz_resolved = (1 - (total_tz / total_ptz)) * 100
plot(percent_ptz_resolved, color=gray,  transp=100)
```
what am I supposed to do with this code ?
thanx
christos.mythos
The transient recurrent zones concept is incredible, I suggest you to check the original forum thread: http://www.forexfactory.com/showthread.php?t=434603&page=286
Long read but totally worth. It changed my view of the market.
Jurij
yes I believe you, but I would like to use it, how do I get it into metatrader ? copy ? and then paste where ? thanx
christos.mythos
This is a pine script created for TradingView.com nothing for metatrader, altough other indicators for mt4 exists.

Click the "Add to favourite scripts" button above and then open a new chart on tradingview and select the indicator from the indicators list...
Jurij
okay thank you :-)
christos.mythos
Nice work!!!
coondawg71
Thanks :)
Jurij
I'm learning about this interesting strategy to trading. Would it make any sense to add a Median line between the High and the Low barriers? Same as the Donchanian Channel. Thanks.
coondawg71
just at this line: plot(show_channel ? (h_left_high + h_left_low) / 2 : 0, color=silver) at the end of the script

If it makes sense? I don't know. Depends on trading strategy.
Jurij
I meant "add" this line... typo
Jurij
thanks for the amendment. Is this a method you use often? If you don't mind I have couple specific questions.
coondawg71
@coondawg71, hi, does it lag for you?
Thanks and nice work. What is the exit signal, like when do you exit a trade?
I don't quite understand the offset on the arrows - if it is offset X places back is it too late to trade? Or am I approaching this one in the wrong manner?

Thanks for this though. :)
AndrewFaulkner

There are no shortcuts.
Jurij
Thanks for getting back to me Jurij. Guess I'll try to get through the forum posts. And thanks again for the code.
AndrewFaulkner
The thing is that there are many ways to trade recurrent/transient areas. So best is to understand the concept to create your own strategy.
Jurij
Is this applicable to stocks (instead of currency pairs )?
Jurij
@Jurij, is there a way to fix the lag of the arrows when they appear? I noticed on the one hour time frame, that the arrows don't appear until next day and on the one day, they don't appear until a few days down and by that time, it's too late. Is there a way to change that so that the arrows appear at the end of the one hour and appear at the end of the day of the daily chart? Plz Help
Jurij
For some reason it is said " Eurusdd, Professional Scammer ". You indicator is quite very good ! thanks !!
Transient Zones (TZ) and Potential Transient Zones (PTZ). are percentages and appear on the chart as lines - distorting the chart...
Debugger
Yes I know, I set it to be 100% trasnparent but they show up anyway. You have to disable the checkmark in the settings pane for those lines.
Hi Jurij , pls advise how to get it working at MT4 ?
THANKS
Very nice indicator, though it looks like the big green and red arrows are lagging, so it's too late to make good use of them. Is this supposed to be a lagging indicator?
AlistarElvis
This is not a general purpose indicator. To use it you have to understand the Transient Zones /Recurrent Zones theory of EURUSDD (ForexFactory member).
When do the large green and red arrows appear? Do they re-paint after a number of bars or is it realtime?
timj
I found decent settings for 15m and 1h and it seems to pick fractals nicely. Thanks for sharing!
IvanLabrie
IvanLabrie
@IvanLabrie, tried it on the one hour and arrows lag. Arrows don't pop up until a day later :(
timj
They appear after h_right bars have passed and no new high/low. The small arrows are potential transient zones, meaning if price makes no new high/low they will confirm to larget arrows after h bars. One can trade towards those PTZs or away from TZs, depends on strategy...
timj
if plotarrow statement mentions the offset argument, it means it is repainted. So the answer to your question is 'Yes'.

plotarrow(central_bar_is_highest ? -1 : 0, offset=-h_right-1)
plotarrow(central_bar_is_lowest ? 1 : 0, offset=-h_right-1)
could you please give more explanation ? .I allready did red 100 pages in forexfactory but I Could not understand how to find entries and where to Stop loss. also there are any kind of indicators there and they are different in the content and concept. also, if I Want to use your indicator, shall I wait for arrows ? or..........
ahmed.barakat1
That's because there is no predefined entry and exit. Once you understand the TZ concept you can build your own trading strategy around it.
TZ only gives probability for an event occurring within a specific (h) time constraint.
What does this offer that the zig-zag indicator does not?
Hey Jurij, I'm a long time lurker of EURUSDD's teachings. Thanks a ton for making this indicator! Any way we can get the developing TZs on the chart somehow? Keep up the great work.
Thanks. I'm new to the pine script language used by TW. If I understand it correctly it is not possible to cancel elements drawn on chart and no functions for drawing rectangles or zones, only dots. Without the possibility to delete chart objects it is not possible to cancel a PTZ that became invalid.
Is anyone using this while day trading the SPY?
It seems that cum(x) and cum(y) are counting tz in the entire data series instead of within sample_period. The tz/ptz probability drops as sample_period increases.
This is highly interesting! Good reading and bright ideas.
Somehow I don't see probability numbers up on screen.
Hi, the link to the Forex factory forum is page 286. Sorry but I don´t see anything about Transient Zone in that page.
400golpes
FF has moved the thread to the recycle bin, that's how they deal with loyal members... Check out penguintraders.com, I posted there an archived version as PDF of the thread with all attachments...
anyone using this to trade real time..seem like the signals are lagging...Jurij, anyway we can get this to work real-time..this would be the best working indicator on trading view if it worked real time
nheminism21
Thanks for programming this indicator. I await your revisions (todo list)! Question, I have TZ=78, PTZ=294, PTZR=73...how is it possibile to have PTZ @ 294%? Would you explain pls.
I just realized this system lags and the indicators don't show up at current market price.
QuantitativeExhaustion
no lag, arrow appear at candle close, this is grail system accuracy 95-99% -.-

sorry mate, couldn't resist.
this is not a system, it is an indicator that draw transient zones and potential TZs, no more
Jurij
thankfully this is not a comedy club :)

On advice that could actually work with this in regards to stock/etf trading more real time take a look at the williams vix fix

Jurij
the important thing is u tried and it kinda of works.. Ur effort is well appreciated.. Its not it works or not, its about ur effort to make it work.. That is the most important.. Same thing with trading... Its not about making money, it is about having more wins than losses. Eventually money comes in...
Jurij
@Jurij, hi, the arrows do lag and they don't appear at the candle close. Have you fixed that?
@adriannasantillan, there's nothing to fix, unless there's a function in pine script to get future data.
Just read the description and some comment replies...
For some reason that script doesnt work for me. The priceline switches to the top of the graph. There i can see red and green arrows and the grey line is drawing some pixels and and down. But not like in your picture. It looks like it got shrinked were much vertically. You know how to fix that? https://www.tradingview.com/e/4yPFaVKP/
What is the main purpose of this indicator? it's a buy sell signal ?
Hello, does not work
what can be done? Thanks
M-Forex
@M-Forex, mine comes up like that as well. what did you dod tofix it ifyou don't mind me asking? thanks in advance!
Is this Alert friendly ? I can see the 2 blue numbers of the indicator showing -1 or 1 >> (on close of each bar), how would you set it up ?
I set the display and all flattened, what to do?
Hi Jurij,

Very nice effort ! I am new to Pine myself but trying to get better. Along the way I found this little thing from Ricardo Santos,

Perhaps a way to draw rectangles on the charts?

(( Per

I copy and poaste it into Pine, and when I click add to chart, it removes the candles and everything else I had on my chart? Help please :)
nice code, high speed response at graph changes
If you are having visual problems like flat price chart after adding this script, you have to activate the "scale price chat only" option. To do this, click with the right mouse button on your chart, then select "Price scale" and check the "Scale price chart only" option.
Jurij
Hi Jurij,
i've been reading all your posts since the last 4 hours! this is very intresting! great effort!
i set everything on my chart and its like magic!

i just have a question does this work only on EURUSD?
and about the Grey prices in the middle when i put the mouse on a green or red arrow does it tell where the price is heading next?
if this works 100% i would be glad if you accept my donations afterwards.
thank you.
mroue26
the arrows appear after n bars have passed so not tradable in real time. thhe indicator was never intended for this purpose. it shows only potential transient zones (PTZ) that are confirmed ion true transient zones (TZ) after n bars.
this indicator looks fabulous BUT very lagging....Is there a workaround how you guys use this?????
ravi456
can anybody using this guide me how to use like timeframe/levels to use?
I didn't see any percentage value show up. Even in the above sample chart. need help
This indicator is repainted. Useless.
I stumbled upon this indicator and I'm trying to figure out what's behind it, it's not crystal clear yet. The original posts on ForexFactory are very confusing, I know the maths behind Markov (well I knew long time ago..) but the original poster was not making it reader friendly.
By searching a bit, someone made a clearer explanation to give at least the basics..

The only way I see this indicator tradeble without going through 1000s of pages is to be contrarian. When an arrow shows up, it's after the trend/minitrend is over, so take the opposite of whatever the arrow is showing. https://www.tradingview.com/chart/WxpCE8mK/
cristian.d

cristian.d
Can your observation/hypothesis be tested with the back-test functionalities on TV?
accidentje
I don't know. These TV strategies are not so relevant because of difficulty of setting reasonable stops. So the Profit Factor has to suffer; a PF of 1.5 in TV might be actually 3 if we take manual exits. The entries are what's important, the exits are subjective. I trust better my manual test and observation.
cristian.d
You so right. I trade much better without indicators. Just simple trendlines, patterns, candlestick patterns, volume,sma9,20,200 and ultimate oscillator is more than enough to make tons of cash.. these indicators dont let u make decision in time.. Trading is about timing and not about indicators. All indicators except Ult Oscillator show delayed info to decide.. U miss the timing u missed the trade and then regret or fear jumps in.. and money gone....
cristian.d
That is not the way to trade this indicator.
Does this work for 2 min stock charts.. I have no clue about coding. Can u help.
MONEYMENOW
can't see why it should not work on a specific time frame, so yes
Jurij
Thanks for this great work. it does not load on my trading view chat when added. what am i doing wrong yet other scripts work
belod4me
make sure you checked the "scale price chart only" option.
Right click on the chart -> Price Scale -> Scale price chart only
Jurij
how are you using that TZ bro if it is repainting ? what is the secret.... i mean here on TV in TradingView... if you post it let us know how NOT TO USE it but explain how to setting to not repainting.... with much respect
Are you sure this is not repainting?
joe_vijay
is repainting bro... you cant see the arrows in online mode....
hi, i had added the script as i add other but what is see only red and green bars .. whole chart is so minimized that i cant see it, no matter how much i zoom it .. help needed .. i can send you snapshot but dont know how ...
WaqasRabbani
When I apply this to my chart all the bars will disappear, am I doing something wrong or somebody else has the same situation?
Hey Jurij, How do you make the arrows more accurate to the market? my arrows are showing up like hours late... how do I tune it to show me the arrow on time with the market or sooner?
rich15stan
Maybe a crystal ball is the right tool :P
rich15stan
red and green bars show up after 10 bars have passed and a trend is confirmed.
10 candles... what time frame are you on? if I'm on a 15min time frame is it still ten candles? Jurij I use to have one but I lost it and was looking for a new one.
Anybody know how to make this scripts autoscale function properly? When I add it to my chart it automatically zooms as far out as possible.
Jurij, wow, this is incredible. Thanks to your indicator I learned about the transient zone concept. "It blew my mind", indeed. Too bad I didn't see this already 2 years ago. This changed the way I look at price movements. Your indicator code was the missing element in my trading system for optimizing and validating entries and exits. So simple, and so effective!
Jurij,

The script does not open up completely in my platform....Its like all Shrunk up, and I can't stretch it open.....what do I need to do .... :::?????
stevenafford
Right click near Y axis of chart and select Scale Price Chart only.
dev16108
wow.. it works.! thank you very much!
How do I set an alert either for small triangles or arrows
good day Jurij , great script , having a bit of difficulty , seems as if the pine editor loads with the trending arrows but the market is totally flat , strange I know , can you help , would greatly appreciate your help, looking forward to seeing your script in action
seanmichael
got it in scale price chart , thanx
awesome work mate :)
script is distorting my graph, shrinking it, what can I do to rectify? thanks, Ian
For some reason i try using this on my.. chart but nothing shows.. everything is flat lined
Dude you are great i can happly say this indicator wks 100%for mee
table
@table, how do you use this indicator?
table
@table, look what happens on my chart could u help me
https://www.screencast.com/t/BxRHh77QG
etienne.marechal
@etienne.marechal,
Hi Jurij. Do you know how to convert your transient zones code to amibroker (AFL) code?
Hi,

With H4 the arrow will appear right after the 4th candle to the right of the arrow candle, correct?

And does it repaint, or is this the only lag and thats it?

Hi is someone can help me i like this script i install it but when i activate in on my chart look in the small video screen shot what open , i can not see the indicator
https://www.screencast.com/t/BxRHh77QG
thks if u got the solution Guys
Etienne
How do I get arrows and triangles to appear under and over bars, instead of at the top of the chart in "tradingview"?
Jurij
Jurij
@Jurij, hi, genius
It`s a gold!
works great! Thank you!
hi, is there a way to scan for these? This works great! Thank you!
is there a way to create an alert on this code? I'm willing to pay
appear after pump or dump , they are to late . for exemple whene the price go up buy signal appear 15min before now , he wasn't there
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia

한국
Home Stock Screener Forex Signal Finder 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