Mando's Fuk Around Find out!# **🚀 MANDO’S FUK AROUND FIND OUT! 🚀**
**🔥 The High-Octane Trading Indicator That Puts You in the Fast Lane! 🔥**
🚗 **Ladies and gentlemen, traders and market warriors, let me introduce you to the most exhilarating, heart-pounding, game-changing trading script on the planet –** ***MANDO’S FUK AROUND FIND OUT!*** **This isn’t just an indicator – it’s a finely tuned beast ready to DOMINATE the market like a V12 supercar!**
---
### **🔥 WHY THIS SCRIPT WILL MAKE YOU A MARKET DOMINATOR 🔥**
✅ **🚀 Lightning-Fast Trade Entries** – This bad boy features a **7-period Fast EMA and a 19-period Slow EMA**, giving you the ACCELERATION you need to **spot trends early** and leave the competition eating your dust!
✅ **🎯 Pinpoint Buy & Sell Signals** – It’s like having a built-in radar detecting **BUY (FUK AROUND)** and **SELL (FIND OUT)** moments, so you’re NEVER caught off guard!
✅ **⚙️ Precision-Tuned Lorentzian Line** – Acting like a **traction control system**, the Lorentzian Line makes sure your trades stick to the road and keep you from skidding into losses!
✅ **📢 High-Impact Alerts** – Get **real-time notifications** the moment the market shifts – no more staring at the charts like a lost tourist!
✅ **🎨 VISUAL MASTERPIECE** – The **BUY signals pop in bold NAVY BLUE** and the **SELL signals scream in WARNING RED** – like traffic lights guiding you through the chaos of the market!
✅ **💨 "Smart Braking System" for Exits** – You’re getting a built-in **TWO-CONSECUTIVE-CANDLE SELL CONFIRMATION** so you **exit right before the trend tanks!**
✅ **🧠 Plug-and-Play Simplicity** – Whether you’re a veteran trader or just getting started, this script is **EASY to use**, with zero complicated setups or messy configurations!
---
### **🛑 BUT WAIT! EVEN THE BEST MACHINES HAVE LIMITATIONS…**
💥 **Not Ideal for Choppy Markets** – Just like a race car on a dirt road, this beast **performs best in trending conditions**. In sideways markets, you might get some false starts!
💥 **Doesn’t Predict the Future** – This isn’t a crystal ball, folks! **It’s a high-performance guidance system** – YOU still need to drive the car!
💥 **Discipline Required** – If you’re the type to ignore stoplights and speed limits, you *might* ignore signals too. **Stick to the system, and it’ll take you to the finish line!**
---
### **🚀 FINAL CALL: ARE YOU READY TO FUK AROUND AND FIND OUT?! 🚀**
Listen, traders, **this isn’t a minivan indicator** – this is a **TURBO-CHARGED, TRACK-TESTED TRADING MACHINE** built for those who want to win.
You can either **sit in traffic with slow, outdated strategies**, OR you can hit the gas with **MANDO’S FUK AROUND FIND OUT** and start **trading like a professional!**
👉 **Get in the driver’s seat NOW – or watch from the sidelines while others take home the prize!** 👈
🚗 **Buckle up, fire up your engines, and let’s ride this market to the moon!** 🚀💨
خدمات Pine
Scalper Strategy 15M V3This script combines two popular indicators, MACD and RSI, to provide more accurate trading signals. Additionally, it displays Support & Resistance levels based on the last 50 candles, helping traders identify potential price reversal areas.
Intraday & Swing traders looking to optimize their entry & exit points
TradingView users seeking stronger confirmation in trading signals.
Traders who incorporate support & resistance into their strategies.
How to Use:
1. Adjust the MACD & RSI parameters to match your strategy.
2. Use Support & Resistance levels to spot potential price reversals.
3. Watch for Buy/Sell signals appearing on the chart.
Always use proper risk management. No strategy is perfect, so backtest before using it on a live account.
SMATRADE ProGBPJPY 1 HOUR STRATEGY (ONLY)
Using 2*atr for SL and 4*atr for TP
Entry on close
TP and SL on chart
Entry Sniper Momentum for XAUUSD M5📌 Trading Strategy Description: "SMA Momentum RSI & ADX"
This strategy is designed for XAUUSD on the 5-minute (M5) timeframe. It combines multiple technical indicators to identify momentum-based trading opportunities 📈📉.
🔎 1. Indicators Used
The strategy relies on four main indicators:
1️⃣ Simple Moving Averages (SMA 9 & SMA 21) → To detect trends
2️⃣ Relative Strength Index (RSI 14) → To filter entries based on market strength
3️⃣ Average Directional Index (ADX 14) → To confirm the trend's strength
4️⃣ Average True Range (ATR 14) → To adjust Stop Loss and Take Profit
📊 2. Entry Conditions
📌 Buy Signal (Long):
✅ Bullish crossover of SMA 9 above SMA 21 📈
✅ RSI below 70 (avoiding overbought entries)
✅ Bullish MACD (MACD line above the Signal line)
✅ ADX above 20 (confirming a strong trend)
📌 Sell Signal (Short):
✅ Bearish crossover of SMA 9 below SMA 21 📉
✅ RSI above 30 (avoiding oversold entries)
✅ Bearish MACD (MACD line below the Signal line)
✅ ADX above 20 (confirming a strong trend)
📏 3. Risk Management (SL/TP)
📌 Stop Loss (SL) based on the latest highs/lows 📊
📌 Take Profit (TP) set at 2 times the Stop Loss distance (2:1 Ratio)
📈 4. Strategy Objective
✅ Capture short but strong trends in XAUUSD on M5
✅ Minimize false signals using RSI and ADX as filters
✅ Optimize exits with a TP/SL ratio of 2:1 to maximize profit potential
💡 Conclusion
🔥 Momentum-based strategy with advanced filters
📊 Optimized for XAUUSD on the 5-minute timeframe
⚡ Good balance between fast signals and risk management
➡️ Want to improve it even more? We could test a trailing stop or volume filtering! 🚀💰
Highlight 8:15 AM CandlesHighlight a candle on any timeframe at any time. Allows you to quickly see a certain time of day is on an intraday chart if looking across multiple days data
Moving Average Crossover with Stop Loss and Take ProfitMoving Average Crossover with Stop Loss and Take Profit
Mando's Buy / Sell Swing Set up### 🚀 **The Ultimate Trading Edge: Your Lorentzian-EMA Crossover Indicator!** 🚀
**Hey, trader!** You’re about to unlock a **powerful** market weapon that blends the precision of **exponential moving averages (EMAs)** with the **cutting-edge Lorentzian Classification**—an advanced smoothing technique that **filters noise and finds explosive trends** before they happen.
This isn’t your average **crossover** indicator—it’s **next-level smart**, engineered to:
✅ **Identify prime entry points with insane accuracy**
✅ **Eliminate false signals by using trend filtering**
✅ **Pinpoint Red Flag Sell signals before the market dumps**
---
## **🔷 Here’s Why You NEED This Indicator:**
**🔹 “Buy Low, Sell High” is Boring. This is “Buy Right, Sell Smart.”**
- Not all crossovers are created equal! This script waits for **price confirmation above the Slow EMA** before signaling a **real** buy—meaning fewer false starts and **higher win rates**.
**🔹 “Red Flag Sell” System That Screams “EXIT NOW!”**
- No more second-guessing when to take profit! If the price crashes **below** the Lorentzian line **AND** your EMA trend confirms weakness, a **giant red flag pops up** telling you to SELL before your gains disappear.
**🔹 No More Laggy Indicators – This Thing is FAST.**
- Most moving averages react **too slow**, making you miss the **best** moves. The Lorentzian line smooths out **noise** while keeping things lightning-fast so you can react **immediately** when momentum shifts.
---
## **🔥 Real-World Trading Scenarios:**
🔹 **You're trading Bitcoin, and price crosses above the Lorentzian line** → A **green BUY arrow appears** at the perfect moment before BTC pumps $2,000! 💰
🔹 **Tesla stock is skyrocketing, but suddenly a Red Flag Sell appears** → You exit **before** the rug pull, locking in **huge profits** while others get wrecked!
🔹 **You’re scalping the 5-minute chart on EUR/USD** → No more guessing—your buy/sell signals **show you the exact trend shift**, giving you an edge over 95% of traders.
---
## **🎯 Who Is This Indicator For?**
✅ **Day traders & scalpers** who need **rapid buy/sell signals**
✅ **Swing traders** who want to **avoid weak trends** and **capture big moves**
✅ **Crypto traders** looking for **precise** Bitcoin & altcoin breakouts
✅ **Stock traders** who want a **clear exit strategy** before a market dump
---
## **🚀 Ready to Trade Smarter?**
This **isn’t** just another moving average script.
This is your **new competitive advantage** in the markets.
**👉 Add it to your TradingView chart NOW and take your trading to the next level! 🔥**
SASDv2rSensitive Altcoin Season Detector V2
This Pine Script™ code, titled "SASDv2r" (Sensitive Altcoin Season Detector version 2 revised), is designed for cryptocurrency trading analysis on the TradingView platform and tailored for those interested in tracking when altcoins might be outperforming Bitcoin, potentially indicating a market shift towards altcoins.
Feel free to use and modify. If you made it better, please let me know. Intention was to help the community with a tool for retail traders have no access to advanced, MV indicators. Solution uses classic TA only.
Use it witl TOTAL3/BTC indicator.
Please check: it gave signal just before last alt season % rose more than 250%.
Market Cap Data Fetching: The script fetches market capitalization data for Bitcoin, Ethereum, and all other altcoins (excluding Bitcoin and Ethereum) using request.security function.
Altcoin to Bitcoin Ratio: It calculates the ratio of total market cap of altcoins to Bitcoin's market cap (altToBtcRatio), which is central to identifying an "altcoin season."
Moving Averages: Several moving averages are computed for different time frames (50-day SMA, 200-day SMA, 20-day SMA, and 10-day EMA) to analyze trends in the altcoin to Bitcoin ratio.
Momentum Indicators: The script uses RSI (Relative Strength Index) and MACD (Moving Average Convergence Divergence) to gauge momentum and potential reversal points in the market.
Custom Indicators: It includes Volume Weighted Moving Average (VWMA) and a custom momentum indicator (altMomentum and altMomentumAvg) to provide additional insights into market movements.
Volatility Measurement: Bollinger Bands are calculated to assess volatility in the altcoin to Bitcoin ratio, which helps identify periods of high or low market activity.
Visual Analysis: Various plots are added to the chart for visual interpretation, including the altcoin to Bitcoin ratio, different moving averages, and Bollinger Bands.
Alt Season Detection: The script defines conditions for detecting when an "altcoin season" might be starting, based on crossovers of moving averages, RSI levels, MACD signals, and other custom criteria.
Performance Tracking: After signaling an alt season, the script evaluates the performance over the next 30 days by checking if there's been an increase in the altcoin to Bitcoin ratio, adding labels for positive or negative trends.(this one is in progress). Logic still gives false signals and aim is to identify failed signals.
Visual Signals: Labels are placed on the chart to visually indicate the beginning of a potential alt season or the performance outcome after a signal, aiding traders in making informed decisions.
RSI - MUA BAN - Captain Hope communities----------------------RSI - MUA BAN - Captain Hope communities--------------------------
RSI Calculation Computes RSI based on user-defined source and length.
Moving Average (MA) Calculation Computes an RSI-based simple moving average (SMA) and a 50-period SMA of the closing price.
Buy & Sell Levels Customizable RSI levels for buy and sell signals with adjustable thresholds.
Signal Conditions - Buy signal: RSI crosses above the adjusted buy level and was previously below it.
- Sell signal: RSI crosses below the adjusted sell level and was previously above it.
Check Conditions - "?.UP" signal when RSI crosses above RSI-based MA, price is below MA50, and rising.
- "?.DOWN" signal when RSI crosses below RSI-based MA, price is above MA50, and falling.
Visual Representation - Plots MA 50 line on the chart.
- Displays "Buy" and "Sell" labels based on conditions.
- Shows "?.UP" and "?.DOWN" markers based on additional conditions.
Customizable Appearance Users can configure text and background colors for buy/sell signals.
Alert Conditions Triggers alerts for buy and sell signals based on RSI conditions.
TOTAL3/BTC This Pine Script™ code, named "TOTAL3/BTC with Arrow," is designed for cryptocurrency analysis on TradingView.
This script essentially provides a visual tool for traders to gauge when altcoins might be gaining or losing ground relative to Bitcoin through moving average analysis and color-coded trend indication.
Intention was to help the community with a script based on classic TA only.
Use it with SASDv2r indicator.
Feel free to make it better. If you did so, please let me know.
Main elements:
Data Fetching: It retrieves market cap data for all cryptocurrencies excluding Bitcoin and Ethereum (TOTAL3) and for Bitcoin (BTC).
Ratio Calculation: The script calculates the ratio of TOTAL3 to BTC market caps, which indicates how altcoins (excluding ETH) are performing relative to Bitcoin.
Plotting the Ratio: This ratio is plotted on the chart with a blue line, allowing traders to see the relative performance visually.
Moving Averages: Two Simple Moving Averages (SMA) are calculated for this ratio, one for 20 periods (ma20) and another for 50 periods (ma50), though these are not plotted in the current version of the code.
Reference Lines: Horizontal lines are added at ratios of 0.3 and 0.8 to serve as visual equilibrium points or thresholds for analysis.
Complex Moving Average: The script uses constants (len, len2, cc, smoothe) from another script, suggesting it's adapting or simplifying another's logic for multi-timeframe analysis.
Average Calculation: Two SMAs (avg and avg2) are computed using the constants defined, focusing on different lengths for trend analysis.
Direction Determination: It checks if the moving average is trending up or down by comparing the current value with its value smoothe bars earlier.
Color Coding: The color of the plotted moving average changes based on its direction (lime for up, red for down, aqua if no clear direction), aiding in quick visual interpretation of trends.
Plotting: Finally, the script plots this multi-timeframe moving average with a dynamic color to reflect the current market trend of the TOTAL3/BTC ratio, with a thicker line for visibility.
Library taplus (Médias móveis avançadas)Biblioteca taplus - Descrição Técnica (PT-BR)
Médias móveis avançadas
Introdução:
A biblioteca taplus é uma coleção avançada de 14 tipos de médias móveis personalizadas para Pine Script (v5), projetada para traders e desenvolvedores que buscam ferramentas técnicas precisas e eficientes. Oferece desde algoritmos clássicos até métodos adaptativos modernos, com código otimizado para estratégias e indicadores.
Motivação e Necessidade:
Desenvolvida para preencher lacunas na biblioteca padrão do TradingView, a taplus surge da necessidade de:
Acesso a médias móveis especializadas (ex: ALMA, FRAMA)
Cálculos precisos com baixa latência
Simplificação da criação de indicadores complexos
Correções de bugs em implementações existentes
Descrição:
A biblioteca contém algoritmos matematicamente validados, documentação clara e exemplos práticos. É open-source (MPL 2.0) e compatível com estratégias automatizadas.
Sumário dos Tipos de Médias (14 Total):
(Seção exclusiva - sem limite de caracteres)
HMA (Hull MA):
Reduz lag usando WMAs aninhadas. Ideal para identificar tendências com resposta rápida.
LWMA (Linear Weighted MA):
Ponderada linearmente (últimos dados têm maior peso). Simples, porém eficaz para momentum.
GMA (Geometric MA):
Baseada na média geométrica (multiplicativa). Recomendada para séries positivas.
AMA (Adaptive MA):
Ajusta velocidade conforme eficiência do movimento. Filtra ruídos de mercado.
KAMA (Kaufman Adaptive MA):
Versão otimizada da AMA com suavização exponencial. Precisão em períodos voláteis.
DEMA (Double EMA):
EMA duplo para redução de lag. Combinação de duas camadas exponenciais.
TEMA (Triple EMA):
EMA triplo com redução adicional de lag. Indicador técnico avançado.
Wilders (WSMA):
Suavização estilo Welles Wilder (RMA). Base para indicadores como RSI.
ZLEMA (Zero Lag EMA):
Compensa o lag tradicional usando ajuste de fase. Ideal para scalping.
VIDYA (Variable Index DA):
Adapta-se via Chande Momentum Oscillator (CMO). Dinamismo em mercados cíclicos.
McGinley Dynamic:
Ajusta velocidade automaticamente conforme a volatilidade. Minimiza falsos sinais.
ALMA (Arnaud Legoux MA):
Ponderação Gaussiana com offset ajustável. Precisão em reversões de preço.
LSMA (Least Squares MA):
Baseada em regressão linear. Projeta suportes/resistências futuras.
FRAMA (Fractal Adaptive MA):
Usa dimensão fractal para adaptação. Eficaz em mercados caóticos.
Bug Fixes (vs. Versões Anteriores):
Correção na FRAMA (parâmetro length não utilizado)
Revisão das fórmulas KAMA e AMA (cálculo do Efficiency Ratio)
Ajuste no McGinley Dynamic (estabilidade numérica em divisões)
Otimização do ZLEMA (correção do lag teórico)
Melhoria na VIDYA (uso do CMO para dynamic alpha)
Exemplos de Uso:
//pinescript v5 (em breve será atualizado para versão 6 de Pinescript)
// Exemplo 1: Combinação HMA + FRAMA
import cesar_consultant/taplus/1 as taplus
hma = taplus.hma(close, 20)
frama = taplus.frama(close, 14, 10)
plot(hma, color=color.blue)
plot(frama, color=color.red)
///////////////////////////////////////////////
// Exemplo 2: ALMA Personalizada
alma = taplus.alma(close, 28, 0.9, 5.0)
plot(alma, title="ALMA Customizada", color=color.purple)
Contato & Solicitações:
🔗 Código em desenvolvimento. Solicite novas médias móveis ou reporte issues!
> Tem alguma idéia de indicadores ou bibliotecas? Entre em contato!
___________________________________________________________
taplus Library - Technical Description (EN-US)
Advanced Moving Averages
Introduction:
The taplus library is an advanced collection of 14 custom moving average types for Pine Script™ (v5), designed for traders and developers seeking precise technical tools. It offers everything from classical algorithms to modern adaptive methods, with code optimized for strategies and indicators.
Motivation & Need:
Developed to address gaps in TradingView's native library, taplus fulfills the need for:
Access to specialized MAs (e.g., ALMA, FRAMA)
Low-latency precision calculations
Simplified creation of complex indicators
Bug fixes in existing implementations
Description:
The library contains mathematically validated algorithms, clear documentation, and practical examples. Open-source (MPL 2.0) and compatible with automated strategies.
MA Type Summary (14 Total):
HMA (Hull MA):
Reduces lag using nested WMAs. Ideal for fast trend identification.
LWMA (Linear Weighted MA):
Linear weighting (recent data prioritized). Simple yet effective for momentum.
GMA (Geometric MA):
Multiplicative geometric mean. Requires positive price series.
AMA (Adaptive MA):
Speed adjusts to market efficiency. Filters market noise.
KAMA (Kaufman Adaptive MA):
AMA optimized with exponential smoothing. Effective in volatility.
DEMA (Double EMA):
Dual EMA layers for lag reduction.
TEMA (Triple EMA):
Triple EMA for enhanced lag reduction. Advanced technical tool.
Wilders (WSMA):
Welles Wilder-style smoothing (RMA). Foundation for RSI-like indicators.
ZLEMA (Zero Lag EMA):
Phase-adjusted lag compensation. Perfect for scalping.
VIDYA (Variable Index DA):
CMO-adapted dynamics. Ideal for cyclical markets.
McGinley Dynamic:
Auto-adjusts to volatility. Minimizes false signals.
ALMA (Arnaud Legoux MA):
Gaussian weighting with adjustable offset. Precision in price reversals.
LSMA (Least Squares MA):
Linear regression-based. Projects future support/resistance.
FRAMA (Fractal Adaptive MA):
Fractal dimension adaptation. Effective in chaotic markets.
Bug Fixes (vs. Previous Versions):
Fixed FRAMA (unused length parameter)
Revised KAMA/AMA formulas (Efficiency Ratio calculation)
Adjusted McGinley Dynamic (numerical stability in divisions)
Optimized ZLEMA (theoretical lag correction)
Enhanced VIDYA (CMO-based dynamic alpha)
Usage Examples:
// PineScript™ v5 (to be updated to v6 soon)
// Example 1: HMA + FRAMA Combination
import cesar_consultant/taplus/1 as taplus
hma = taplus.hma(close, 20)
frama = taplus.frama(close, 14, 10)
plot(hma, color=color.blue)
plot(frama, color=color.red)
///////////////////////////////////////////////
// Example 2: Custom ALMA
alma = taplus.alma(close, 28, 0.9, 5.0)
plot(alma, title="Custom ALMA", color=color.purple)
Contact & Requests:
🔗 Code under active development. Request new MAs or report issues!
Have indicator or library ideas? Contact us!
Hourly & Daily Levels//@version=5
indicator("Hourly & Daily Levels", overlay=true, max_lines_count=500)
// ——————— 1-Hour High/Low ——————— //
var float hourHigh = na
var float hourLow = na
isNewHour = timeframe.change("60")
if isNewHour
hourHigh := high
hourLow := low
else
hourHigh := math.max(hourHigh, high)
hourLow := math.min(hourLow, low)
// ——————— Previous Day High/Low ——————— //
var float prevDayHigh = na
var float prevDayLow = na
isNewDay = timeframe.change("D")
prevDayHigh := ta.valuewhen(isNewDay, request.security(syminfo.tickerid, "D", high ), 0)
prevDayLow := ta.valuewhen(isNewDay, request.security(syminfo.tickerid, "D", low ), 0)
// ——————— Plotting ——————— //
// Current Hour Levels
plot(hourHigh, "1H High", color.new(#00FF00, 0), 2, plot.style_linebr)
plot(hourLow, "1H Low", color.new(#FF0000, 0), 2, plot.style_linebr)
// Previous Day Levels
plot(prevDayHigh, "Prev Day High", color.new(#006400, 0), 2, plot.style_circles)
plot(prevDayLow, "Prev Day Low", color.new(#8B0000, 0), 2, plot.style_circles)
// ——————— Background & Labels ——————— //
bgcolor(isNewHour ? color.new(color.blue, 90) : na, title="Hourly Separation")
bgcolor(isNewDay ? color.new(color.orange, 90) : na, title="Daily Separation")
var label lbl1 = na
var label lbl2 = na
var label lbl3 = na
var label lbl4 = na
if barstate.islast
lbl1 := label.new(bar_index, hourHigh, "Current Hour High " + str.tostring(hourHigh),
color=#00FF00, style=label.style_label_left, textcolor=color.white)
lbl2 := label.new(bar_index, hourLow, "Current Hour Low " + str.tostring(hourLow),
color=#FF0000, style=label.style_label_left, textcolor=color.white)
lbl3 := label.new(bar_index, prevDayHigh, "Prev Day High " + str.tostring(prevDayHigh),
color=#006400, style=label.style_label_right, textcolor=color.white)
lbl4 := label.new(bar_index, prevDayLow, "Prev Day Low " + str.tostring(prevDayLow),
color=#8B0000, style=label.style_label_right, textcolor=color.white)
8 PM IST Breakout StrategyThis strategy works on US markets (US30,S&P500),forex(EUR/USD,GBP/USD,USD/JPY) AND GOLD as well no need to sit for hours and do remeber to exit the trade on or before 12AM IST as volumes decreas and book whatever you get
Keep practicing and connect with me if you have any new ideas.
KEEP HUSTLING KEEP GROWING UNTILL YOU ARE THE RICHEST OF YOUR BLOODLINE
Máximos y Mínimos del Día Anterior (Dinámico)Este script marca los puntos maximos y minimos que hizo el precio en dìa anterior.
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.
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.")
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")
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.