RSI + MA Buy/Sell Signals//@version=5
indicator("RSI + MA Buy/Sell Signals", overlay=true)
// Inputs
rsiLength = input(14, title="RSI Length")
maLength = input(50, title="Moving Average Length")
oversold = input(30, title="Oversold Level")
overbought = input(70, title="Overbought Level")
// RSI and Moving Average
rsi = ta.rsi(close, rsiLength)
ma = ta.sma(close, maLength)
// Buy Condition
buySignal = ta.crossover(rsi, oversold) and close > ma
// Sell Condition
sellSignal = ta.crossunder(rsi, overbought) and close < ma
// Plot Signals
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Plot Moving Average
plot(ma, title="Moving Average", color=color.blue)
Utilitas Pine
ERFAN1RAHMATI...ADX/EMA.1for backtest. this indicator is design for price prediction and anaysis and when the trend is red, two lines are drawn in color and when is is green ....other data can be changed and customized JUST FOR Test
UT Bot Pro Final//@version=6
indicator("UT Bot Pro Final", overlay=true, max_lines_count=500)
// === INPUT PARAMETERS ===
// Core Settings
atr_multiplier = input.float(1.0, "ATR Multiplier", minval=0.5, maxval=5, step=0.1, group="Core Settings")
atr_period = input.int(6, "ATR Period", minval=1, maxval=20, group="Core Settings")
// Trend Filter
use_trend_filter = input.bool(true, "Enable Trend Filter", group="Trend Filter")
trend_length = input.int(50, "Trend SMA Period", minval=10, group="Trend Filter")
// Volume Filter
use_volume_filter = input.bool(true, "Enable Volume Filter", group="Volume Filter")
volume_ma_length = input.int(20, "Volume MA Period", minval=5, group="Volume Filter")
volume_threshold = input.float(1.25, "Volume Threshold %", step=0.1, group="Volume Filter")
// === CORE LOGIC ===
xATR = ta.atr(atr_period)
nLoss = atr_multiplier * xATR
price = close
// Trend Filter
trend_sma = ta.sma(price, trend_length)
valid_uptrend = not use_trend_filter or (price > trend_sma)
valid_downtrend = not use_trend_filter or (price < trend_sma)
// Volume Filter
volume_ma = ta.sma(volume, volume_ma_length)
volume_ok = volume > (volume_ma * volume_threshold)
// Trailing Stop
var float xATRTrailingStop = na
xATRTrailingStop := switch
na(xATRTrailingStop ) => price - nLoss
price > xATRTrailingStop and valid_uptrend => math.max(xATRTrailingStop , price - nLoss)
price < xATRTrailingStop and valid_downtrend => math.min(xATRTrailingStop , price + nLoss)
=> xATRTrailingStop
// Signal Generation
buy_signal = ta.crossover(price, xATRTrailingStop) and valid_uptrend and (use_volume_filter ? volume_ok : true)
sell_signal = ta.crossunder(price, xATRTrailingStop) and valid_downtrend and (use_volume_filter ? volume_ok : true)
// === VISUALS ===
plot(xATRTrailingStop, "Trailing Stop", color=color.new(color.purple, 0), linewidth=2)
plotshape(
buy_signal, "Buy", shape.triangleup,
location.belowbar, color=color.green,
text="BUY", textcolor=color.white, size=size.small)
plotshape(
sell_signal, "Sell", shape.triangledown,
location.abovebar, color=color.red,
text="SELL", textcolor=color.white, size=size.small)
// === ALERTS ===
alertcondition(buy_signal, "Long Entry", "Bullish breakout detected")
alertcondition(sell_signal, "Short Entry", "Bearish breakdown detected")
EMA Crossover + RSI Filter (1-Hour)//@version=5
strategy("EMA Crossover + RSI Filter (1-Hour)", overlay=true)
// Input parameters
fastLength = input.int(9, title="Fast EMA Length")
slowLength = input.int(21, title="Slow EMA Length")
rsiLength = input.int(14, title="RSI Length")
overbought = input.int(70, title="Overbought Level")
oversold = input.int(30, title="Oversold Level")
// Calculate EMAs
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Buy Condition
buyCondition = ta.crossover(fastEMA, slowEMA) and rsi > 50 and rsi < overbought
// Sell Condition
sellCondition = ta.crossunder(fastEMA, slowEMA) and rsi < 50 and rsi > oversold
// Plot EMAs
plot(fastEMA, color=color.blue, title="Fast EMA")
plot(slowEMA, color=color.red, title="Slow EMA")
// Plot Buy/Sell Signals
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Execute Trades
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
My strategyimport pandas as pd
import ta
import time
from dhan import DhanHQ
# Dhan API Credentials
API_KEY = "your_api_key"
ACCESS_TOKEN = "your_access_token"
dhan = DhanHQ(api_key=API_KEY, access_token=ACCESS_TOKEN)
# Strategy Parameters
SYMBOL = "RELIANCE" # Replace with your stock symbol
INTERVAL = "1min" # Scalping requires a short timeframe
STOPLOSS_PERCENT = 0.2 # Stop loss percentage (0.2% per trade)
TARGET_RR_RATIO = 2 # Risk-Reward Ratio (1:2)
QUANTITY = 10 # Number of shares per trade
def get_historical_data(symbol, interval="1min", limit=50):
"""Fetch historical data from Dhan API."""
response = dhan.get_historical_data(symbol=symbol, interval=interval, limit=limit)
if response == "success":
df = pd.DataFrame(response )
df = df .astype(float)
df = df .astype(float)
df = df .astype(float)
df = df .astype(float)
return df
else:
raise Exception("Failed to fetch data: ", response )
def add_indicators(df):
"""Calculate EMA (9 & 20), VWAP, and RSI."""
df = ta.trend.ema_indicator(df , window=9)
df = ta.trend.ema_indicator(df , window=20)
df = ta.volume.volume_weighted_average_price(df , df , df , df )
df = ta.momentum.rsi(df , window=14)
return df
def check_signals(df):
"""Identify Buy and Sell signals based on EMA, VWAP, and RSI."""
latest = df.iloc
# Buy Condition
if latest > latest and latest > latest and 40 <= latest <= 60:
return "BUY"
# Sell Condition
if latest < latest and latest < latest and 40 <= latest <= 60:
return "SELL"
return None
def place_order(symbol, side, quantity):
"""Execute a market order."""
order_type = "BUY" if side == "BUY" else "SELL"
order = dhan.place_order(symbol=symbol, order_type="MARKET", quantity=quantity, transaction_type=order_type)
if order == "success":
print(f"{order_type} Order Placed: {order }")
return float(order ) # Return entry price
else:
raise Exception("Order Failed: ", order )
def scalping_strategy():
position = None
entry_price = 0
stoploss = 0
target = 0
while True:
try:
# Fetch and process data
df = get_historical_data(SYMBOL, INTERVAL)
df = add_indicators(df)
signal = check_signals(df)
# Execute trade
if signal == "BUY" and position is None:
entry_price = place_order(SYMBOL, "BUY", QUANTITY)
stoploss = entry_price * (1 - STOPLOSS_PERCENT / 100)
target = entry_price + (entry_price - stoploss) * TARGET_RR_RATIO
position = "LONG"
print(f"BUY @ {entry_price}, SL: {stoploss}, Target: {target}")
elif signal == "SELL" and position is None:
entry_price = place_order(SYMBOL, "SELL", QUANTITY)
stoploss = entry_price * (1 + STOPLOSS_PERCENT / 100)
target = entry_price - (stoploss - entry_price) * TARGET_RR_RATIO
position = "SHORT"
print(f"SELL @ {entry_price}, SL: {stoploss}, Target: {target}")
# Exit logic
if position:
current_price = df .iloc
if (position == "LONG" and (current_price <= stoploss or current_price >= target)) or \
(position == "SHORT" and (current_price >= stoploss or current_price <= target)):
print(f"Exiting {position} @ {current_price}")
position = None
time.sleep(60) # Wait for the next candle
except Exception as e:
print(f"Error: {e}")
time.sleep(60)
# Run the strategy
try:
scalping_strategy()
except KeyboardInterrupt:
print("Trading stopped manually.")
Buy/Sell AlgoThis script is an advanced trading software that harnesses real-time price data to provide the most accurate and timely buy signals:
📊 Real-Time Data: Continuously processes live market data to track price movements and identify key trends.
🔄 Advanced Algorithm: Leverages a dynamic crossover strategy between two moving averages (9-period short MA and 21-period long MA) to pinpoint optimal entry points with precision.
📍 Buy Signals: Automatically generates “BUY” signals when the short-term moving average crosses above the long-term moving average, reflecting a high-probability trend reversal to the upside.
🟩 Visual Indicators: Candle bars are dynamically colored green during bullish signals, providing clear visual confirmation for buyers.
Gold Trade Setup Strategy BrokerirProfitable Gold Setup Strategy with Adaptive Moving Average & Supertrend – Brokerir’s Exclusive Strategy
Introduction:
This Gold (XAU/USD) trading strategy, developed by Brokerir, leverages the power of the Adaptive Moving Average (AMA) and Supertrend indicators to identify high-probability trade setups. This approach is designed to work seamlessly for both swing traders and intraday traders, optimizing trading times for maximum precision and profitability. The AMA helps in recognizing the prevailing market trend, while the Supertrend indicator confirms the best entry and exit points. This strategy is fine-tuned for Gold’s price movements, providing clear guidance for disciplined and profitable trading.
Strategy Components:
Adaptive Moving Average (AMA):
Responsive to Market Conditions: The AMA adjusts to market volatility, making it an ideal trend-following tool.
Trend Indicator: It acts as the primary tool for identifying the overall trend direction, reducing noise in volatile markets.
Supertrend:
Signal Confirmation: The Supertrend indicator provides reliable buy and sell signals by confirming the trend direction indicated by the AMA.
Trailing Stop-Loss: It also acts as a trailing stop-loss, helping to protect profits by dynamically adjusting as the market moves in your favor.
Trading Rules:
Trading Hours:
Trades should only be taken between 8:30 AM and 10:30 PM IST, avoiding low-volume periods to reduce market noise and increase the probability of successful setups.
Buy Setup:
Trend Confirmation: Ensure the Adaptive Moving Average (AMA) is green, confirming an uptrend.
Signal Confirmation: Wait for the Supertrend to turn green, confirming the continuation of the uptrend.
Trigger: Enter the trade when the high of the trigger candle (the candle that turned the Supertrend green) is broken.
Sell Setup (Optional):
If seeking short trades, reverse the rules:
The AMA and Supertrend should both be red, confirming a downtrend.
Enter the trade when the low of the trigger candle (the candle that turned the Supertrend red) is broken.
Stop-Loss and Targets:
Stop-Loss Placement: Set the stop-loss at the low of the trigger candle for long trades.
Risk-Reward Ratio: Aim for a 1:2 risk-reward ratio or use the Supertrend line as a trailing stop-loss, adjusting the stop-loss as the market moves in your favor.
Timeframes:
Swing Trading: Best suited for 1-hour (1H), 4-hour (4H), or Daily charts to capture larger price moves.
Intraday Trading: For more precise, quick setups, use 15-minute (15M) or 30-minute (30M) charts.
Why This Strategy Works:
Combination of Indicators: The strategy combines trend-following (AMA) with momentum-based entries (Supertrend), allowing you to enter trades at the optimal points in the market.
Filtered Trading Hours: Focusing on specific trading hours (8:30 AM to 10:30 PM IST) helps to filter out low-probability setups, reducing noise.
Clear Entry, Stop-Loss, and Target: Precise entry points, stop-loss placement, and targets ensure disciplined and calculated risk-taking.
Conclusion:
This Brokerir Gold Setup Strategy is tailored for traders who are seeking a structured and effective approach to trading Gold. By combining the power of AMA and Supertrend, traders can make informed, high-probability trades. Adhering to the specified trading hours, along with strict rules for entry, stop-loss, and profit targets, helps ensure consistent results. Remember to backtest the strategy and adjust based on market conditions. Let’s master the Gold market and maximize profits together!
⚡ Stay tuned with Brokerir for more advanced trading strategies and tips!
Litecoin LTC Logarithmic Fibonacci Growth CurvesHOW THIS SCRIPT IS ORIGINAL: there is no similar script dedicated to LTC, although there are similar ones dedicated to BTC. (This was created by modifying an old public and open source similar script dedicated to BTC.)
WHAT THIS SCRIPT DOES: draws a channel containing the price of LTC within which the Fibonacci extensions are highlighted. The reference chart to use is LTC/USD on Bitfinex (because it has the oldest data, given that Tradingview has not yet created an LTC index), suggested with weekly or monthly timeframe.
HOW IT DOES IT: starting from two basic curves that average the upper and lower peaks of the price, the relative Fibonacci extensions are then built on the basis of these: 0.9098, 0.8541, 0.7639, 0.618, 0.5, 0.382, 0.2361, 0.1459, 0.0902.
HOW TO USE IT: after activating the script you will notice the presence of two areas of particular interest, the upper area, delimited in red, which follows the upper peaks of the price, and the lower area, delimited in green, which follows the lower peaks of the price. Furthermore, the main curves, namely the two extremes and the median, are also projected into the future to predict an indicative trend. This script is therefore useful for understanding where the price will go in the future and can be useful for understanding when to buy (near the green lines) or when to sell (near the red lines). It is also possible to configure the script by choosing the colors and types of lines, as well as the main parameters to define the upper and lower curve, from which the script deduces all the other lines that are in the middle.
Very easy to read and interpret. I hope this description is sufficient, but it is certainly easier to use it than to describe it.
Wyckoff Advanced StrategyInterpreta las señales en el gráfico:
Zonas de acumulación/distribución:
Zonas de acumulación: Se resaltan en un color verde suave (transparente) cuando el precio está por encima del rango medio y el volumen es alto.
Zonas de distribución: Se resaltan en un color rojo suave cuando el precio está por debajo del rango medio y el volumen es alto.
Eventos clave (Wyckoff):
Selling Climax (SC): Un triángulo verde marca un punto donde el precio alcanza un mínimo significativo con un volumen alto.
Automatic Rally (AR): Un triángulo rojo indica un pico tras un rally automático.
Spring y Upthrust: Círculos verdes y rojos que identifican posibles reversiones clave.
Sign of Strength (SOS) y Sign of Weakness (SOW): Señales de fortaleza o debilidad representadas como etiquetas azules (SOS) y púrpuras (SOW).
Líneas de soporte/resistencia:
Líneas horizontales rojas (resistencia) y verdes (soporte) indican los extremos del rango de precio detectado.
Análisis de volumen (opcional):
Las barras con volumen alto se resaltan en azul y las de volumen bajo en amarillo, si habilitas esta opción.
Ajusta la configuración según tu análisis:
El indicador tiene opciones para personalizar los colores y mostrar análisis de volumen. Puedes activarlas/desactivarlas según tu preferencia en los parámetros del indicador.
Cómo interpretar los eventos principales:
Fases Wyckoff:
Usa las zonas resaltadas (verde y rojo) para identificar si estás en acumulación o distribución.
Busca eventos clave (SC, AR, Spring, Upthrust, etc.) que marquen cambios importantes en el mercado.
Tendencia futura:
Si detectas un Sign of Strength (SOS), es posible que el precio entre en una tendencia alcista.
Si aparece un Sign of Weakness (SOW), es más probable que el precio entre en una tendencia bajista.
Soportes y resistencias:
Las líneas horizontales te ayudan a identificar niveles críticos donde el precio podría rebotar o romper.
Volumen y momentum:
Analiza el volumen para validar rupturas, springs o upthrusts. Un volumen alto suele confirmar la fuerza de un movimiento.
Sugerencias para mejorar tu análisis:
Temporalidad: Prueba diferentes marcos temporales (1H, 4H, diario) para detectar patrones Wyckoff en distintos niveles.
Activos: Úsalo en activos líquidos como índices, criptomonedas, acciones o divisas.
Backtest: Aplica el script en datos históricos para validar cómo funciona en el activo que operas.
Variações Diárias no Mini ÍndicePS: Já publiquei esse script. Porém fiz alguns ajustes e continuarei fazendo.
Fiz esse script de variações baseado no valor do ajuste diário. Criei especificamente para ser usado no mini índice, se desejar usar em outro ativo, terás que modificar o código.
As variações vão de 0,5% até 1,5%, pois eu acredito que como um big player do mercado brasileiro faz operações que duram dias, semanas ou até meses em certos casos, eles vão estar muito mais interessados em saber se já subiu ou caiu 0,5% da operação dele.
Essas variações me mostram regiões em que esses players podem pesar no gráfico, sempre a favor das operações deles. É um bom parâmetro para ver se já subiu demais ou caiu demais.
Um beijo e um queijo e até depois.
IBOX For the indicator to appear correctly on the DE40's 5-minute char t, set it to overlay mode.
Variables: Variables are declared to store the high and low points of the first trading hour.
Draw box:
The box representing the range of the first trading hour is drawn in gray.
First trading hour range:
The code checks if it is the first trading hour (9-10 am). If so, the high and low points are stored.
Fibonacci calculation: Based on the range of the first trading hour, the Fibonacci levels 1,61, 2, 2,61, 4,61 above and below the box are calculated.
ATR with Dynamic Stop-LossHow the Script Works
ATR Calculation:
The ATR is calculated using the ta.atr() function with the specified length.
Dynamic Stop-Loss Levels:
Two stop-loss levels are calculated for long and short trades using the ATR value and the specified multipliers.
Plotting:
The ATR value is plotted in a separate panel (hidden from the main chart).
The dynamic stop-loss levels are plotted on the main chart for both long and short trades.
ATR Trend Highlight:
The background color changes based on whether the ATR is increasing (green) or decreasing (red), indicating strong or weak momentum.
Example Usage
Long Trade:
Enter a long trade when the price breaks above a resistance level.
Use longStop1 (1.5x ATR) or longStop2 (2x ATR) as your stop-loss level.
Short Trade:
Enter a short trade when the price breaks below a support level.
Use shortStop1 (1.5x ATR) or shortStop2 (2x ATR) as your stop-loss level.
Screenshot of the Script in Action
If you apply this script to a chart in TradingView, you’ll see:
Two green lines (1.5x and 2x ATR) below the price for long stop-loss levels.
Two red lines (1.5x and 2x ATR) above the price for short stop-loss levels.
A background color that changes based on the ATR trend.
Dynamic Bollinger Bands for Multiple Timeframes How It Works:
Dynamic Settings Based on Timeframe:
15-Minute (15M): 10-period, 1.5 deviation.
1-Hour (1H): 14-period, 2.0 deviation.
4-Hour (4H): 20-period, 2.0 deviation.
Daily (1D): 20-period, 2.0 deviation.
3-Day (3D): 20-period, 2.0 deviation.
Weekly (1W): 20-period, 2.0 deviation.
Monthly (1M): 20-period, 2.0 deviation (for long-term trend tracking).
Plotting:
Upper band, lower band, and basis are calculated and plotted dynamically based on the current chart's timeframe.
How to Use:
When you switch between any of the listed timeframes (15-min, 1H, 4H, Daily, 3D, Weekly, or Monthly), the Bollinger Bands settings will adjust accordingly to provide the most accurate signals for that timeframe.
LIT - Super Indicator by NoronFX - Cup TradesThis is a powerful indicator designed for liquidity traders, bringing together all the essential tools for professional trading. It includes:
The main market sessions
Mitigation minutes
Key liquidity points such as PDH/PDL, PWH/PWL, and PMH/PML
An intelligent checklist
Customizable features like a watermark and configurable labels.
Futures_No-Trade-ZoneMarks the chart with a warning period before Futures market close (yellow) and when the market is actually closed (red).
Multi-Timeframe EMA TrackerBu Pine Script kodu, belirli bir varlık için çoklu zaman dilimlerinde (1 Saat, 4 Saat, 1 Gün, 1 Hafta ve 1 Ay) hareketli ortalamaları (EMA) hesaplar ve fiyatın en yakın üst ve alt EMA seviyelerini bulur. Bu özellik, yatırımcılara veya trader'lara destek ve direnç bölgelerini hızlı bir şekilde belirleme konusunda yardımcı olur. Kod aşağıdaki başlıca işlevleri sunar:
Çoklu EMA Hesaplama: Kod, 20, 50, 100 ve 200 periyotlu EMA'ları farklı zaman dilimlerinde hesaplar.
En Yakın EMA Seviyelerini Bulma: Fiyatın üstündeki ve altındaki en yakın EMA seviyeleri tanımlanır.
Grafikte Görselleştirme: En yakın EMA seviyeleri çizgiler ve etiketlerle grafikte işaretlenir. Her zaman dilimine özel renk kodlaması yapılır.
Dinamik Etiketleme: EMA seviyelerinin hangi zaman dilimine ve periyoda ait olduğu, grafikte gösterilen etiketlerle belirtilir.
Bu araç, özellikle teknik analizde EMA'ları kullanarak stratejiler geliştiren trader'lar için yararlıdır. Destek ve direnç seviyelerini daha iyi görselleştirerek, karar alma süreçlerini hızlandırır.
This Pine Script code calculates Exponential Moving Averages (EMAs) for multiple timeframes (1 Hour, 4 Hour, 1 Day, 1 Week, and 1 Month) and identifies the closest EMA levels above and below the current price. It is a useful tool for traders to quickly identify potential support and resistance levels. The script offers the following main functionalities:
Multi-Timeframe EMA Calculation: The code computes EMAs for 20, 50, 100, and 200 periods across various timeframes.
Finding Nearest EMA Levels: It determines the nearest EMA levels above and below the current price dynamically.
Graphical Visualization: The closest EMA levels are visualized on the chart with lines and labels, using color coding for each timeframe.
Dynamic Labeling: Labels on the chart indicate the specific timeframe and period of each EMA level.
This tool is particularly useful for traders who rely on EMAs to develop their strategies. By visualizing support and resistance levels, it simplifies decision-making and enhances technical analysis.
Combined Indicators (Fractals, EMAs, CCI, Volume, SMMA)Combined Indicators (Fractals, EMAs, CCI, Volume, SMMA)
Buy/Sell Signals Boinger band//@version=5
indicator("Buy/Sell Signals", overlay=true)
// Define the Bollinger Band parameters
length = input(20, title="Bollinger Band Length")
stdDev = input(2.0, title="Bollinger Band Standard Deviation")
// Calculate the Bollinger Band
basis = ta.sma(close, length)
upper = basis + stdDev * ta.stdev(close, length)
lower = basis - stdDev * ta.stdev(close, length)
// Plot the Bollinger Band
plot(basis, color=color.new(color.blue, 0), linewidth=2)
plot(upper, color=color.red, linewidth=2)
plot(lower, color=color.green, linewidth=2)
// Define the buy signal conditions
lowerBandTouch = close <= lower
threeGreenCandles = close > open and close > open and close > open
// Define the sell signal conditions
upperBandTouch = close >= upper
threeRedCandles = close < open and close < open and close < open
// Generate the buy and sell signals
buySignal = lowerBandTouch and threeGreenCandles
sellSignal = upperBandTouch and threeRedCandles
// Plot the buy and sell signals
plotshape(buySignal, location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
plotshape(sellSignal, location=location.belowbar, color=color.red, style=shape.labeldown, text="Sell")
// Alert conditions
alertcondition(buySignal, title="Buy Signal", message="Buy signal generated!")
alertcondition(sellSignal, title="Sell Signal", message="Sell signal generated!")
WebHook Message GeneratorLibrary "WebHook_Message_Generator"
Goal: Simplify the order ticket generation for webhook message
This library has been created in order to simplify the webhook message generation process.
Instead of having to fidget around with string concatenations this method allows you to generate a JSON based message that contains the required information to automte your trades.
How to use?
1) import the library
2) Call the method: GenerateOT () (OT = OrderTicket)
3) Declare your orders:
3.1) Create instances for the buy/sell/close order tickets - store each one in a variable
3.2) Call the variable inside the strategy's function as a alert message: ( alert_message=VARIABLE ). You can use the appropriate strategy function depending on your order ticket exemple: strategy.entry(alert_message=LongOrderTicket) or strategy.entry(alert_message=ShortOrderTicket) or strategy.close(alert_message=CloseOrderTicket) or strategy.exit(alert_message=LongOrderTicket) ...
4) Set up the alerts to your webhook
5) IMPORTANT to set the alert's message : {{strategy.order.alert_message}}
DONE! You will now have a dynamic webhook message that will send the correct information to your automation service.
Got Questions, Modifications, Improvements?
Comment below or Private message me!
The method you can import:
GenerateOT(license_id, symbol, action, order_type, trade_type, size, price, tp, sl, risk, trailPrice, trailOffset)
CreateOrderTicket: Establishes a order ticket following appropriate guidelines.
Parameters:
license_id (string) : Provide your license id
symbol (string) : Symbol on which to execute the trade
action (string) : Execution method of the trade : "MRKT" or "PENDING"
order_type (string) : Direction type of the order: "BUY" or "SELL"
trade_type (string) : Is it a "SPREAD" trade or a "SINGLE" symbol execution?
size (float) : Size of the trade, in units
price (float) : If the order is pending you must specify the execution price
tp (float) : (Optional) Take profit of the order
sl (float) : (Optional) Stop loss of the order
risk (float) : Percent to risk for the trade, if size not specified
trailPrice (float) : (Optional) Price at which trailing stop is starting
trailOffset (float) : (Optional) Amount to trail by
Returns: Return Order string
Volatility Regime Indicator (VRI)This indicator allows you to weight 3 variables.
1. The term spread (3rd Month Vix Contract - VIX)
2.The Volatility Risk Premium (VIX - Historical Volatility) 10 day historical volatility by default
3.SPX Momentum (Short EMA vs Long EMA)
Play with the weightings and variable to suit your approach.
Dynamic Fibonacci Retracement (23.6%, 50%, 61.8%)How the Script Works:
Swing High and Low: The script looks for the highest high and lowest low within the lookback period (default is 50 bars). These points define the range for calculating the Fibonacci retracement levels.
Fibonacci Levels: The script calculates the 23.6%, 50%, and 61.8% retracement levels between the swing high and swing low, then plots them as horizontal lines on your chart.
Customizable Appearance: The colors of the Fibonacci levels are customizable through the script, with:
Green for the 23.6% level
White for the 50% level
Golden for the 61.8% level
Labels: The script adds labels next to each Fibonacci level to clearly identify them on the chart.
Example Use Case:
Trend Analysis: This script can be used for identifying potential reversal zones in trending markets. If price is in an uptrend, the Fibonacci retracement levels could act as support levels for a pullback.
Trading Decision: When price pulls back to one of these Fibonacci levels (23.6%, 50%, or 61.8%), it can be an opportunity to make a decision about entering a trade, such as buying during a pullback in an uptrend or selling in a downtrend.
Modify the Script:
If you'd like to adjust any features (such as the Fibonacci levels, colors, or lookback period), simply go back to the Pine Editor, make your changes, and click Save again. The changes will update on your chart once you click Add to Chart.