Advertisement

Maa Sharda Trading

Maa Sharda Trading – Code Locked

Maa Sharda Trading

EMA Energy + Supertrend + Auto TP/SL | Fractal SL + RR Targets

Updated – 30 Oct 2025

यह इंडिकेटर क्या करता है?

ये एक एडवांस्ड सुपरट्रेंड + EMA एनर्जी इंडिकेटर है जिसमें 15 EMA लाइनें, Keltner बेस्ड सुपरट्रेंड, BUY/SELL लेबल और ऑटो TP1, TP2, TP3 + फ्रैक्टल SL हैं। सिग्नल पर लाइनें + लेबल्स दिखते हैं।

मुख्य फीचर्स (Key Features)

EMA Energy

15 EMA (9-51) – ऊपर = हरा, नीचे = लाल

Supertrend

Keltner + ATR बेस्ड, सेंसिटिविटी कंट्रोल

TP & SL

फ्रैक्टल SL + 1:1, 1:2, 1:1.5 RR टारगेट्स

लेबल & लाइनें

Entry, SL, TP1-3 – कस्टम स्टाइल, ऑफसेट

बार कलर

EMA 10/20 क्रॉस + सुपरट्रेंड पर

कस्टमाइजेशन

सेंसिटिविटी, फैक्टर, लाइन स्टाइल, साइज

कोड देखने के लिए लॉगिन करें (Login to View Code)

This code is password protected. Enter credentials to unlock.

//@version=5
// @maashardatrading07
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

indicator("Maa Sharda Trading", overlay=true, precision=0, explicit_plot_zorder=true, max_labels_count=500)

// Get user input
emaEnergy   = input.bool(true, "EMA Energy")
sensitivity = input.float(10, "  Sensitivity (0.5 - 10)", 0.5, 10, step=0.1)
keltner_length = input(10, "Keltner Channel Length")
atrPeriod = input(10, "ATR Length")
factor = input.float(3.5, "Factor", step = 0.01)

// Keltner Channel function
keltner_channel(src, length) =>
    ma = ta.sma(src, length)
    rangec = high - low
    upper = ma + rangec
    lower = ma - rangec
    [upper, lower]

// Modified Supertrend function using Keltner Channel
supertrend(_src, factor, atrLen, kel_length) =>
    [upperKeltner, lowerKeltner] = keltner_channel(_src, kel_length)
    rangec = upperKeltner - lowerKeltner
    upperBand = _src + factor * rangec
    lowerBand = _src - factor * rangec
    prevLowerBand = nz(lowerBand[1])
    prevUpperBand = nz(upperBand[1])
    lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
    upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
    int direction = na
    float superTrend = na
    prevSuperTrend = superTrend[1]

    if na(rangec[1])
        direction := 1
    else if prevSuperTrend == prevUpperBand
        direction := close > upperBand ? -1 : 1
    else
        direction := close < lowerBand ? 1 : -1
    superTrend := direction == -1 ? lowerBand : upperBand
    [superTrend, direction]

// Get Components
ema1        = ta.ema(high,  9)
ema2        = ta.ema(high, 12)
ema3        = ta.ema(high, 15)
ema4        = ta.ema(high, 18)
ema5        = ta.ema(high, 21)
ema6        = ta.ema(high, 24)
ema7        = ta.ema(high, 27)
ema8        = ta.ema(high, 30)
ema9        = ta.ema(high, 33)
ema10       = ta.ema(high, 36)
ema11       = ta.ema(high, 39)
ema12       = ta.ema(high, 42)
ema13       = ta.ema(high, 45)
ema14       = ta.ema(high, 48)
ema15       = ta.ema(high, 51)

// Colors
green       = #2BBC4D, red     = #C51D0B
emaEnergyColor(ma) => emaEnergy ? (close >= ma ? green : red) : na

// Plots
plot(ema1, "", emaEnergyColor(ema1), editable=false)
plot(ema2, "", emaEnergyColor(ema2), editable=false)
plot(ema3, "", emaEnergyColor(ema3), editable=false)
plot(ema4, "", emaEnergyColor(ema4), editable=false)
plot(ema5, "", emaEnergyColor(ema5), editable=false)
plot(ema6, "", emaEnergyColor(ema6), editable=false)
plot(ema7, "", emaEnergyColor(ema7), editable=false)
plot(ema8, "", emaEnergyColor(ema8), editable=false)
plot(ema9, "", emaEnergyColor(ema9), editable=false)
plot(ema10, "", emaEnergyColor(ema10), editable=false)
plot(ema11, "", emaEnergyColor(ema11), editable=false)
plot(ema12, "", emaEnergyColor(ema12), editable=false)
plot(ema13, "", emaEnergyColor(ema13), editable=false)
plot(ema14, "", emaEnergyColor(ema14), editable=false)
plot(ema15, "", emaEnergyColor(ema15), editable=false)

