
یہ حکمت عملی ایک ذہین تجارتی نظام ہے جو قیمتوں میں اتار چڑھاؤ کی چوٹیوں کی شناخت پر مبنی ہے۔ حکمت عملی 1 گھنٹے کے لکیری چارٹ پر قیمتوں میں اتار چڑھاؤ کی نگرانی کرکے ٹریڈنگ سگنل کو متحرک کرتی ہے جب کوئی نمایاں طور پر اوپر یا نیچے کی چوٹی ہوتی ہے۔ یہ نظام 30,000،XNUMX امریکی ڈالر کی ایک مقررہ سرمایہ کاری کی رقم کو اپناتا ہے اور خود بخود موجودہ مارکیٹ کی قیمتوں پر مبنی تجارت کی تعداد کا حساب لگاتا ہے تاکہ فنڈز کی زیادہ سے زیادہ تشکیل کی جاسکے۔
اس حکمت عملی کا مرکز detect_spike فنکشن کے ذریعہ قیمت میں اتار چڑھاؤ کی چوٹیوں کی نشاندہی کرنا ہے۔ جب قیمت میں 0.62٪ سے زیادہ کا اتار چڑھاؤ ہوتا ہے تو ، نظام کو ایک موثر تجارتی سگنل قرار دیا جاتا ہے۔ اس میں شامل ہیں:
اس حکمت عملی میں سخت ریاضیاتی ماڈل کے ذریعہ مارکیٹ کے مواقع کی نشاندہی کی گئی ہے ، جس میں ایک مکمل رسک کنٹرول سسٹم کے ساتھ مل کر ، ٹھوس تجارتی منافع حاصل کیا گیا ہے۔ اس حکمت عملی میں اچھی توسیع اور اصلاح کی گنجائش ہے ، جو مسلسل بہتری کے ذریعہ مختلف مارکیٹ کے حالات کے مطابق ڈھال سکتی ہے ، یہ ایک قابل قدر تجارتی حکمت عملی ہے۔
/*backtest
start: 2024-11-08 00:00:00
end: 2025-02-18 08:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Spike Strategy 1h Optimized", overlay=true, margin_long=100, margin_short=100, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Fixed investment amount per trade (30,000 USDT)
fixed_investment = 30000
// Optimized parameters
spike_threshold = 0.62 // Spike threshold (0.80%)
profit_target = 0.42 // Take profit (0.48%)
stop_loss = 1 // Stop loss (10%)
// Function to detect spikes
detect_spike(threshold, close_price, high_price, low_price) =>
spike_up = (high_price - close_price) / close_price >= threshold / 100 // Bullish spike (high - close)
spike_down = (close_price - low_price) / close_price >= threshold / 100 // Bearish spike (close - low)
[spike_up, spike_down]
// Detecting spikes
[spike_up, spike_down] = request.security(syminfo.tickerid, "60", detect_spike(spike_threshold, close, high, low))
// Entry conditions
long_condition = spike_up and not spike_down // Only bullish spikes
short_condition = spike_down and not spike_up // Only bearish spikes
// Calculate the quantity to invest based on the current price
qty_long = fixed_investment / close
qty_short = fixed_investment / close
// Executing the orders
if (long_condition)
strategy.entry("Long", strategy.long, qty=qty_long)
if (short_condition)
strategy.entry("Short", strategy.short, qty=qty_short)
// Exiting orders with take profit and stop loss
if (strategy.position_size > 0)
strategy.exit("Take Profit Long", "Long", limit=strategy.position_avg_price * (1 + profit_target / 100), stop=strategy.position_avg_price * (1 - stop_loss / 100))
if (strategy.position_size < 0)
strategy.exit("Take Profit Short", "Short", limit=strategy.position_avg_price * (1 - profit_target / 100), stop=strategy.position_avg_price * (1 + stop_loss / 100))
// Plot spikes (optional)
plotshape(series=long_condition, title="Long Spike", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=short_condition, title="Short Spike", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")