
یہ ایک مقداری تجارتی حکمت عملی ہے جو اوسط رجحان اشارے ((ADX) اور قیمت کے وقفے پر مبنی ہے۔ یہ حکمت عملی بنیادی طور پر مارکیٹ کے رجحان کی طاقت کا اندازہ لگانے کے لئے ADX اشارے کی تعداد کی نگرانی کرتی ہے ، اور مارکیٹ کی نقل و حرکت کو پکڑنے کے لئے قیمت کے وقفے کے اشارے کے ساتھ ملتی ہے۔ حکمت عملی کو ایک مخصوص تجارتی وقت کے اندر کام کرنے کے لئے ترتیب دیا گیا ہے ، اور اس میں نقصانات کو روکنے اور روزانہ تجارت کی تعداد کو محدود کرکے خطرے کا انتظام کیا گیا ہے۔
حکمت عملی کی بنیادی منطق میں درج ذیل کلیدی عناصر شامل ہیں:
یہ ایک منظم ، منطقی اور واضح رجحان کی پیروی کی حکمت عملی ہے۔ ADX اشارے کو قیمتوں میں اضافے کے ساتھ جوڑ کر ، مارکیٹ میں رجحان کے مواقع کو موثر رسک مینجمنٹ فریم ورک کے تحت پکڑنا ہے۔ اگرچہ کچھ اصلاحات کی گنجائش موجود ہے ، لیکن حکمت عملی کا بنیادی فریم ورک مضبوط ہے ، جو ایک مقداری تجارتی نظام کے بنیادی اجزاء کے لئے موزوں ہے۔
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 00:00:00
period: 1d
basePeriod: 1d
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/
// © HuntGatherTrade
// ========================
// NQ 30 minute, ES 30 minute
//@version=5
strategy("ADX Breakout", overlay=false, initial_capital=25000, default_qty_value=1)
// ===============================
// Input parameters
// ===============================
stopLoss = input(1000.0, title="Stop Loss ($)", group="Exits")
session = input("0730-1430:1234567", group="Trade Session")
highestLB = input(34, title="Highest lookback window", group="Indicator values")
// ===============================
// Trade Session Handling
// ===============================
t = time(timeframe.period, session)
// Reset numTrades at the start of each session
var int numTrades = 0
is_new_session = ta.change(time("D")) != 0
if is_new_session
numTrades := 0
// ===============================
// Entry Conditions
// ===============================
[plusDI, minusDI, adxValue] = ta.dmi(50, 14)
entryCondition = (close >= ta.highest(close, highestLB)[1]) and (adxValue < 17.5) and (strategy.position_size == 0) and (numTrades < 3) and not na(t)
// ===============================
// 7. Execute Entry
// ===============================
var float stopPricePlot = na
if entryCondition
entryPrice = close + syminfo.mintick
strategy.entry("Long Entry", strategy.long, stop=entryPrice)
//stopPrice = strategy.position_avg_price - (stopLoss / syminfo.pointvalue)
//strategy.exit("Stop Loss", "Long Entry", stop=stopPrice)
numTrades += 1
if (strategy.position_size > 0) and (strategy.position_size[1] == 0)
stopPoints = stopLoss / syminfo.pointvalue
stopPrice = strategy.position_avg_price - stopPoints
stopPrice := math.round(stopPrice / syminfo.mintick) * syminfo.mintick
strategy.exit("Stop Loss", from_entry="Long Entry", stop=stopPrice)
if ta.change(strategy.opentrades) == 1
float entryPrice = strategy.opentrades.entry_price(0)
stopPricePlot := entryPrice - (stopLoss / syminfo.pointvalue)
if ta.change(strategy.closedtrades) == 1
stopPricePlot := na
plot(stopPricePlot, "Stop-loss level", color.red, 1, plot.style_linebr)
// ===============================
// Exit at End of Session
// ===============================
if na(t) and strategy.position_size != 0
strategy.close_all(comment="End of Day Exit")