[supertrend, direction] = supertrend(close, sensitivity, 11, keltner_length)
bull = ta.crossover(close, supertrend)
bear = ta.crossunder(close, supertrend)

y1 = low - (ta.atr(30) * 2)
y2 = high + (ta.atr(30) * 2)

buy  = bull ? label.new(bar_index, y1, "BUY", xloc.bar_index, yloc.price, green, label.style_label_up, color.white, size.normal) : na
sell = bear ? label.new(bar_index, y2, "SELL", xloc.bar_index, yloc.price, red, label.style_label_down, color.white, size.normal) : na

[supertrends, directions] = ta.supertrend(factor, atrPeriod)
bodyMiddle = plot((open + close) / 2, display=display.none)

// Trend Catcher Indicator
ema100 = ta.ema(close, 10)
ema200 = ta.ema(close, 20)
trendCatcher = ta.crossover(ema100, ema200) ? 1 : ta.crossunder(ema100, ema200) ? -1 : 0
trendColor = trendCatcher == 1 ? color.rgb(90, 23, 102) : na
barcolor(trendColor)

// Colored candles
barcolor(color = close > supertrends ? color.rgb(102, 255, 0) : color.rgb(255, 0, 0))

///...... TP & SL TOOLS ........
price=close
useFractal = input.bool(true, title = 'Use Fractal for Stop Loss', group = 'Trade Levels')

// ==== إعدادات العرض: مجموعة TP&SL STYLE ====
showLabels = input.bool(true, title = 'Show TP&SL Labels?', group = 'TP&SL STYLE')
offset = input.int(5, title = 'Offset from Last Bar', minval = 1, maxval = 100, group = 'TP&SL STYLE')
len = input.int(5, title = 'Line Length', minval = 1, maxval = 100, group = 'TP&SL STYLE')
labelSizeOption = input.string('Normal', title = 'Label Size', options = ['Tiny', 'Small', 'Normal', 'Large'], group = 'TP&SL STYLE')
lineWidth = input.int(1, title = 'Line Width', minval = 1, maxval = 5, group = 'TP&SL STYLE')
lineStyleOption = input.string('Solid', title = 'Line Style', options = ['Solid', 'Dotted', 'Dashed'], group = 'TP&SL STYLE')

// ==== تحويل الإعدادات ====
labelSize = switch labelSizeOption
    'Tiny' => size.tiny
    'Small' => size.small
    'Normal' => size.normal
    'Large' => size.large

lineStyle = switch lineStyleOption
    'Solid' => line.style_solid
    'Dotted' => line.style_dotted
    'Dashed' => line.style_dashed

// ==== حساب fractals ====
fractalLow = low[2] < low[1] and low[2] < low[3] and low[2] < low[0] ? low[2] : na
fractalHigh = high[2] > high[1] and high[2] > high[3] and high[2] > high[0] ? high[2] : na

var float lastFractalLow = na
var float lastFractalHigh = na
if not na(fractalLow)
    lastFractalLow := fractalLow
if not na(fractalHigh)
    lastFractalHigh := fractalHigh

// ==== وقف الخسارة: fractal أو يدوي ====
stopLoss = useFractal ? bull ? lastFractalLow : lastFractalHigh : na

// ==== حساب الأهداف التلقائية ====
slDistance = math.abs(close - stopLoss)
tp1 = bull  ? close + slDistance * 1 : close - slDistance * 1
tp2 = bull  ? close+ (tp1 - close) * 2 : close - (close - tp1) * 2
tp3 = bull  ? close + (tp2 - close) * 1.5 : close - (close - tp2) * 1.5

// ==== الموضع الأفقي ====
int lastBar = bar_index + offset

// ==== الخطوط ====
var line entryLine = na
var line slLine = na
var line tp1Line = na
var line tp2Line = na
var line tp3Line = na

var float newtp1 =na
var float newtp2 = na
var float newtp3 = na
var float newSl=na
var float avv=na

