
حکمت عملی ایک اعلی درجے کی رجحان کی پیروی کرنے والا تجارتی نظام ہے جو Supertrend اشارے پر مبنی ہے، جس میں متعدد سگنل کی تصدیق کے طریقہ کار اور متحرک پوزیشن مینجمنٹ کو ملایا جاتا ہے۔ حکمت عملی کا بنیادی مقصد ATR (اوسط حقیقی رینج) کے ذریعے سپر ٹرینڈ لائن کا حساب لگانا ہے، اور قیمت کے رجحانات اور ہولڈنگ ٹائم ونڈو کو یکجا کرنا ہے تاکہ مارکیٹ کے رجحانات کی ذہین گرفت حاصل کرنے کے لیے تجارتی سگنلز پیدا کیے جا سکیں۔
حکمت عملی تین پرتوں والے سگنل فلٹرنگ میکانزم کا استعمال کرتی ہے:
کیپٹل مینجمنٹ کے لحاظ سے، حکمت عملی اکائونٹ ایکویٹی کا 15% استعمال کرتی ہے کیونکہ یہ قدامت پسند پوزیشن کنٹرول رسک مینجمنٹ میں مدد کرتا ہے۔
یہ ایک مکمل ڈھانچہ اور سخت منطق کے ساتھ ٹرینڈ ٹریکنگ کی حکمت عملی ہے جس میں متعدد سگنل کنفرمیشن میکانزم اور ایک مکمل رسک مینجمنٹ سسٹم کے ذریعے استعمال کی اچھی قدر ہے۔ حکمت عملی انتہائی قابل توسیع ہے، اور تجویز کردہ اصلاحی ہدایات کے ذریعے اس کے استحکام اور منافع کو مزید بہتر بنایا جا سکتا ہے۔
/*backtest
start: 2024-12-06 00:00:00
end: 2025-01-04 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Supertrend Strategy", overlay=true)
atrPeriod = input(10, "ATR Length")
factor = input.float(3.0, "Factor", step=0.01)
// Compute supertrend values
[supertrendValue, supertrendDirection] = ta.supertrend(factor, atrPeriod)
var float direction = na
if not na(supertrendDirection[1]) and supertrendDirection[1] != supertrendDirection
direction := supertrendDirection > 0 ? 1 : -1
// Variables to track conditions
var int lastShortTime = na
var int lastLongTime = na
// Detecting short and long entries
if direction == -1
strategy.entry("My Short Entry Id", strategy.short)
lastShortTime := bar_index
if direction == 1
strategy.entry("My Long Entry Id", strategy.long)
lastLongTime := bar_index
// Custom signal logic
bool bullishSignal = false
bool bearishSignal = false
// Define bullish signal conditions
if not na(lastShortTime) and (bar_index - lastShortTime >= 15 and bar_index - lastShortTime <= 19)
if close > open and close[1] > open[1] and close[2] > open[2]
bullishSignal := true
// Define bearish signal conditions
if not na(lastLongTime) and (bar_index - lastLongTime >= 15 and bar_index - lastLongTime <= 19)
if close < open and close[1] < open[1] and close[2] < open[2]
bearishSignal := true
// Plot signals
if bullishSignal
strategy.entry("Bullish Upward Signal", strategy.long)
label.new(bar_index, close, text="Bullish", style=label.style_circle, color=color.green, textcolor=color.white)
if bearishSignal
strategy.entry("Bearish Downward Signal", strategy.short)
label.new(bar_index, close, text="Bearish", style=label.style_circle, color=color.red, textcolor=color.white)
// Optionally plot the strategy equity
//plot(strategy.equity, title="Equity", color=color.red, linewidth=2, style=plot.style_areabr)