
یہ حکمت عملی دو طرفہ حرکیات کے اشاریہ DI+، DI- اور اوسط سمت اشاریہ ADX کے حساب سے ، اشاریہ کی حرکت پذیری اوسط EMA کے ساتھ مل کر ٹریڈنگ سگنل پیدا کرتی ہے۔ جب DI+ پر DI- اور ADX 20 سے زیادہ ہوتا ہے تو خریدنے کا سگنل پیدا ہوتا ہے۔ جب DI- کے نیچے DI+ اور ADX 25 سے زیادہ ہوتا ہے تو فروخت کا سگنل پیدا ہوتا ہے۔ ٹریڈنگ اسٹاپ نقصان کا سگنل DI- پر DI+ اور ADX 30 سے زیادہ ہوتا ہے۔
ڈی آئی + ، ڈی آئی - ، ADX کا حساب لگائیں
EMA کے حساب سے
ٹریڈنگ سگنل کی تخلیق
تجارت بند کرو
مجموعی طور پر ، اس حکمت عملی میں متحرک اشارے اور رجحان اشارے شامل ہیں ، جب قیمت میں رجحان کی شدت ہوتی ہے تو تجارتی سگنل پیدا ہوتا ہے۔ اس کے ساتھ ہی نقصان کو محدود کرنے کے لئے اسٹاپ نقصان کی شرائط بھی رکھی جاتی ہیں۔
اسٹاپ نقصان کی حد کو بڑھا کر ، پیرامیٹرز کے مجموعے کو ایڈجسٹ کرکے ، یا اضافی فلٹرنگ شرائط شامل کرکے تجارت کی فریکوئنسی کو بہتر بنانا۔
اس حکمت عملی میں حرکیات کے اشارے اور رجحان تجزیہ کے اشارے کو مربوط کیا گیا ہے ، جس سے قیمتوں میں رجحانات کی شدت کے دوران تجارتی سگنل پیدا ہوتے ہیں۔ سخت اسٹاپ ضوابط کا خطرہ کنٹرول کریں۔ اس حکمت عملی کی افادیت کو مزید بہتر بنانے کے لئے پیرامیٹرز کو بہتر بنانا ، سگنل فلٹرز کو شامل کرنا اور اسٹاپ نقصان کی حد کو مناسب طریقے سے بڑھانا پڑتا ہے۔
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 4h
basePeriod: 15m
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/
// © Tamil_FNO_Trader
//@version=5
strategy("Overlay Signals by TFOT", overlay=true)
// Calculate DMI
len = input.int(14, minval=1, title="DI Length")
lensig = input.int(14, title="ADX Smoothing", minval=1, maxval=50)
[diplus, diminus, adx] = ta.dmi(len, lensig)
// Get EMA
emalen = input.int(26, minval=1, title = "EMA Length")
emasrc = input.source(close, title = "EMA Source")
my_ema(src, length) =>
alpha = 2 / (length + 1)
sum = 0.0
sum := na(sum[1]) ? src : alpha * src + (1 - alpha) * nz(sum[1])
EMA2 = my_ema(emasrc, emalen)
// Variables
var bool buycondition1 = false
var bool sellcondition1 = false
var int firstbuybar = na
var int firstsellbar = na
var int buyexitbar = na
var int sellexitbar = na
var bool buyexit1 = false
var bool sellexit1 = false
// Buy & Sell Conditions
buycondition1 := (ta.crossover(diplus, diminus)) and (adx > 20) and (close > EMA2) and na(firstbuybar)
sellcondition1 := (ta.crossover(diminus, diplus)) and (adx > 25) and (close < EMA2) and na(firstsellbar)
buyexit1 := ta.crossover(diminus, diplus) and (adx > 30) and na(buyexitbar)
sellexit1 := ta.crossover(diplus, diminus) and (adx > 30) and na(sellexitbar)
if buycondition1
if(na(firstbuybar))
firstbuybar := bar_index
buyexitbar := na
firstsellbar := na
strategy.entry("Buy", strategy.long)
if sellcondition1
if(na(firstsellbar))
firstsellbar := bar_index
sellexitbar := na
firstbuybar := na
strategy.entry("Sell", strategy.short)
if buyexit1 and not na(firstbuybar)
if(na(buyexitbar))
buyexitbar := bar_index
firstbuybar := na
firstsellbar := na
strategy.close("Buy")
if sellexit1 and not na(firstsellbar)
if(na(sellexitbar))
sellexitbar := bar_index
firstsellbar := na
firstbuybar := na
strategy.close("Sell")
// Plot signals on chart
hl = input.bool(defval = true, title = "Signal Labels")
plotshape(hl and buycondition1 and bar_index == firstbuybar ? true : na, "Buy", style = shape.labelup, location = location.belowbar, color = color.green, text = "Buy", textcolor = color.white, size = size.tiny)
plotshape(hl and sellcondition1 and bar_index == firstsellbar ? true : na, "Sell", style = shape.labeldown, location = location.abovebar, color = color.red, text = "Sell", textcolor = color.white, size = size.tiny)
plotshape(hl and buyexit1 and bar_index == buyexitbar ? true : na, "Buy Exit", style = shape.labelup, location = location.belowbar, color = color.red, text = "Buy X", textcolor = color.white, size = size.tiny)
plotshape(hl and sellexit1 and bar_index == sellexitbar ? true : na, "Sell Exit", style = shape.labeldown, location = location.abovebar, color = color.red, text = "Sell X", textcolor = color.white, size = size.tiny)