Pine script to ProRealTime
Forums › ProRealTime English forum › ProRealTime platform support › Pine script to ProRealTime
- This topic has 14 replies, 2 voices, and was last updated 2 years ago by Nicolas.
-
-
04/06/2016 at 7:18 PM #4952
Hi,
Is there an easy way to convert pine script to ProRealTime? Tradingview.com has so many good strategies and indicators which would be fun to work with in ProRealTime.
Such as:
https://www.tradingview.com/script/ebcDTcRi-vdr-1min-Open-Close-v1-2-Long-Short-Edition/
All the best!
Simon04/06/2016 at 7:55 PM #4966Hello Simon, I already play a lot with Pinescript conversion to ProRealTime in the past and also recently to assist people.
Our member Xel, has also made some personal conversion of indicators too.
The strategy you are pointing is using Heiken Ashi candlesticks, right? I saw a lot of conditional “offset” variables to enter and exit market, they seems to have been optimized and for different specific instruments as well.
04/07/2016 at 9:41 AM #5002Thanks for reply!
Yes, I saw it uses Heiken Ashi, so maybe it repaints?
04/07/2016 at 2:10 PM #5010If Heiken Ashi candlesticks construction are set to the same timeframe, they don’t repaint. As long as I understand how Pinescript is functioning. Because I saw it were possible to use higher timeframe candles informations. So this strategy would be easily adapted to PRT.
04/07/2016 at 5:34 PM #5020Thanks for reply!
How can I get the code translated to PRT? Can somebody do it for free?
I think the spread dose not show on Tradingview, when a strategy is calculated.04/07/2016 at 6:11 PM #502104/07/2016 at 6:52 PM #502404/08/2016 at 7:54 AM #505911/15/2016 at 2:20 PM #16574Hi Nicolas
Do you know how one could do a MTF MA in pinescripts, but zero lag?
And how could one do the same with volatility stop and cci?
Cheers,
V
11/15/2016 at 2:51 PM #1657705/25/2020 at 11:27 AM #13316305/27/2020 at 6:03 PM #13348904/02/2022 at 4:53 PM #191067Hello, this is a pretty old post. I’d like to convert this stock screener from Pine script to Prorealcode. Can any of you help please?
//
study(“Confluence Candles”, overlay=true)
includeSymbol1 = input(true, “Include Symbol 1?”, group = “Symbols”)
useCurrentChartAsSymbol1 = input(true, “Use current chart’s symbol as Symbol 1”, group = “Symbols”)
symbol1 = input(“”, “Symbol 1”, group = “Symbols”)
includeSymbol2 = input(false, “Include Symbol 2?”, group = “Symbols”)
symbol2 = input(“”, “Symbol 2”, group = “Symbols”)
includeSymbol3 = input(false, “Include Symbol 3?”, group = “Symbols”)
symbol3 = input(“”, “Symbol 3”, group = “Symbols”)
includeSymbol4 = input(false, “Include Symbol 4?”, group = “Symbols”)
symbol4 = input(“”, “Symbol 4”, group = “Symbols”)
// Kill Switch for if no instruments were selected
killSwitch = not includeSymbol1 and not includeSymbol2 and not includeSymbol3 and not includeSymbol4
includeRsi = input(true, “Include RSI”, group = “RSI”)
rsiLength = input(7, “RSI Length”, group = “RSI”)
rsiBullThreshold = input(50, “RSI Bull Threshold”, group = “RSI”)
rsiBearThreshold = input(50, “RSI Bear Threshold”, group = “RSI”)
includeStoch = input(true, “Include Stochastic”, group = “Stochastic”)
periodK = input(14, title=”%K Length”, minval=1, group = “Stochastic”)
smoothK = input(1, title=”%K Smoothing”, minval=1, group = “Stochastic”)
periodD = input(3, title=”%D Smoothing”, minval=1, group = “Stochastic”)
useStochD = input(false, “Use Stochastic D instead of K”, group = “Stochastic”)
stochBullThreshold = input(50, “Stochastic Bull Threshold”, group = “Stochastic”)
stochBearThreshold = input(50, “Stochastic Bear Threshold”, group = “Stochastic”)
includeMacdHist = input(true, “Include MACD Histogram”, group = “MACD”)
macdFastLength = input(12, “MACD Fast Length”, group = “MACD”)
macdSlowLength = input(26, “MACD Slow Length”, group = “MACD”)
macdSignalLength = input(9, “MACD Signal Length”, group = “MACD”)
// Kill Switch for if no indicators are selected
confluenceKillSwitch = not includeMacdHist and not includeRsi and not includeStoch
stochastic(periodK, smoothK, periodD) =>
k = sma(stoch(close, high, low, periodK), smoothK)
d = sma(k, periodD)
output = useStochD ? d : k
confluence() =>
[_, _, histLine] = macd(close, macdFastLength, macdSlowLength, macdSignalLength)
rsiLine = rsi(close, rsiLength)
stochLine = stochastic(periodK, smoothK, periodD)
histBull = includeMacdHist ? histLine > 0 : true
histBear = includeMacdHist ? histLine <= 0 : true
rsiBull = includeRsi ? rsiLine > rsiBullThreshold : true
rsiBear = includeRsi ? rsiLine < rsiBearThreshold : true
stochBull = includeStoch ? stochLine > stochBullThreshold : true
stochBear = includeStoch ? stochLine < stochBearThreshold : true
signal = histBull and rsiBull and stochBull and not confluenceKillSwitch ? 1 : histBear and rsiBear and stochBear and not confluenceKillSwitch ? -1 : 0
confluenceSymbol1 = useCurrentChartAsSymbol1 ? confluence() : security(symbol1, “”, confluence())
confluenceSymbol2 = security(symbol2, “”, confluence())
confluenceSymbol3 = security(symbol3, “”, confluence())
confluenceSymbol4 = security(symbol4, “”, confluence())
symbol1BullFilter = includeSymbol1 ? confluenceSymbol1 == 1 : true
symbol1BearFilter = includeSymbol1 ? confluenceSymbol1 == -1 : true
symbol2BullFilter = includeSymbol2 ? confluenceSymbol2 == 1 : true
symbol2BearFilter = includeSymbol2 ? confluenceSymbol2 == -1 : true
symbol3BullFilter = includeSymbol3 ? confluenceSymbol3 == 1 : true
symbol3BearFilter = includeSymbol3 ? confluenceSymbol3 == -1 : true
symbol4BullFilter = includeSymbol4 ? confluenceSymbol4 == 1 : true
symbol4BearFilter = includeSymbol4 ? confluenceSymbol4 == -1 : true
bullish = symbol1BullFilter and symbol2BullFilter and symbol3BullFilter and symbol4BullFilter and not killSwitch
bearish = symbol1BearFilter and symbol2BearFilter and symbol3BearFilter and symbol4BearFilter and not killSwitch
barcolor(bullish ? #00FF00 : bearish ? #FF0000 : color.gray)
// Alerts
greenCandleAlerts = input(true, “Alerts for candle color changing to GREEN”, group=”Alerts”)
redCandleAlerts = input(true, “Alerts for candle color changing to RED”, group=”Alerts”)
grayCandleAlerts = input(true, “Alerts for candle color changing to GRAY”, group=”Alerts”)
if (greenCandleAlerts and bullish and not bullish[1])
alert(“Candle color changed to GREEN”, alert.freq_once_per_bar_close)
if (redCandleAlerts and bearish and not bearish[1])
alert(“Candle color changed to RED”, alert.freq_once_per_bar_close)
if (grayCandleAlerts and not bullish and not bearish and (bullish[1] or bearish[1]))
alert(“Candle color changed to GRAY”, alert.freq_once_per_bar_close)
04/02/2022 at 5:12 PM #191072Edit: This is not a screener, this is an indicator. Source: https://www.tradingview.com/script/rhE9Itaw-Confluence-Candles/
Stilll, it would be great to be able to screen stocks with proscreener based on the same logic.
Default Logic
Green Candles
RSI > 50
Stochastic > 50
MACD Histogram > 0Red Candles
RSI < 50
Stochastic < 50
MACD Histogram < 0When multiple symbols are selected, the above needs to be true for all selected symbols.
04/04/2022 at 8:42 AM #191128 -
AuthorPosts
Find exclusive trading pro-tools on