
اس حکمت عملی میں مارکیٹ کے رجحانات کا اندازہ لگانے کے لئے دو حرکت پذیر اوسطوں کے کراس کا استعمال کیا جاتا ہے ، اور جب قلیل مدتی حرکت پذیر اوسط پر طویل مدتی حرکت پذیر اوسط ہوتا ہے تو زیادہ پوزیشنیں کھولی جاتی ہیں ، اور اس کے برعکس خالی پوزیشنیں کھولی جاتی ہیں۔ اس کے علاوہ ، اس حکمت عملی میں کثیر درجے کا فائدہ اٹھانے کا طریقہ استعمال کیا جاتا ہے ، جب قیمت منافع کی مطلوبہ سطح تک پہنچ جاتی ہے تو ، اس کی جگہ پر صفائی کی جاتی ہے ، جس سے منافع کو زیادہ سے زیادہ کیا جاسکتا ہے اور خطرے پر قابو پایا جاسکتا ہے۔
اس حکمت عملی کا بنیادی مقصد مارکیٹ کے رجحانات کو پکڑنے کے لئے مختلف ادوار کی متحرک اوسطوں کا استعمال کرنا ہے۔ جب قلیل مدتی متحرک اوسط پر طویل مدتی متحرک اوسط سے تجاوز کرنا ہوتا ہے تو اس کا مطلب ہے کہ مارکیٹ میں اضافے کا رجحان ہوسکتا ہے ، اس وقت زیادہ پوزیشنیں کھولی جاتی ہیں۔ جب قلیل مدتی متحرک اوسط کے نیچے طویل مدتی متحرک اوسط سے تجاوز کرنا ہوتا ہے تو اس کا مطلب ہے کہ مارکیٹ میں کمی کا رجحان ہوسکتا ہے ، اس وقت خالی پوزیشنیں کھولی جاتی ہیں۔
متحرک اوسط کراس کثیر پرت منافع کی حکمت عملی ایک سادہ اور موثر رجحان کی پیروی کی حکمت عملی ہے ، جس میں متعدد سطحوں پر منافع کا خاتمہ کیا گیا ہے ، جس سے رجحان میں زیادہ منافع حاصل کیا جاسکتا ہے ، جبکہ خطرے پر قابو پایا جاسکتا ہے۔ تاہم ، اس حکمت عملی میں کچھ حدود اور خطرات بھی موجود ہیں ، جن کو مارکیٹ کی مخصوص صورتحال اور صارف کی ضروریات کے مطابق بہتر اور بہتر بنانے کی ضرورت ہے۔ مجموعی طور پر ، یہ حکمت عملی ایک موثر تجارتی آلہ کے طور پر کام کر سکتی ہے ، لیکن اس پر مکمل طور پر انحصار نہیں کیا جاسکتا ہے ، جس کو بہترین اثر کے ل other دوسرے تجزیاتی طریقوں اور خطرے کے انتظام کے اقدامات کے ساتھ مل کر استعمال کرنے کی ضرورت ہے۔
/*backtest
start: 2023-04-20 00:00:00
end: 2024-04-25 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ValdesTradingBots
//Follow Us for More Insights and Updates!
//Join our community and be the first to know about our new releases and trading tips
//Facebook Group: Join our vibrant community at https://www.facebook.com/groups/707469081464839/
//Twitter: Follow us for quick updates and insights at https://twitter.com/ValdesBots
//We're excited to have you with us!
//@version=5
strategy("Valdes Trading Bots MA Cross with Multiple Take Profits", overlay=true)
shortPeriod = input(18, title="Short MA Period")
longPeriod = input(32, title="Long MA Period")
// Take Profit Settings
tp1Enabled = input(true, title="Enable Take Profit 1")
tp1Perc = input(15, title="Take Profit 1 (%)") / 100
tp1QtyPerc = input(25, title="Take Profit 1 Qty (%)") / 100
tp2Enabled = input(true, title="Enable Take Profit 2")
tp2Perc = input(30, title="Take Profit 2 (%)") / 100
tp2QtyPerc = input(25, title="Take Profit 2 Qty (%)") / 100
tp3Enabled = input(true, title="Enable Take Profit 3")
tp3Perc = input(45, title="Take Profit 3 (%)") / 100
tp3QtyPerc = input(25, title="Take Profit 3 Qty (%)") / 100
tp4Enabled = input(true, title="Enable Take Profit 4")
tp4Perc = input(60, title="Take Profit 4 (%)") / 100
tp4QtyPerc = input(25, title="Take Profit 4 Qty (%)") / 100
shortMA = ta.sma(close, shortPeriod)
longMA = ta.sma(close, longPeriod)
// Determine the trend
uptrend = shortMA > longMA
downtrend = shortMA < longMA
// Assign candle colors based on the trend
candleColor = uptrend ? color.rgb(9, 112, 0) : downtrend ? color.rgb(255, 0, 0) : color.new(color.blue, 0)
plot(shortMA, title="Short MA", color=color.rgb(9, 112, 0))
plot(longMA, title="Long MA", color=color.rgb(255, 0, 0))
// Create a cross signal
longCross = ta.crossover(shortMA, longMA)
shortCross = ta.crossunder(shortMA, longMA)
// Strategy entry
if (longCross)
strategy.entry("Long", strategy.long)
if (shortCross)
strategy.entry("Short", strategy.short)
// Strategy take profit
if (tp1Enabled and strategy.position_size > 0)
strategy.exit("TP1 Long", "Long", qty_percent=tp1QtyPerc, limit=strategy.position_avg_price * (1 + tp1Perc))
if (tp1Enabled and strategy.position_size < 0)
strategy.exit("TP1 Short", "Short", qty_percent=tp1QtyPerc, limit=strategy.position_avg_price * (1 - tp1Perc))
if (tp2Enabled and strategy.position_size > 0)
strategy.exit("TP2 Long", "Long", qty_percent=tp2QtyPerc, limit=strategy.position_avg_price * (1 + tp2Perc))
if (tp2Enabled and strategy.position_size < 0)
strategy.exit("TP2 Short", "Short", qty_percent=tp2QtyPerc, limit=strategy.position_avg_price * (1 - tp2Perc))
if (tp3Enabled and strategy.position_size > 0)
strategy.exit("TP3 Long", "Long", qty_percent=tp3QtyPerc, limit=strategy.position_avg_price * (1 + tp3Perc))
if (tp3Enabled and strategy.position_size < 0)
strategy.exit("TP3 Short", "Short", qty_percent=tp3QtyPerc, limit=strategy.position_avg_price * (1 - tp3Perc))
if (tp4Enabled and strategy.position_size > 0)
strategy.exit("TP4 Long", "Long", qty_percent=tp4QtyPerc, limit=strategy.position_avg_price * (1 + tp4Perc))
if (tp4Enabled and strategy.position_size < 0)
strategy.exit("TP4 Short", "Short", qty_percent=tp4QtyPerc, limit=strategy.position_avg_price * (1 - tp4Perc))
// Plotting the signals on the chart
plotshape(series=longCross, title="Long Cross", location=location.belowbar, color=color.rgb(9, 112, 0), style=shape.triangleup, size=size.small)
plotshape(series=shortCross, title="Short Cross", location=location.abovebar, color=color.rgb(255, 0, 0), style=shape.triangledown, size=size.small)
// Apply candle color
barcolor(candleColor)