Convert Trading View Code to ProrealCode
Forums › ProRealTime English forum › ProBuilder support › Convert Trading View Code to ProrealCode
- This topic has 22 replies, 3 voices, and was last updated 8 months ago by Iván.
-
-
03/12/2024 at 9:26 AM #22963303/12/2024 at 10:22 AM #229643
Ivan
Yes, I used Key value as 3 and ATR period as 10. See attached screenshot with all value visible. As you can see signal number 1, 4 and 5 of trading view is same as signal number 1, 6 & 7.
However, trading view only had 5 signals since 15th Feb 2024, while PRT code had 7 signals so far. Out of 7 signals on PRT signal number 2, 3 doesn’t match with date on Trading view while signal number 4 & 5 are additional signal in PRT that you don’t have in trading view.
You just need to change your key value i.e. a as 3 in your setting and keep ATR value as 10 and you will also see same results.
let me know with sensitivity set you see only 5 signals on PRT as well.
I used TIF file that you attached with previous comment number #229602
03/12/2024 at 12:35 PM #229652Pues perdona pero no lo entiendo. Como puedes ver en la imagend adjunta son exactamente las mismas señales.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293//PRC_UT Bot Alerts//version = 1//15.02.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge///inputsa = 3 //Key Vaule. 'This changes the sensitivity' - Decimalc = 10 //ATR period - Integerdrawsignals = 1 //Show arrows - Booleancolorcandles = 1 //Color candles - Booleanheikin = 1 // boolean. True work as Heikin A/////////////////xatr = averagetruerange[c](close)nLoss = a * xatrif heikin thensrc = (open+close+high+low)/4elsesrc = closeendifif barindex < c thenxatrTrailingStop = undefinedpos = 0elseif src > xatrTrailingStop[1] and src[1] > xatrTrailingStop[1] thenxAtrTrailingStop = max(xatrTrailingStop[1],src-nLoss)elseif src < xatrTrailingStop[1] and src[1] < xatrTrailingStop[1] thenxAtrTrailingStop = min(xatrTrailingStop[1],src+nLoss)elseif src > xatrTrailingStop[1] thenxAtrTrailingStop = src-nLosselsexAtrTrailingStop = src+nLossendifendifendifif src[1] < xatrTrailingStop[1] and src > xAtrTrailingStop[1] thenpos = 1r=250g=0b=0elseif src[1] > xatrTrailingStop[1] and src < xatrTrailingStop[1] thenpos = -1r=0g=0b=250elsepos = pos[1]endifendifendif///////Trading conditionsema = average[1](src)above = ema crosses over xatrTrailingStopbelow = ema crosses under xatrTrailingStopbuy1 = src > xatrTrailingStop and abovesell1 = src < xatrTrailingStop and belowbarbuy = src > xatrTrailingStopbarsell = src < xatrTrailingStop//////Plot signals and candlesif drawsignals thenif buy1 thendrawarrowup(barindex,low-0.15*averagetruerange[10])coloured("green")elsif sell1 thendrawarrowdown(barindex,high+0.15*averagetruerange[10])coloured("red")endifendifif colorcandles thenif barbuy thenrbar=0gbar=250bbar=0elsif barsell thenrbar=250gbar=0bbar=0elserbar=125gbar=125bbar=125endifDRAWCANDLE(open, high, low, close)coloured(rbar,gbar,bbar)endifreturn xatrTrailingStop as "Trailing Stop" coloured(r,g,b)style(line,2)1 user thanked author for this post.
03/13/2024 at 6:19 AM #229669Curiosamente, ambos usamos la misma configuración y obtenemos los mismos resultados en PRT pero diferentes en TradingView. Por mi parte, debe haber algún problema en TradingView.
¿Cómo convierto este indicador en un filtro donde obtengo los resultados de la acción que tiene una flecha verde?
I used Google translate to convert into Spanish… hope it is readable at your end !
03/13/2024 at 7:05 AM #229670Ivan,
I attempted to convert the indicator code into screener as below but results don’t show the stock where they are at BUY candle. I attempted to comment our the code line not required for screener but kept in the code so it’s easy to review what lines are removed.
are you able to look at it please. thanks,
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899//PRC_UT Bot Alerts//version = 1//15.02.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge///inputs//drawsignals = 1 //Show arrows - Boolean//colorcandles = 1 //Color candles - Booleana = 1 //Key Vaule. 'This changes the sensitivity' - Decimalc = 10 //ATR period - Integer//heikin = 1 // boolean. True work as Heikin A/////////////////xatr = averagetruerange[c](close)nLoss = a * xatrsrc = (open+close+high+low)/4//if heikin then//src = (open+close+high+low)/4//else//src = close//endifif barindex < c thenxatrTrailingStop = undefinedpos = 0elseif src > xatrTrailingStop[1] and src[1] > xatrTrailingStop[1] thenxAtrTrailingStop = max(xatrTrailingStop[1],src-nLoss)elseif src < xatrTrailingStop[1] and src[1] < xatrTrailingStop[1] thenxAtrTrailingStop = min(xatrTrailingStop[1],src+nLoss)elseif src > xatrTrailingStop[1] thenxAtrTrailingStop = src-nLosselsexAtrTrailingStop = src+nLossendifendifendifif src[1] < xatrTrailingStop[1] and src > xAtrTrailingStop[1] thenpos = 1//r=250//g=0//b=0elseif src[1] > xatrTrailingStop[1] and src < xatrTrailingStop[1] thenpos = -1//r=0//g=0//b=250elsepos = pos[1]endifendifendif///////Trading conditionsema = average[1](src)above = ema crosses over xatrTrailingStop//below = ema crosses under xatrTrailingStopbuy1 = src > xatrTrailingStop and abovescreener[buy1]//sell1 = src < xatrTrailingStop and below//barbuy = src > xatrTrailingStop//barsell = src < xatrTrailingStop//////Plot signals and candles//if drawsignals then//if buy1 then//drawarrowup(barindex,low-0.15*averagetruerange[10])coloured("green")//elsif sell1 then//drawarrowdown(barindex,high+0.15*averagetruerange[10])coloured("red")//endif//endif//if colorcandles then//if barbuy then//rbar=0//gbar=250//bbar=0//elsif barsell then//rbar=250//gbar=0//bbar=0//else//rbar=125//gbar=125//bbar=125//endif//DRAWCANDLE(open, high, low, close)coloured(rbar,gbar,bbar)//endif//return xatrTrailingStop as "Trailing Stop" coloured(r,g,b)03/15/2024 at 9:37 AM #229812Hello It is very likely that the indicator code (configured parameters) does not match the search engine parameters. I have checked the code you have passed and I have configured the indicator with your screener code and it works correctly.
1 user thanked author for this post.
03/19/2024 at 11:38 AM #230015Ivan
Thank you but I am not sure why it doesn’t work on my system.
Can you please send me your itf file for this screener please ?
Also, I have a query if you don’t mind and I did search on the manual but couldn’t find exactly what I am looking for.
I am making a simple code for the screener but i am making it for 3 day candle timeframe instead of daily candle. Below is the code for 1 day candle but not sure what i need to change in below code to get output for 3 day candle timeframe.
12345678C1 = close > ExponentialAverage[10]C2 = Close > highest[2](close[1])if C1 and C2 thenScreener[c2]endif03/19/2024 at 12:33 PM #230020Hi,
This is the code. Just copy and paste:1234567891011121314151617181920212223242526272829303132333435363738394041424344//PRC_UT Bot Alerts//version = 1//15.02.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledgea = 1 //Key Vaule. 'This changes the sensitivity' - Decimalc = 10 //ATR period - Integer/////////////////xatr = averagetruerange[c](close)nLoss = a * xatrsrc = (open+close+high+low)/4if barindex < c thenxatrTrailingStop = undefinedpos = 0elseif src > xatrTrailingStop[1] and src[1] > xatrTrailingStop[1] thenxAtrTrailingStop = max(xatrTrailingStop[1],src-nLoss)elseif src < xatrTrailingStop[1] and src[1] < xatrTrailingStop[1] thenxAtrTrailingStop = min(xatrTrailingStop[1],src+nLoss)elseif src > xatrTrailingStop[1] thenxAtrTrailingStop = src-nLosselsexAtrTrailingStop = src+nLossendifendifendifif src[1] < xatrTrailingStop[1] and src > xAtrTrailingStop[1] thenpos = 1elseif src[1] > xatrTrailingStop[1] and src < xatrTrailingStop[1] thenpos = -1elsepos = pos[1]endifendifendif///////Trading conditionsema = average[1](src)above = ema crosses over xatrTrailingStopbuy1 = src > xatrTrailingStop and abovescreener[buy1]Timeframe could be only 1mn|2mn|3mn|5mn|10mn|15mn|30mn|1h|2h|3h|4h|daily|weekly|monthly|quarterly|yearly
About your code. It’s not working because it’s wrong codified. Should be like this:1234C1 = close > ExponentialAverage[10]C2 = Close > highest[2](close[1])screener [C1 and C2]1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on