HyperTrend translate from Tradingview
Forums › ProRealTime English forum › ProBuilder support › HyperTrend translate from Tradingview
- This topic has 30 replies, 8 voices, and was last updated 1 year ago by PeterSt.
-
-
08/16/2023 at 9:12 AM #219153
Hello Nicolas,
You’re welcome.
your list of conversions in progress is not up to date : some indicators have been already converted (trendilo, ut bot alerts…) and others can’t be converted because the code is not available (smart money concept for example) because the script is published closed-source.
I have also my own list of conversion to do… 🙂
But i can try to convert 1-2-3 pattern.
For smart money concept, there is those 3 scripts that can be equal if not better than the one of the conversions list :
https://www.tradingview.com/script/CnB3fSph-Smart-Money-Concepts-LuxAlgo/
https://www.tradingview.com/script/ib4uqBJx-ICT-Concepts-LuxAlgo/
https://www.tradingview.com/script/ZpHqSrBK-Market-Structure-CHoCH-BOS-Fractal-LuxAlgo/
08/16/2023 at 10:04 PM #219226For your information, here is the (non-exhaustive) list of conversions in progress: https://docs.google.com/spreadsheets/d/1x-GJwezHPpQwqy1qBj6ygf2nx160f1aLgtQWflMO1_U/edit?usp=sharing
Hi Nicolas,
If it can help the community. I did the conversion of the 1-2-3 Pattern of your conversions’ list
I have not seen where and how i was supposed to add the itf file in the library, so i add it here.
On the original indicator high or low can trigger the signal and be considered as a breakout ; i change this by close instead of high or low.
Also on the original indicator array were used, i did not. It was useless as only 3 last values were needed by the process of detection.
Also, i think it is possible to improve the indicator a lot :
First, it can be improved easily to found all 1-2-3 pattern for a large range of period value, not only one like in the original indicator
Second, in the original indicator, the last pivot must be detected before the breakout happens, which can prevent the indicator of detecting the pattern and the breakout as the breakout happens before the period to finish… It can be solve also
2 users thanked author for this post.
08/21/2023 at 10:56 AM #219409I still can’t add post in the Library…
When i try, i am asked to upload a picture, and i can fill everything but i can’t upload the ITF file, and my post does not appear in the Library…
When i click on “Add/Edit Attachments” nothing happen, i just return at the top of the same page.
How can i do to solve that bug?
Thanks
08/21/2023 at 11:31 AM #21941508/21/2023 at 12:00 PM #21941708/21/2023 at 3:45 PM #219439With respect to the Hypertrend (from LuxAlgo) conversion to PRT. I am not convinced that this conversion reliably copies the Tradingview behaviour. I compared the Tradingview chart with the PRT chart for the S&P500 in the first quarter of this year. Screen captures added. Of course with exactly the same configuration, 5, 14 and 80 (defaults).
The number of channel changes is modest in Tradingview, and huge in PRT. I guess that some Tradingview-math has been ill translated. Seems worthwhile to have someone check it and propose a correction?
08/21/2023 at 10:52 PM #219459Maybe AverageTrueRange is not calculated the same way on TradingView and ProrealTime ?
On Prorealtime, Average True Range is calculated by applying a Wilder moving average to the True Range
while on TradingView a Relative Moving Average is applyed to the true range…
Relative moving average does not existe on prorealtime ?
Is it possible to compage atr on both ?
08/22/2023 at 8:49 AM #219464This is the standard formula for the ATR indicator:
ATR - Average True Range12345678910111213141516171819202122232425262728// ATR formula//// https://en.wikipedia.org/wiki/Average_true_range// https://www.youtube.com/watch?v=jjsje1E3hVM// https://www.investopedia.com/terms/a/atr.asp// https://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:average_true_range_atr//// Calculation of TR://// The range of a day's trading is simply high − low {\displaystyle {\text{high}}-{\text{low}}} {\displaystyle {\text{high}}-{\text{low}}}.// The true range extends it to yesterday's closing price if it was outside of today's range://// MyTR = max(Range,max(abs(high − close[1]),abs(low − close[1])))//// The true range is the largest of the:// Most recent period's high minus the most recent period's low// Absolute value of the most recent period's high minus the previous close// Absolute value of the most recent period's low minus the previous close//// Calculation of ATR (of P periods):p = 10MyTR = max(Range,max(abs(high - close[1]),abs(low - close[1])))IF BarIndex < p THENMyATR = MyTRELSEMyATR = ((MyATR[1] * (p - 1)) + MyTR) / pENDIFRETURN MyATR08/22/2023 at 9:27 AM #219465Strange how i get 3 differents results for ATR[200]
First is ATR from prorealtime, second is calculated with the RMA script found below, and last with the script of ATR formula above…
https://www.prorealcode.com/prorealtime-indicators/rma-recursive-moving-average/
Not sure which one stick the more to the ATR calculated by tradingview.
08/22/2023 at 9:30 AM #21946708/22/2023 at 9:41 AM #219468The difference in ATR between Tradingview and PRT doesn’t explain the large number of channel changes in PRT. I do acknowledge that the Tradingview ATR values are roughly 8 points higher than those calculated by PRT. Adding this offset to PRT doesn’t change the number of channel changes. Something else going on there too.
Back to the ATR calculation. As shown in the screen captures the ATR of Tradingview lies roughly between 20 and 25, whereas the ATR of PRT lies between 10 and 15 for the first quarter of 2023. The PRT screen capture shows the standard ATR and Roberto’s ATR. They are identical.We need a Tradingview-PRT-detective to research on the correct conversion of the mathematics I guess.
08/22/2023 at 10:24 AM #219471The difference in ATR between Tradingview and PRT doesn’t explain the large number of channel changes in PRT. I do acknowledge that the Tradingview ATR values are roughly 8 points higher than those calculated by PRT. Adding this offset to PRT doesn’t change the number of channel changes. Something else going on there too.
It does, because of line 15 in the script
“If abs(close – avg) > atr then“More ATR is bigger, less channel change there will be.If ATR is 8 to 10 points less in Prorealtime, then there will be more change in channel.Also 8 to 10 points more than 10 to 15 points is 80% more… It is a huge difference!08/22/2023 at 10:33 AM #219472I found the formula of RMA of tradingviw, hr blow, i will do the conversion to have the same atr, but i have no time today (traveling day)
https://fr.tradingview.com/pine-script-reference/v5/#fun_ta.rma
https://www.tradingcode.net/tradingview/relative-moving-average/
08/22/2023 at 1:41 PM #219483I found the reason behind the big difference in charts Tradingview and PRT. The broker chosen by LuxAlgo only gives candles during normal pre-market and market opening hours. PRT/IG gives 24 hourly candles per day. If I switch to another cfd broker dealing all day like IG, you get the same chart as in PRT (including same values for ATR). See screen capture.
What this means with respect to signals given by this indicator with a opening hours only broker versus a 24-24 broker, I do not know. More, less, more or less reliable, … happy backtesting.
No need to change the code, sorry for the fuzz, although I did learn something about the effect of the different brokers on signals given by an indicator.08/22/2023 at 4:36 PM #219499ATR Calculation Methods and Formulas – Macroption
Try this website.
-
AuthorPosts
Find exclusive trading pro-tools on