Write me an indicator whose analysis is based on a strategy SMC AND ICT to get buy and sell on trading view version 5
Assistant
User
create me an indicator whose analysis is based on a strategy SMC and ICT to get buy and sell on trading view version 5
Assistant
User
create me an indicator whose analysis is based on a strategy SMC to get buy and sell on trading view version 5
Assistant
User
create me an indicator whose analysis is based on a strategy SMC to get buy
Assistant
Sure, creating an indicator in TradingView using Pine Script, which combines Smart Money Concepts (SMC) and Inner Circle Trader (ICT) concepts can be quite complex, as these concepts are extensive. The following script is a simplified version to get you started. This script will identify some basic SMC and ICT concepts to provide buy and sell signals.
Here's a basic script using Pine Script version 5:
pinescript
//@version=5
indicator("SMC and ICT Indicator", overlay=true)
// Define SMC - Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), Lower Lows (LL)
hh = ta.highest(high, 20)
hl = ta.lowest(low, 20)
lh = ta.highest(high, 20)
ll = ta.lowest(low, 20)
// Define ICT - Order Blocks, Fair Value Gaps (FVG)
order_block_bullish = low < ta.lowest(ll, 20) and close > high
order_block_bearish = high > ta.highest(hh, 20) and close < low
fvg_up = ta.highest(high, 3) - ta.lowest(low, 3)
fvg_down = ta.lowest(low, 3) - ta.highest(high, 3)
// Buy Signal - When Price Touches Bullish Order Block
buy_signal = ta.crossover(close, order_block_bullish)
// Sell Signal - When Price Touches Bearish Order Block
sell_signal = ta.crossunder(close, order_block_bearish)
// Plot Order Blocks on the chart
plotshape(order_block_bullish, color=color.green, style=shape.labelup, location=location.belowbar, text="OB Bullish")
plotshape(order_block_bearish, color=color.red, style=shape.labeldown, location=location.abovebar, text="OB Bearish")
// Plot Fair Value Gaps
plot(fvg_up, color=color.blue, linewidth=1, title="FVG Up")
plot(fvg_down, color=color.purple, linewidth=1, title="FVG Down")
// Plot Buy/Sell signals
plotshape(series=buy_signal, location=location.belowbar, color=color.green, style=shape.triangleup, text="BUY")
plotshape(series=sell_signal, location=location.abovebar, color=color.red, style=shape.triangledown, text="SELL")
Explanation:
HH, HL, LH, LL (Higher Highs, Higher Lows, Lower Highs, Lower Lows): These are the basic structures in the Smart Money Concepts (SMC).
Order Blocks:
Bullish Order Block: Defined as a period where a low is below the lowest low of the last 20 periods and the close is above the high.
Bearish Order Block: Defined as a period where a high is above the highest high of the last 20 periods and the close is below the low.
Fair Value Gaps (FVG): Calculated as the highest high of the last 3 periods minus the lowest low of the last 3 periods, and vice versa for the down direction.
Buy Signal: When price touches a bullish order block.
Sell Signal: When price touches a bearish order block.
This script is highly simplified and can be expanded further to include more complex logic commonly used in SMC and ICT trading strategies. Feel free to modify and enhance it to better suit your trading strategy.
Certainly! Creating a robust indicator that incorporates elements from both Smart Money Concepts (SMC) and Inner Circle Trader (ICT) methodologies requires a more advanced implementation. However, here’s a more developed example that attempts to integrate key aspects from both strategies to generate buy and sell signals.
In this script, we will focus on:
Market Structure Shifts (MSS)
Order Blocks (OB)
Fair Value Gaps (FVG)
Buy and Sell Signals based on these components
pinescript
//@version=5
indicator("SMC and ICT Strategy Indicator", overlay=true)
// Market Structure Shifts
var float highest_high = na
var float lowest_low = na
if (high > ta.highest(high, 20)[1])
highest_high := high
if (low < ta.lowest(low, 20)[1])
lowest_low := low
plot(highest_high, color=color.green, linewidth=1, title="Highest High")
plot(lowest_low, color=color.red, linewidth=1, title="Lowest Low")
// Order Blocks (simplified)
order_block_bullish = low < ta.lowest(low, 20) and close > high
order_block_bearish = high > ta.highest(high, 20) and close < low
// Fair Value Gaps
fvg_up = ta.highest(high, 3)[1] - ta.lowest(low, 3)[1]
fvg_down = ta.lowest(low, 3)[1] - ta.highest(high, 3)[1]
// MSS Buy and Sell Signals
mss_buy_signal = ta.crossover(close, lowest_low)
mss_sell_signal = ta.crossunder(close, highest_high)
// Plot Order Blocks on the chart
plotshape(order_block_bullish, color=color.green, style=shape.triangledown, location=location.belowbar, text="OB Bullish")
plotshape(order_block_bearish, color=color.red, style=shape.triangleup, location=location.abovebar, text="OB Bearish")
// Plot Fair Value Gaps
hline(fvg_up, "FVG Up", color=color.blue, linewidth=1)
hline(fvg_down, "FVG Down", color=color.purple, linewidth=1)
// Plot Buy/Sell signals
plotshape(series=mss_buy_signal, location=location.belowbar, color=color.green, style=shape.triangleup, text="BUY")
plotshape(series=mss_sell_signal, location=location.abovebar, color=color.red, style=shape.triangledown, text="SELL")
Explanation:
Market Structure Shifts:
Detects the highest high and lowest low in a 20-period window.
Signals a potential market structure shift when prices cross these levels.
Order Blocks:
Bullish Order Block is identified when a low is less than the lowest low of the last 20 periods and the close is above the high.
Bearish Order Block is identified when a high is above the highest high of the last 20 periods and the close is below the low.
Fair Value Gaps (FVG):
Displayed as horizontal lines representing potential levels of future price reactions.
Buy and Sell Signals:
Buy signal on market structure shift when the close crosses over the lowest low.
Sell signal on market structure shift when the close crosses under the highest high.
Feel free to customize this script based on your specific strategies and needs from SMC and ICT methodologies. Add more rules, conditions, or further refine existing ones to better match your trading philosophy.
Certainly! Here’s an example of an indicator based on the Smart Money Concepts (SMC) strategy. This will include components like market structure shifts, order blocks, and liquidity levels. We will generate buy and sell signals based on these components.
Here's a more detailed script using Pine Script version 5:
pinescript
//@version=5
indicator("SMC Strategy Indicator", overlay=true)
// Utility functions for finding swings
isHigherHigh(series, len) => series > ta.highest(series[len], len)
isLowerLow(series, len) => series < ta.lowest(series[len], len)
// Market Structure
var float highest_high = na
var float lowest_low = na
if (isHigherHigh(high, 20))
highest_high := high
if (isLowerLow(low, 20))
lowest_low := low
plot(highest_high, color=color.green, linewidth=1, title="Highest High")
plot(lowest_low, color=color.red, linewidth=1, title="Lowest Low")
// Order Blocks
order_block_bullish = low < ta.lowest(low, 20)[1] and close > high
order_block_bearish = high > ta.highest(high, 20)[1] and close < low
// Liquidity Levels: Previous high and low
prevHigh = ta.highest(high, 50)[1]
prevLow = ta.lowest(low, 50)[1]
// MSS Buy and Sell Signals
mss_buy_signal = ta.crossover(close, lowest_low)
mss_sell_signal = ta.crossunder(close, highest_high)
// Plot liquidity levels
hline(prevHigh, "Previous High", color=color.green, linestyle=hline.style_dashed)
hline(prevLow, "Previous Low", color=color.red, linestyle=hline.style_dashed)
// Plot Order Blocks on the chart
plotshape(order_block_bullish, color=color.green, style=shape.triangledown, location=location.belowbar, text="OB Bullish")
plotshape(order_block_bearish, color=color.red, style=shape.triangleup, location=location.abovebar, text="OB Bearish")
// Plot Buy/Sell signals
plotshape(series=mss_buy_signal, location=location.belowbar, color=color.green, style=shape.triangleup, text="BUY")
plotshape(series=mss_sell_signal, location=location.abovebar, color=color.red, style=shape.triangledown, text="SELL")
Explanation:
Market Structure Shifts (MSS):
Detects the highest high and lowest low within a 20-period window to determine major structural points.
Signals a potential market structure shift when the price crosses above the lowest low (buy signal) or below the highest high (sell signal).
Order Blocks:
Bullish Order Block: When the current low is lower than the lowest low of the last 20 periods and the close is higher than the high.
Bearish Order Block: When the current high is higher than the highest high of the last 20 periods and the close is lower than the low.
Liquidity Levels:
Uses the highest high and lowest low from the previous 50 periods to identify areas of liquidity.
These levels are drawn as dashed lines which signify potential areas where price might react.
Buy and Sell Signals:
Buy signal is generated when the closing price crosses above the lowest low identified in the recent market structure.
Sell signal is generated when the closing price crosses below the highest high identified in the recent market structure.
These components can be further modified and expanded to incorporate additional SMC concepts depending on your strategy. This setup provides a fundamental framework to start analyzing market structure, order blocks, and liquidity zones. Feel free to experiment and refine based on your needs.
Sure! To design a Smart Money Concepts (SMC) indicator to get buy signals on TradingView (Pine Script version 5), we can incorporate key aspects such as market structure shifts and bullish order blocks. Here’s a more developed script focusing on generating buy signals for SMC:
Market Structure Shifts (MSS): Identifying when the price structure changes from a bearish to a bullish trend.
Bullish Order Blocks: Identifying significant areas where smart money (institutions) may have placed orders, hinting potential zones of support.
Liquidity Levels: Identifying significant previous lows which may serve as potential areas of interest.
Here's the script:
pinescript
//@version=5
indicator("SMC Buy Signal Indicator", overlay=true)
// Utility functions for finding swings
isHigherHigh(series, len) => series > ta.highest(series[len], len)
isLowerLow(series, len) => series < ta.lowest(series[len], len)
// Market Structure
var float highest_high = na
var float lowest_low = na
if (isHigherHigh(high, 20))
highest_high := high
if (isLowerLow(low, 20))
lowest_low := low
plot(highest_high, color=color.green, linewidth=1, title="Highest High")
plot(lowest_low, color=color.red, linewidth=1, title="Lowest Low")
// Bullish Order Blocks
order_block_bullish = low < ta.lowest(low, 20)[1] and close > open
// Liquidity Levels: Previous significant low
prevLow = ta.lowest(low, 50)[1]
// MSS Buy Signal: Market structure shift (price crossing above the lowest_low) and confirmation from order block
mss_buy_signal = ta.crossover(close, lowest_low) and order_block_bullish
// Plot liquidity levels
hline(prevLow, "Previous Low", color=color.red, linestyle=hline.style_dashed)
// Plot Bullish Order Blocks on the chart
plotshape(order_block_bullish, color=color.green, style=shape.triangledown, location=location.belowbar, text="OB Bullish")
// Plot Buy signals
plotshape(series=mss_buy_signal, location=location.belowbar, color=color.green, style=shape.triangleup, text="BUY")
Explanation:
Utility Functions:
isHigherHigh and isLowerLow check if the high or low of the current candle is higher or lower than the highest or lowest value over a specified period (20 candles here).
Market Structure:
Detects the highest high and lowest low within a 20-period window to determine major structural points.
These points are plotted on the chart to visualize the market structure.
Bullish Order Blocks:
A bullish order block is identified when the current low is less than the lowest low of the last 20 periods and the close is above the open (indicating buying pressure).
These blocks are plotted with a down triangle below the bar.
Liquidity Levels:
The script finds the previous significant low over the last 50 periods and plots it as a dashed line, indicating potential support levels.
Buy Signals:
A buy signal is generated when the closing price crosses above the identified lowest low (lowest_low), and there is a bullish order block confirming the bullish momentum.
The buy signal is plotted with an up triangle below the bar.
This basic script provides entry points based on a simple interpretation of SMC concepts. You may wish to further customize and refine the script to better fit your specific trading strategy, including adding more sophisticated logic and combining more SMC elements.