The RoMDD looks good :)
Checked in ETHUSDT 1hour with auto HTF ON.
Have a look :)
I sann TradingView-anda har författaren till detta skript publicerat det som öppen källkod, så att handlare kan förstå och verifiera det. Skål för författaren! Du kan använda den gratis men återanvändning av den här koden i en publikation regleras av våra Ordningsregler. Du kan göra den till favorit för att använda den i ett diagram.
Consider showing your appreciation through comments
You can also buy us a healthy snack
Wallet address for USDT :
TRC20 on Tron Blockchain
Add this code on a 1 min chart,
study("My Script", overlay=true)
f_Security(_symbol, _res, _src) => security(_symbol, _res, _src, lookahead = barmerge.lookahead_on)
plot(f_Security(syminfo.tickerid,'5',close),color=color.navy) //stable output without repaint
plot(security(syminfo.tickerid,'5',close),color=color.black) //instable output and repainting to old
plot(security(syminfo.tickerid,'5',close, lookahead = barmerge.lookahead_on),color=color.silver) //instable output and repainting to future
For every curve we try to describe, we need to keep track of few things:
- A : 5 min candle close(HTF)
- B : 1 min candle close
- C : curve output in 1 min timeframe
We will refer to them as A, B and C to simplify things.
"A(12:10)" means close of 5 min candle at 12:10. This is representing time from 12:10:00 to 12:14:59
Let us study each curve. First, we will look at the black curve
security(syminfo.tickerid,'5',close)// we will call this C
When you plot this, you will immediately see a curve plotting the last closed candle in 5 min, our HTF.
It is flat at this value, till, we see a new close in HTF.
If you notice carefully, after the indicator is plotted, you are seeing an unstable output, wiggly end points.
It trying to approximate the latest close, even before it has closed.
Once the HTF candle has closed. For example, C(12:14) aligns with A(12:10) . We will see the black line latching on the close.
Also, the wiggly line is now flat. Means, it has repainted. If it has not, just refresh your chart and you will get a perfect curve.
For example, 1 min timeframe 12:12 candle black curve, C(12:12) is repainted to A(12:05), that we already know as B(12:09).
If you notice, C(12:12) repainted to a value we knew at 12:10.
Now we will consider the silver curve
security(syminfo.tickerid,'5',close, lookahead = barmerge.lookahead_on)//we will call this D
If you notice, carefully, in a few 1 min candles, you will see that, the wiggly values of the black and the silver curve is the same.
When the HTF candle is closed, it is repainted to be looking ahead, in the sense that, we repaint D(12:10) through D(12:14) to A(2:10).
Note that, B(12:14) is same as A(12:10), this value is used for D(12:12). This data was not available at 12:12
So, we have seen 2 kinds of repainting at 12:12 candle. Black curve is repainting to known value, while silver curve is repainting to values unavailable at that time.
Ideally, we want to be as close as possible to the repainted black curve, latest data, but, without the repainting.
Here comes in the blue curve,
security(_symbol, _res, _src, lookahead = barmerge.lookahead_on)
Notice, the output is delayed from black curve by a 1 min candle, but, output is stable.
To put it tersely, "it is repainting to same known value".
Please, work that out as an exercise.
Read "we repaint D(12:10) through D(12:14) to A(2:10)."
as "we repaint D(12:10) through D(12:14) to A(12:10)."
Typed the wrong time
repaint = security(syminfo.tickerid, "D", close) noRepaint = security(syminfo.tickerid, "D", closeBRACKET 1 BRACKET, lookahead = barmerge.lookahead_on)
I would encourage you to see the following scripts for further info: