
یہ ایک کثیر مساوی لائن ٹرینڈ ٹریکنگ سسٹم پر مبنی کریپٹوکرنسی ٹریڈنگ حکمت عملی ہے ، جس میں آر ایس آئی اور اے ٹی آر اشارے کو ٹریڈ فلٹرنگ اور رسک مینجمنٹ کے ساتھ ملایا گیا ہے۔ یہ حکمت عملی بنیادی طور پر مرکزی دھارے میں شامل کریپٹوکرنسیوں کے لئے تجارت کرتی ہے ، جس میں روزانہ کی تجارت کی فریکوئنسی کی حد اور متحرک اسٹاپ نقصان کو ترتیب دے کر خطرے کو کنٹرول کیا جاتا ہے۔ حکمت عملی 9 ، 20 اور 50 دوروں کی تین بار انڈیکس کی حرکت پذیری اوسط ((EMA) کا استعمال کرتی ہے تاکہ رجحان کی سمت کا تعین کیا جاسکے ، اور نسبتا strong مضبوط اشارے ((RSI) اور اوسطا حقیقی طول و عرض ((ATR) کو معاون اشارے کے طور پر ٹریڈنگ فلٹرنگ کے لئے استعمال کیا جاسکے۔
اس حکمت عملی کے بنیادی ٹریڈنگ منطق میں درج ذیل اہم اجزاء شامل ہیں:
اس حکمت عملی میں متعدد تکنیکی اشارے کے جامع استعمال کے ذریعہ ، ایک نسبتا robust مستحکم کریپٹوکرنسی ٹریڈنگ سسٹم حاصل کیا گیا ہے۔ منافع اور خطرے کو بہتر طور پر متوازن کرنے کے لئے ، خطرے کے مختلف پیرامیٹرز کی ترتیب اور تجارت کی فریکوئنسی پر سخت کنٹرول ہے۔ اس حکمت عملی کا بنیادی فائدہ اس کے متحرک رسک مینجمنٹ میکانزم اور بہتر فلٹرنگ سسٹم میں ہے ، لیکن اس کے ساتھ ہی کریپٹوکرنسی مارکیٹ میں مخصوص اعلی اتار چڑھاؤ اور لیکویڈیٹی کے خطرات پر بھی توجہ دینے کی ضرورت ہے۔ مسلسل اصلاح اور بہتری کے ذریعہ ، اس حکمت عملی کو مختلف مارکیٹ کے ماحول میں مستحکم کارکردگی کا امکان ہے۔
/*backtest
start: 2015-02-22 00:00:00
end: 2025-02-18 17:23:25
period: 1h
basePeriod: 1h
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © buffalobillcody
//@version=6
strategy("Backtest Last 2880 Baars Filers and Exits", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=2, backtest_fill_limits_assumption=0)
// Define EMAs
shortEMA = ta.ema(close, 9)
longEMA = ta.ema(close, 20)
refEMA = ta.ema(close, 50)
// **Force Strategy to Trade on Historical Bars**
barLimit = bar_index > 10 // Allow trading on past bars
allowTrade = strategy.opentrades == 0 or barLimit // Enable first trade on history
// **Define ATR for Stop-Loss & Take-Profit**
atrLength = 14
atrValue = ta.atr(atrLength)
atr50 = ta.sma(atrValue, 50) // 50-period ATR average
// **Relaxed RSI Filters (More Trades Allowed)**
rsi = ta.rsi(close, 14)
rsiFilterBuy = rsi > 45 and rsi < 70
rsiFilterSell = rsi < 55 and rsi > 30
// **Reduce Trend Filter - Allow Smaller Price Movement**
minDistance = atrValue * 1.1
isTrending = math.abs(close - refEMA) > minDistance
// **Allow Trading in All Conditions (No ATR Filter)**
atrFilter = true
// **Allow Flat EMA Slopes - Increase Trade Frequency**
emaSlope = ta.linreg(refEMA, 5, 0) > -0.2
emaSlopeSell = ta.linreg(refEMA, 5, 0) < 0.2
// **Trade Counter: Allow 1 Trade Per Day**
var int dailyTradeCount = 0
if dayofweek != dayofweek[1]
dailyTradeCount := 0
// **ATR-Based Stop-Loss & Take-Profit Per Pair**
atrSL = switch syminfo.ticker
"EURUSD" => 3.0 * atrValue,
"USDJPY" => 2.5 * atrValue,
"GBPUSD" => 3.0 * atrValue,
"AUDUSD" => 3.2 * atrValue,
"GBPJPY" => 3.0 * atrValue,
=> 2.5 * atrValue
atrTP = switch syminfo.ticker
"EURUSD" => 3.8 * atrValue,
"USDJPY" => 3.5 * atrValue,
"GBPUSD" => 4.0 * atrValue,
"AUDUSD" => 4.0 * atrValue,
"GBPJPY" => 5.0 * atrValue,
=> 3.5 * atrValue
// **Ensure Trade Size is Not Zero**
riskPerTrade = 2
accountSize = strategy.equity
tradeSize = (accountSize * (riskPerTrade / 100)) / atrSL
tradeSize := tradeSize < 1 ? 1 : tradeSize // Minimum lot size of 1
// **Buy/Sell Conditions (Now More Trades Will Trigger)**
buyCondition = ta.crossover(shortEMA, longEMA) and rsiFilterBuy and close > refEMA and close > longEMA and isTrending and emaSlope and allowTrade and dailyTradeCount < 1
sellCondition = ta.crossunder(shortEMA, longEMA) and rsiFilterSell and close < refEMA and close < longEMA and isTrending and emaSlopeSell and allowTrade and dailyTradeCount < 1
// **Execute Trades**
if buyCondition
strategy.entry("Buy", strategy.long, qty=tradeSize)
strategy.exit("Take Profit/Stop Loss", from_entry="Buy", limit=close + atrTP, stop=close - atrSL)
label.new(x=bar_index, y=low, text="BUY", color=color.green, textcolor=color.white, size=size.small, style=label.style_label_down)
alert("BUY", alert.freq_once_per_bar_close)
dailyTradeCount := dailyTradeCount + 1
if sellCondition
strategy.entry("Sell", strategy.short, qty=tradeSize)
strategy.exit("Take Profit/Stop Loss", from_entry="Sell", limit=close - atrTP, stop=close + atrSL)
label.new(x=bar_index, y=high, text="SELL", color=color.red, textcolor=color.white, size=size.small, style=label.style_label_up)
alert("SELL", alert.freq_once_per_bar_close)
dailyTradeCount := dailyTradeCount + 1
// **Plot Indicators**
plot(shortEMA, color=color.yellow, title="9 EMA")
plot(longEMA, color=color.fuchsia, title="20 EMA")
plot(refEMA, color=color.blue, title="50 EMA")