Pine Script collection
СтатистикаPineScripts for sharing, testing and educational purposes
- Последний пост
- 22 февр. 2025 г.
- Последнее чтение
- 15 авг.
- Постов за неделю
- 0
- Всего постов
- 20
- Тип
- открытый
- Язык
- английский
- Категория
- Экономика (по похожим)
- В каталоге с
- 15 авг.
- 1/24сутки в ленте
- —
- 1/48двое суток
- —
- 1/72трое суток
- —
Оценка по просмотрам недавних постов: пост набирает почти всё за первые сутки.
Посты
//@version=6 indicator("Crypto Pair Selector", overlay=true) // Define a list of crypto pairs cryptoPairs = input.string("BINANCE:BTCUSDT", title="Choose Crypto Pair", options=["BINANCE:BTCUSDT", "BINANCE:ETHUSDT", "BINANCE:XRPUSDT", "BINANCE:LTCUSDT", "BINANCE:NOTUSDT", "BINANCE:TRXUSDT", "BINANCE:SHIBUSDT", "BINANCE:TONUSDT", "BINANCE:SOLUSDT", "BINANCE:DOGEUSDT"]) // Add input for price type selection priceType = input.string("Close", title="Select Price Type", options=["Open", "Close"]) // Get the selected crypto pair's open or close price based on user selection selectedPrice = request.security(cryptoPairs, timeframe.period, priceType == "Close" ? close : open) // Plot the selected crypto pair's price plot(selectedPrice, title="Selected Crypto Pair Price", color=color.rgb(242, 105, 255), linewidth=2) #MyCode @pinescripter
Crypto Pair Selector #For_Future_Developments #MyCode @pinescripter
@pinescripter
Momentum Cloud Bollinger Bands Main credits goes to Waldo Updated and modified for better functioning @pinescripter
//@version=6 indicator("Fear and Greed Indicator", overlay=true) // Parameters volumeLength = input.int(20, title="Volume SMA Length") rsiLength = input.int(14, title="RSI Length") rsiOverbought = input.int(70, title="RSI Overbought Level") rsiOversold = input.int(30, title="RSI Oversold Level") rsiSensitivity = input.float(1.0, title="RSI Sensitivity", minval=0.1, step=0.1) // Added RSI Sensitivity volumeSensitivity = input.float(1.0, title="Volume Sensitivity", minval=0.1, step=0.1) // Added Volume Sensitivity // Calculate Volume SMA volumeSMA = ta.sma(volume, volumeLength) * volumeSensitivity // Calculate RSI rsi = ta.rsi(close, rsiLength) * rsiSensitivity // Create Fear and Greed levels fear = rsi < rsiOversold greed = rsi > rsiOverbought // Track signals var bool fearSignalSent = false var bool greedSignalSent = false if (fear and not fearSignalSent) fearSignalSent := true greedSignalSent := false // Reset greed signal when fear is triggered if (greed and not greedSignalSent) greedSignalSent := true fearSignalSent := false // Reset fear signal when greed is triggered // Highlight the candle chart for fear and greed zones bgcolor(fear ? color.new(color.red, 65) : na, title="Fear Zone Background") bgcolor(greed ? color.new(color.green, 65) : na, title="Greed Zone Background") // Plot Volume SMA plot(volumeSMA, title="Volume SMA", color=color.orange, linewidth=2, display=display.none) // Optionally, you can add alerts for the signals alertcondition(fearSignalSent, title="Fear Signal", message="Fear signal triggered") alertcondition(greedSignalSent, title="Greed Signal", message="Greed signal triggered") #MyCode @pinescripter
Fear and Greed Indicator #MyCode @pinescripter
New Revision to Show/Hide Signals and Arrows in settings: //@version=6 strategy(title="AL Brooks Price Action with MACD Signals", shorttitle="AL Brooks PA + MACD", overlay=true) // Inputs length = input.int(52, title="Moving Average Length", minval=1) riskRewardRatio = input.float(2.0, title="Risk/Reward Ratio", minval=1.0) stopLossBuffer = input.float(0.01, title="Stop Loss Buffer (in %)", minval=0.001) candleType = input.string("Close", title="Candle Type", options=["Close", "Open"]) hideArrowLabels = input.bool(false, title="Hide Arrow Labels") hidePositionLabels = input.bool(false, title="Hide Position Labels") // New input for hiding position labels // Indicators sma = ta.sma(close, length) [macdLine, signalLine, _] = ta.macd(close, 12, 26, 9) price = candleType == "Close" ? close : open // Trend Conditions uptrend = price > sma downtrend = price < sma // Buy/Sell Signals buySignal = price > sma and macdLine > 0 and macdLine > signalLine sellSignal = price < sma and macdLine < 0 and macdLine < signalLine // Trade Execution if (buySignal) longStopLoss = close * (1 - stopLossBuffer) longTakeProfit = close + (close - longStopLoss) * riskRewardRatio if not hidePositionLabels strategy.entry("Buy", strategy.long) strategy.exit("Take Profit", "Buy", limit=longTakeProfit, stop=longStopLoss) if (sellSignal) shortStopLoss = close * (1 + stopLossBuffer) shortTakeProfit = close - (shortStopLoss - close) * riskRewardRatio if not hidePositionLabels strategy.entry("Sell", strategy.short) strategy.exit("Take Profit", "Sell", limit=shortTakeProfit, stop=shortStopLoss) // Define arrows to plot buyArrow = hideArrowLabels ? na : (buySignal[2] ? 1 : na) sellArrow = hideArrowLabels ? na : (sellSignal[2] ? -1 : na) // Plot Signals plotarrow(buyArrow, colorup=color.new(color.green, 50), title="Buy Signal Arrow", offset=-1) plotarrow(sellArrow, colordown=color.new(color.red, 50), title="Sell Signal Arrow", offset=-1) // Close Positions if (not buySignal and not sellSignal) strategy.close("Sell") strategy.close("Buy") // Support and Resistance support = ta.lowest(low, length) resistance = ta.highest(high, length) plot(support, title="Support", color=color.green, linewidth=1, style=plot.style_stepline) plot(resistance, title="Resistance", color=color.red, linewidth=1, style=plot.style_stepline) plot(sma, title="SMA", color=color.blue, linewidth=2) // Alerts alertcondition(buySignal[2], title="Buy Alert", message="Buy Signal Triggered") alertcondition(sellSignal[2], title="Sell Alert", message="Sell Signal Triggered")
//@version=6 strategy(title="Al Brooks Price Action with MACD Signals", shorttitle="Al Brooks PA + MACD", overlay=true) // Inputs length = input.int(52, title="Moving Average Length", minval=1) riskRewardRatio = input.float(2.0, title="Risk/Reward Ratio", minval=1.0) stopLossBuffer = input.float(0.01, title="Stop Loss Buffer (in %)", minval=0.001) candleType = input.string("Close", title="Candle Type", options=["Close", "Open"]) // Indicators sma = ta.sma(close, length) [macdLine, signalLine, _] = ta.macd(close, 12, 26, 9) price = candleType == "Close" ? close : open // Trend Conditions uptrend = price > sma downtrend = price < sma // Buy/Sell Signals buySignal = price > sma and macdLine > 0 and macdLine > signalLine sellSignal = price < sma and macdLine < 0 and macdLine < signalLine // Trade Execution if (buySignal) longStopLoss = close * (1 - stopLossBuffer) longTakeProfit = close + (close - longStopLoss) * riskRewardRatio strategy.entry("Buy", strategy.long) strategy.exit("Take Profit", "Buy", limit=longTakeProfit, stop=longStopLoss) if (sellSignal) shortStopLoss = close * (1 + stopLossBuffer) shortTakeProfit = close - (shortStopLoss - close) * riskRewardRatio strategy.entry("Sell", strategy.short) strategy.exit("Take Profit", "Sell", limit=shortTakeProfit, stop=shortStopLoss) // Plot Signals plotarrow(buySignal[2] ? 1 : na, colorup=color.new(color.green, 50), title="Buy Signal Arrow", offset=-1) plotarrow(sellSignal[2] ? -1 : na, colordown=color.new(color.red, 50), title="Sell Signal Arrow", offset=-1) // Close Positions if (not buySignal and not sellSignal) strategy.close("Sell") strategy.close("Buy") // Support and Resistance support = ta.lowest(low, length) resistance = ta.highest(high, length) plot(support, title="Support", color=color.green, linewidth=1, style=plot.style_stepline) plot(resistance, title="Resistance", color=color.red, linewidth=1, style=plot.style_stepline) plot(sma, title="SMA", color=color.blue, linewidth=2) // Alerts alertcondition(buySignal[2], title="Buy Alert", message="Buy Signal Triggered") alertcondition(sellSignal[2], title="Sell Alert", message="Sell Signal Triggered")
Strategy - Al Brooks Price Action with MACD Signals #MyCode @pinescripter
ICT Price Action - based on Equilibrium Point (EP) This Pine Script code defines an indicator named "ICT Price Action - based on Equilibrium Point (EP)" which aims to identify key price levels using Fibonacci retracement levels and an equilibrium point. The script takes input parameters for two Fibonacci retracement levels (0.618 and 0.382) and calculates the highest high and lowest low over a specified lookback period (default is 20). The equilibrium point (EP) is determined by averaging the highest high and lowest low. Additionally, the script identifies supply and demand zones using the Fibonacci levels. Finally, the equilibrium point is plotted on the chart as a blue line, providing a visual reference for traders to identify potential support and resistance levels. Buy above/Sell below the Blue Line //@version=6 indicator("ICT Price Action - based on Equilibrium Point (EP)", overlay=true) // Input parameters for Fibonacci levels fibRetraceLevel1 = input.float(0.618, title="Fibonacci Level 1", step=0.01) fibRetraceLevel2 = input.float(0.382, title="Fibonacci Level 2", step=0.01) // Calculate the highest high and lowest low for a specified period length = input.int(20, title="Lookback Period", minval=1) highestHigh = ta.highest(high, length) lowestLow = ta.lowest(low, length) // Calculate the Equilibrium Point (EP) equilibriumPoint = (highestHigh + lowestLow) / 2 // Identify Supply and Demand Zones supplyZone = highestHigh - (highestHigh - lowestLow) * fibRetraceLevel1 demandZone = lowestLow + (highestHigh - lowestLow) * fibRetraceLevel2 // Plot Equilibrium Point plot(equilibriumPoint, title="Equilibrium Point (EP)", color=color.blue, linewidth=2)
ICT Price Action - based on Equilibrium Point (EP) #MyCode @pinescripter
Al Brooks Price Action with MACD Signals #MyCode @pinescripter The provided Pine Script code implements an Al Brooks price action trading strategy that allows users to choose between using the closing or opening price of candles for generating buy and sell signals. The script calculates a simple moving average (SMA) to determine the trend direction and uses the MACD indicator to assess momentum. A buy signal is triggered when the selected price is above the SMA, and the MACD line is greater than zero and above the signal line. Conversely, a sell signal occurs when the selected price is below the SMA, and the MACD line is less than zero and below the signal line. The script also plots dynamic support and resistance levels, the SMA, and buy/sell arrows with 50% transparency for visual clarity. Additionally, it calculates stop loss and take profit levels, although these are not displayed on the chart. Overall, this script provides traders with a flexible tool for identifying potential trading opportunities based on price action and momentum indicators. Buy by green/Sell by red bars //@version=6 indicator(title="Al Brooks Price Action with MACD Signals", shorttitle="AB PA MACD", overlay=true) // Inputs for defining key levels length = input.int(52, title="Moving Average Length", minval=1) riskRewardRatio = input.float(2.0, title="Risk/Reward Ratio", minval=1.0) stopLossBuffer = input.float(0.01, title="Stop Loss Buffer (in %)", minval=0.001) // Input for choosing candle type candleType = input.string("Close", title="Candle Type", options=["Close", "Open"]) // Calculate a simple moving average for trend direction sma = ta.sma(close, length) // Calculate MACD [macdLine, signalLine, _] = ta.macd(close, 12, 26, 9) // Determine the price to use based on user selection price = candleType == "Close" ? close : open // Identify trend direction uptrend = price > sma downtrend = price < sma // Buy and Sell Signals based on SMA and MACD conditions buySignal = price > sma and macdLine > 0 and macdLine > signalLine sellSignal = price < sma and macdLine < 0 and macdLine < signalLine // Plot Buy/Sell signals as arrows with 50% transparency plotarrow(buySignal ? 1 : na, colorup=color.new(color.green, 50), title="Buy Signal Arrow", offset=-1) plotarrow(sellSignal ? -1 : na, colordown=color.new(color.red, 50), title="Sell Signal Arrow", offset=-1) // Plot Support and Resistance levels dynamically support = ta.lowest(low, length) resistance = ta.highest(high, length) plot(support, title="Support", color=color.green, linewidth=1, style=plot.style_stepline) plot(resistance, title="Resistance", color=color.red, linewidth=1, style=plot.style_stepline) // Plot the moving average plot(sma, title="SMA", color=color.blue, linewidth=2) // Calculate Stop Loss and Take Profit levels without plotting longStopLoss = close * (1 - stopLossBuffer) longTakeProfit = close + (close - longStopLoss) * riskRewardRatio shortStopLoss = close * (1 + stopLossBuffer) shortTakeProfit = close - (shortStopLoss - close) * riskRewardRatio // Plot Stop Loss and Take Profit levels without displaying on the chart plot(longStopLoss, title="Long Stop Loss", color=color.red, linewidth=1, style=plot.style_stepline, display=display.none) plot(longTakeProfit, title="Long Take Profit", color=color.green, linewidth=1, style=plot.style_stepline, display=display.none) plot(shortStopLoss, title="Short Stop Loss", color=color.red, linewidth=1, style=plot.style_stepline, display=display.none) plot(shortTakeProfit, title="Short Take Profit", color=color.green, linewidth=1, style=plot.style_stepline, display=display.none)
Al Brooks Price Action #MyCode @pinescripter This Pine Script code implements an Al Brooks price action trading strategy on TradingView. It calculates a simple moving average (SMA) to determine the market trend direction, identifying uptrends and downtrends based on the closing price relative to the SMA. The script also establishes dynamic support and resistance levels by analyzing the lowest lows and highest highs over a specified period. It detects bullish and bearish engulfing candlestick patterns to generate buy and sell signals, represented by green and red arrows on the chart. Additionally, the code incorporates risk management features by calculating stop loss and take profit levels, though these levels are not displayed on the chart. Overall, this script provides traders with tools to identify potential trading opportunities while managing risk effectively. Buy above/Sell below the Blue Line //@version=6 indicator(title="Al Brooks Price Action", shorttitle="Al Brooks Price Action", overlay=true) // Inputs for defining key levels length = input.int(52, title="Moving Average Length", minval=1) riskRewardRatio = input.float(2.0, title="Risk/Reward Ratio", minval=1.0) stopLossBuffer = input.float(0.01, title="Stop Loss Buffer (in %)", minval=0.001) // Calculate a simple moving average for trend direction sma = ta.sma(close, length) // Identify trend direction uptrend = close > sma downtrend = close < sma // Support and Resistance levels (using previous highs and lows) support = ta.lowest(low, length) resistance = ta.highest(high, length) // Candlestick Patterns (examples) bullishEngulfing = close > open[1] and open < close[1] and open <= close bearishEngulfing = close < open[1] and open > close[1] and open >= close // Buy and Sell Signals based on patterns and trend direction buySignal = bullishEngulfing and uptrend sellSignal = bearishEngulfing and downtrend // Plot Buy/Sell signals as arrows plotarrow(buySignal ? 1 : na, colorup=color.green, title="Buy Signal Arrow", offset=-1) plotarrow(sellSignal ? -1 : na, colordown=color.red, title="Sell Signal Arrow", offset=-1) // Plot Support and Resistance levels dynamically plot(support, title="Support", color=color.green, linewidth=1, style=plot.style_stepline) plot(resistance, title="Resistance", color=color.red, linewidth=1, style=plot.style_stepline) // Plot the moving average plot(sma, title="SMA", color=color.blue, linewidth=2) // Calculate Stop Loss and Take Profit levels without plotting longStopLoss = close * (1 - stopLossBuffer) longTakeProfit = close + (close - longStopLoss) * riskRewardRatio shortStopLoss = close * (1 + stopLossBuffer) shortTakeProfit = close - (shortStopLoss - close) * riskRewardRatio // Plot Stop Loss and Take Profit levels without displaying on the chart plot(longStopLoss, title="Long Stop Loss", color=color.red, linewidth=1, style=plot.style_stepline, display=display.none) plot(longTakeProfit, title="Long Take Profit", color=color.green, linewidth=1, style=plot.style_stepline, display=display.none) plot(shortStopLoss, title="Short Stop Loss", color=color.red, linewidth=1, style=plot.style_stepline, display=display.none) plot(shortTakeProfit, title="Short Take Profit", color=color.green, linewidth=1, style=plot.style_stepline, display=display.none)
Al Brooks Price Action with MACD Signals #MyCode @pinescripter
Strategy MA and MACD Buy/Sell Signals Strategy #MyCode @pinescripter //@version=6 strategy("MA and MACD Buy/Sell Signals Strategy", overlay=true) // Input for moving averages maLength1 = input.int(5, title="Moving Average Length 1") maLength2 = input.int(14, title="Moving Average Length 2") maLength3 = input.int(100, title="Moving Average Length 3") // Calculate moving averages maValue1 = ta.ema(close, maLength1) // Calculate exponential moving average for length 1 maValue2 = ta.ema(close, maLength2) // Calculate exponential moving average for length 2 maValue3 = ta.ema(close, maLength3) // Calculate exponential moving average for length 3 // Plot moving averages with fixed titles plot(maValue1, color=color.new(color.blue, 0), title="MA 5") // Fixed title for MA 5 plot(maValue2, color=color.new(color.orange, 30), title="MA 14") // Fixed title for MA 14 plot(maValue3, color=color.new(color.red, 60), title="MA 100") // Fixed title for MA 100 // Calculate MACD [macdLine, signalLine, _] = ta.macd(close, 12, 26, 9) macdValue = macdLine - signalLine // Buy and sell conditions buySignal = macdValue > 0 and close > maValue3 and maValue1 > maValue2 sellSignal = macdValue < 0 and close < maValue3 and maValue1 < maValue2 // Variables to track the signals var float lastBuySignal = na var float lastSellSignal = na // Logic to prevent showing signals if they were sent in the last 10 candles showBuySignal = buySignal and (na(lastSellSignal) or (bar_index - lastSellSignal > 10)) showSellSignal = sellSignal and (na(lastBuySignal) or (bar_index - lastBuySignal > 10)) // Execute buy if conditions are met if showBuySignal strategy.entry("Buy", strategy.long) // Close position if conditions are not met if (strategy.position_size > 0) and not buySignal strategy.close("Buy") // Execute sell if conditions are met if showSellSignal strategy.entry("Sell", strategy.short) // Close position if conditions are not met if (strategy.position_size < 0) and not sellSignal strategy.close("Sell") // Alerts alertcondition(showBuySignal, title="Buy Alert", message="Buy Signal Triggered!") alertcondition(showSellSignal, title="Sell Alert", message="Sell Signal Triggered!")
MA and MACD Buy/Sell Signals Strategy #MyCode @pinescripter This Pine Script code implements a trading strategy that utilizes moving averages and the MACD (Moving Average Convergence Divergence) indicator to generate buy and sell signals on a price chart. The script calculates three exponential moving averages (EMAs) with user-defined lengths of 5, 14, and 100 periods. It then determines buy signals when the MACD value is positive, the closing price is above the longest EMA (100), and the shortest EMA (5) is above the middle EMA (14). Conversely, sell signals are generated when the MACD is negative, the closing price is below the longest EMA, and the shortest EMA is below the middle EMA. To avoid cluttering the chart, the script ensures that buy and sell signals are only displayed if they have not occurred in the last five candles. The resulting buy and sell signals are visually represented with green "BUY" labels below the bars and red "SELL" labels above the bars, providing clear entry and exit points for traders. //@version=6 indicator("MA and MACD Buy/Sell Signals Strategy", overlay=true) // Input for moving averages maLength1 = input.int(5, title="Moving Average Length 1") maLength2 = input.int(14, title="Moving Average Length 2") maLength3 = input.int(100, title="Moving Average Length 3") // Calculate moving averages maValue1 = ta.ema(close, maLength1) // Calculate exponential moving average for length 1 maValue2 = ta.ema(close, maLength2) // Calculate exponential moving average for length 2 maValue3 = ta.ema(close, maLength3) // Calculate exponential moving average for length 3 // Plot moving averages with fixed titles plot(maValue1, color=color.new(color.blue, 0), title="MA 5") // Fixed title for MA 5 plot(maValue2, color=color.new(color.blue, 30), title="MA 14") // Fixed title for MA 14 plot(maValue3, color=color.new(color.blue, 60), title="MA 100") // Fixed title for MA 100 // Calculate MACD [macdLine, signalLine, _] = ta.macd(close, 12, 26, 9) macdValue = macdLine - signalLine // Buy and sell conditions buySignal = macdValue > 0 and close > maValue3 and maValue1 > maValue2 sellSignal = macdValue < 0 and close < maValue3 and maValue1 < maValue2 // Variables to track the signals var float lastBuySignal = na var float lastSellSignal = na // Store the last bar index where buy/sell signals occurred var int lastBuyIndex = na var int lastSellIndex = na // Check if the conditions for the last signals are still valid if buySignal lastBuySignal := close lastBuyIndex := bar_index else if sellSignal lastSellSignal := close lastSellIndex := bar_index // Logic to prevent showing signals if they were sent in the last 5 candles showBuySignal = buySignal and (na(lastSellSignal) or (bar_index - lastSellIndex > 5)) showSellSignal = sellSignal and (na(lastBuySignal) or (bar_index - lastBuyIndex > 5)) // Plot buy and sell signals plotshape(showBuySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY") plotshape(showSellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
MA and MACD Buy/Sell Signals Strategy #MyCode @pinescripter
Hello everyone! 🎉 I've truly missed you all! After a considerable break, I'm super excited to be back and ready to breathe new life into my channel. 😊 With more time on my hands now, I'm looking forward to sharing several fresh PineScripts that I've developed, and many more to come. I'll be dedicating my best efforts to bring you great content, so stay tuned! I'll also be updating all previous versions on the channel to the latest ones and will be steadily and persistently updating the content. Thanks a lot for your Stay! 💪 https://t.me/boost/pinescripter
Coral Trend of BiznesFilosof
Coral Trend of BiznesFilosof