if (bull or bear)
    newtp1:= tp1
    newtp2:=tp2
    newtp3:=tp3
    newSl:=stopLoss
    avv:=close
    line.delete(entryLine)
    line.delete(slLine)
    line.delete(tp1Line)
    line.delete(tp2Line)
    line.delete(tp3Line)
    entryLine := line.new(lastBar - len, close, lastBar, close, color = color.orange, width = lineWidth, style = lineStyle)
    slLine := line.new(lastBar - len, stopLoss, lastBar, stopLoss, color = color.red, width = lineWidth, style = lineStyle)
    tp1Line := line.new(lastBar - len, tp1, lastBar, tp1, color = color.green, width = lineWidth, style = lineStyle)
    tp2Line := line.new(lastBar - len, tp2, lastBar, tp2, color = color.green, width = lineWidth, style = lineStyle)
    tp3Line := line.new(lastBar - len, tp3, lastBar, tp3, color = color.green, width = lineWidth, style = lineStyle)

// ==== الليبلات ====
var label entryLabel = na
var label slLabel = na
var label tp1Label = na
var label tp2Label = na
var label tp3Label = na

if (bull or bear)  
    avv:=close
    label.delete(entryLabel)
    label.delete(slLabel)
    label.delete(tp1Label)
    label.delete(tp2Label)
    label.delete(tp3Label)
    entryLabel := label.new(lastBar, close, 'Entry : ' + str.tostring(close), style = label.style_label_left, color = color.orange, textcolor = color.white, size = labelSize)
    slLabel := label.new(lastBar, stopLoss, 'SL : ' + str.tostring(stopLoss), style = label.style_label_left, color = color.red, textcolor = color.white, size = labelSize)
    tp1Label := label.new(lastBar, tp1, 'TP1 : ' + str.tostring(tp1), style = label.style_label_left, color = color.green, textcolor = color.white, size = labelSize)
    tp2Label := label.new(lastBar, tp2, 'TP2 : ' + str.tostring(tp2), style = label.style_label_left, color = color.green, textcolor = color.white, size = labelSize)
    tp3Label := label.new(lastBar, tp3, 'TP3 : ' + str.tostring(tp3), style = label.style_label_left, color = color.green, textcolor = color.white, size = labelSize)

// Update labels and lines
if not na(slLabel)
    label.delete(slLabel)
    slLabel := label.new(bar_index + offset, newSl, "SL : "+str.tostring(newSl),style = label.style_label_left,color=color.red,textcolor = color.white,size = labelSize )

if not na(entryLabel)
    label.delete(entryLabel)
    entryLabel := label.new(bar_index + offset, avv, "Entry: "+str.tostring(avv),style = label.style_label_left,color=color.orange,textcolor = color.white,size = labelSize )

if not na(tp1Label)
    label.delete(tp1Label)
    tp1Label:= label.new(bar_index+offset,newtp1,"TP1 : "+str.tostring(newtp1),style =label.style_label_left,color=color.green,textcolor = color.white,size = labelSize )

if not na(tp2Label)
    label.delete(tp2Label)
    tp2Label:= label.new(bar_index+offset,newtp2,"TP2 : "+str.tostring(newtp2),style =label.style_label_left,color=color.green,textcolor = color.white,size = labelSize )

if not na(tp3Label)
    label.delete(tp3Label)
    tp3Label:= label.new(bar_index+offset,newtp3,"TP3 : "+str.tostring(newtp3),style =label.style_label_left,color=color.green,textcolor = color.white,size = labelSize )

if not na(entryLine)
    line.delete(entryLine)
    entryLine := line.new(bar_index+offset-len,avv,bar_index+offset,avv,color=color.orange,width = lineWidth,style = lineStyle)

if not na(slLine)
    line.delete(slLine)
    slLine := line.new(bar_index+offset-len,newSl,bar_index+offset,newSl,color=color.red,width = lineWidth,style = lineStyle)

if not na(tp1Line)
    line.delete(tp1Line)
    tp1Line := line.new(bar_index+offset-len,newtp1,bar_index+offset,newtp1,color=color.green,width = lineWidth,style = lineStyle)

if not na(tp2Line)
    line.delete(tp2Line)
    tp2Line := line.new(bar_index+offset-len,newtp2,bar_index+offset,newtp2,color=color.green,width = lineWidth,style = lineStyle)

if not na(tp3Line)
    line.delete(tp3Line)
    tp3Line := line.new(bar_index+offset-len,newtp3,bar_index+offset,newtp3,color=color.green,width = lineWidth,style = lineStyle)
            

Code unlocked! अब आप इसे कॉपी कर सकते हैं।

सपोर्ट & अपडेट्स (Support & Updates)

Update Available: Auto S/R + Volume Profile

© 2025 Maa Sharda Trading | Code Protected
For Educational Purpose Only | Not Financial Advice

Post a Comment

0 Comments