یوٹیوب ویٹرنز کی جانب سے "جادوئی ڈبل ای ایم اے حکمت عملی"

مصنف:لیدیہ, تخلیق: 2022-11-07 12:02:31, تازہ کاری: 2023-09-15 20:51:23

img

یوٹیوب کے سابق فوجیوں کی جادوئی ڈبل ای ایم اے حکمت عملی

اس شمارے میں ، ہم یوٹیوب سے جادوئی ڈبل ای ایم اے حکمت عملی پر تبادلہ خیال کرنے جارہے ہیں ، جسے اسٹاک اور کریپٹوکرنسی مارکیٹ کا قاتل کہا جاتا ہے۔ میں نے ویڈیو دیکھی اور سیکھا کہ یہ حکمت عملی ایک تجارتی نقطہ نظر پائن زبان کی حکمت عملی ہے جو 2 تجارتی نقطہ نظر کے اشارے استعمال کرتی ہے۔ ویڈیو میں بیک ٹیسٹنگ کا اثر بہت اچھا ہے ، اور ایف ایم زیڈ بھی ٹریڈنگ ویو کی پائن زبان کی حمایت کرتا ہے ، لہذا میں مدد نہیں کرسکتا لیکن خود ہی بیک ٹیسٹ اور تجزیہ کرنا چاہتا ہوں۔ تو آئیے کام شروع کریں! آئیے ویڈیو میں حکمت عملی کی نقل کریں۔

حکمت عملی میں استعمال ہونے والے اشارے

  1. ای ایم اے اشارے

ڈیزائن سادگی کی خاطر، ہم ویڈیو میں درج چلتی اوسط exponential استعمال نہیں کریں گے، ہم اس کی بجائے ٹریڈنگ نقطہ نظر کے بلٹ میں ta.ema استعمال کریں گے (یہ اصل میں ایک ہی ہے).

  1. VuManChu سوئنگ فری اشارے

یہ ٹریڈنگ ویو پر ایک اشارے ہے، ہم ٹریڈنگ ویو پر جانے اور ماخذ کوڈ لینے کی ضرورت ہے.

img

VuManChu سوئنگ فری کا کوڈ:

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

// Credits to the original Script - Range Filter DonovanWall https://www.tradingview.com/script/lut7sBgG-Range-Filter-DW/
// This version is the old version of the Range Filter with less settings to tinker with

//@version=4
study(title="Range Filter - B&S Signals", shorttitle="RF - B&S Signals", overlay=true)

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Functions
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Range Size Function
rng_size(x, qty, n)=> 
//    AC       = Cond_EMA(abs(x - x[1]), 1, n)
    wper      = (n*2) - 1
    avrng     = ema(abs(x - x[1]), n)
    AC = ema(avrng, wper)*qty
    rng_size = AC

//Range Filter Function
rng_filt(x, rng_, n)=>
    r          = rng_
    var rfilt  = array.new_float(2, x)
    array.set(rfilt, 1, array.get(rfilt, 0))
    if x - r > array.get(rfilt, 1)
        array.set(rfilt, 0, x - r)
    if x + r < array.get(rfilt, 1)
        array.set(rfilt, 0, x + r)
    rng_filt1 = array.get(rfilt, 0)
    
    hi_band   = rng_filt1 + r
    lo_band   = rng_filt1 - r
    rng_filt  = rng_filt1
    [hi_band, lo_band, rng_filt]
 
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Inputs
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Range Source
rng_src = input(defval=close, type=input.source, title="Swing Source")

//Range Period
rng_per = input(defval=20, minval=1, title="Swing Period")

//Range Size Inputs
rng_qty   = input(defval=3.5, minval=0.0000001, title="Swing Multiplier")

//Bar Colors
use_barcolor = input(defval=false, type=input.bool, title="Bar Colors On/Off")

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Definitions
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Range Filter Values
[h_band, l_band, filt] = rng_filt(rng_src, rng_size(rng_src, rng_qty, rng_per), rng_per)

//Direction Conditions
var fdir = 0.0
fdir    := filt > filt[1] ? 1 : filt < filt[1] ? -1 : fdir
upward   = fdir==1 ? 1 : 0
downward = fdir==-1 ? 1 : 0

//Trading Condition
longCond = rng_src > filt and rng_src > rng_src[1] and upward > 0 or rng_src > filt and rng_src < rng_src[1] and upward > 0 
shortCond = rng_src < filt and rng_src < rng_src[1] and downward > 0 or rng_src < filt and rng_src > rng_src[1] and downward > 0

CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1

//Colors
filt_color = upward ? #05ff9b : downward ? #ff0583 : #cccccc
bar_color  = upward and (rng_src > filt) ? (rng_src > rng_src[1] ? #05ff9b : #00b36b) :
             downward and (rng_src < filt) ? (rng_src < rng_src[1] ? #ff0583 : #b8005d) : #cccccc

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Outputs
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Filter Plot
filt_plot = plot(filt, color=filt_color, transp=67, linewidth=3, title="Filter")

//Band Plots
h_band_plot = plot(h_band, color=color.new(#05ff9b, 100), title="High Band")
l_band_plot = plot(l_band, color=color.new(#ff0583, 100), title="Low Band")

//Band Fills
fill(h_band_plot, filt_plot, color=color.new(#00b36b, 92), title="High Band Fill")
fill(l_band_plot, filt_plot, color=color.new(#b8005d, 92), title="Low Band Fill")

//Bar Color
barcolor(use_barcolor ? bar_color : na)

//Plot Buy and Sell Labels
plotshape(longCondition, title = "Buy Signal", text ="BUY", textcolor = color.white, style=shape.labelup, size = size.normal, location=location.belowbar, color = color.new(color.green, 0))
plotshape(shortCondition, title = "Sell Signal", text ="SELL", textcolor = color.white, style=shape.labeldown, size = size.normal, location=location.abovebar, color = color.new(color.red, 0))

//Alerts
alertcondition(longCondition, title="Buy Alert", message = "BUY")
alertcondition(shortCondition, title="Sell Alert", message = "SELL")

حکمت عملی منطق

ای ایم اے اشارے: حکمت عملی میں دو ای ایم اے استعمال کیے جاتے ہیں ، ایک تیز لائن (چھوٹی مدت کا پیرامیٹر) اور دوسرا سست لائن (بڑی مدت کا پیرامیٹر) ہے۔ ڈبل ای ایم اے چلتی اوسط کا مقصد بنیادی طور پر ہمیں مارکیٹ کے رجحان کی سمت کا تعین کرنے میں مدد فراہم کرنا ہے۔

  • لمبی پوزیشن کا انتظام تیز رفتار لائن سست لائن کے اوپر ہے.

  • مختصر پوزیشن کا انتظام تیز رفتار لائن سست لائن کے نیچے ہے.

VuManChu سوئنگ فری اشارے: VuManChu سوئنگ فری اشارے کا استعمال سگنل بھیجنے اور فیصلہ کرنے کے لئے کیا جاتا ہے کہ آیا کسی آرڈر کو دیگر شرائط کے ساتھ مل کر رکھا جائے۔ یہ VuManChu سوئنگ فری اشارے کے سورس کوڈ سے دیکھا جاسکتا ہے کہ لانگ کنڈیشن متغیر خریدنے کے سگنل کی نمائندگی کرتا ہے اور شارٹ کنڈیشن متغیر فروخت سگنل کی نمائندگی کرتا ہے۔ یہ دونوں متغیرات آرڈر دینے کی شرائط کی بعد میں تحریر کے لئے استعمال ہوں گے۔

اب آئیے ٹریڈنگ سگنل کے مخصوص ٹرگر حالات کے بارے میں بات کرتے ہیں:

  1. طویل پوزیشن میں داخل ہونے کے قواعد: مثبت K لائن کی بندش کی قیمت EMA کی تیز لائن سے اوپر ہونی چاہئے ، دونوں EMAs ایک طویل پوزیشن ہونی چاہئے (سست لائن سے اوپر تیز لائن) ، اور VuManChu سوئنگ فری اشارے کو خرید کا اشارہ دکھانا چاہئے (longCondition درست ہے) ۔ اگر تینوں شرائط پوری ہوجاتی ہیں تو ، یہ K لائن طویل پوزیشن میں داخل ہونے کے لئے کلیدی K لائن ہے ، اور اس K لائن کی بندش کی قیمت انٹری پوزیشن ہے۔

  2. مختصر پوزیشن میں داخل ہونے کے قواعد (لانگ پوزیشن کے برعکس): منفی K لائن کی بندش کی قیمت EMA کی تیز لائن سے نیچے ہونی چاہئے ، دونوں EMAs ایک مختصر پوزیشن ہونی چاہئے (سست لائن سے نیچے تیز لائن) ، اور VuManChu سوئنگ فری اشارے کو فروخت کا اشارہ دکھانا چاہئے (shortCondition درست ہے) ۔ اگر تینوں شرائط پوری ہو جاتی ہیں تو ، K لائن کی بندش کی قیمت مختصر انٹری پوزیشن ہے۔

کیا تجارتی منطق بہت آسان ہے؟ چونکہ ماخذ ویڈیو میں منافع کی روک تھام اور نقصان کی روک تھام کی وضاحت نہیں کی گئی ہے ، لہذا میں اعتدال پسند منافع کی روک تھام اور نقصان کی روک تھام کا طریقہ آزادانہ طور پر استعمال کروں گا ، نقصان کو روکنے کے لئے فکسڈ پوائنٹس کا استعمال کروں گا ، اور منافع کی روک تھام کو ٹریک کروں گا۔

کوڈ کا ڈیزائن

VuManChu سوئنگ فری اشارے کے لئے کوڈ، ہم کسی بھی تبدیلی کے بغیر براہ راست ہماری حکمت عملی کوڈ میں ڈال دیا.

img

پھر فوری طور پر اس کے بعد، ہم پائن زبان کا ایک ٹکڑا لکھتے ہیں جو تجارتی فنکشن کو لاگو کرتا ہے:

// extend
fastEmaPeriod = input(50, "fastEmaPeriod")         // fast line period
slowEmaPeriod = input(200, "slowEmaPeriod")        // slow line period
loss = input(30, "loss")                           // stop loss points
trailPoints = input(30, "trailPoints")             // number of trigger points for moving stop loss
trailOffset = input(30, "trailOffset")             // moving stop profit offset (points)
amount = input(1, "amount")                        // order amount

emaFast = ta.ema(close, fastEmaPeriod)             // calculate the fast line EMA
emaSlow = ta.ema(close, slowEmaPeriod)             // calculate the slow line EMA

buyCondition = longCondition and emaFast > emaSlow and close > open and close > emaFast         // entry conditions for long positions
sellCondition = shortCondition and emaFast < emaSlow and close < open and close < emaFast       // entry conditions for short positions

if buyCondition and strategy.position_size == 0
    strategy.entry("long", strategy.long, amount)
    strategy.exit("exit_long", "long", amount, loss=loss, trail_points=trailPoints, trail_offset=trailOffset)
if sellCondition and strategy.position_size == 0
    strategy.entry("short", strategy.short, amount)
    strategy.exit("exit_short", "short", amount, loss=loss, trail_points=trailPoints, trail_offset=trailOffset)

A.Itدیکھا جا سکتا ہے کہ جب buyCondition سچ ہے، یعنی:

  1. متغیر longCondition درست ہے (VuManChu سوئنگ فری اشارے ایک طویل پوزیشن سگنل بھیجتا ہے).
  2. emaFast > emaSlow (EMA طویل پوزیشن سیدھ) ۔
  3. close > open (موجودہ BAR مثبت ہے) ، close > emaFast (کلوزنگ قیمت EMA فاسٹ لائن سے اوپر ہے) ۔

طویل عرصے تک جانے کے لیے تین شرائط۔

B.جب sellCondition درست ہے تو ، مختصر پوزیشن بنانے کے لئے تین شرائط برقرار ہیں (یہاں دہرائے نہیں گئے ہیں) ۔

پھر ہم استعمال کرتے ہیں strategy.entry تقریب میں داخل ہونے اور ایک پوزیشن کھولنے کے لئے اگر حالت فیصلے سگنل ٹرگر کی صورت میں، اور مقررstrategy.exitایک ہی وقت میں نقصان کو روکنے اور ٹریل منافع کے لئے تقریب.

مکمل کوڈ

/*backtest
start: 2022-01-01 00:00:00
end: 2022-10-08 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
args: [["ZPrecision",0,358374]]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

// Credits to the original Script - Range Filter DonovanWall https://www.tradingview.com/script/lut7sBgG-Range-Filter-DW/
// This version is the old version of the Range Filter with less settings to tinker with

//@version=4
study(title="Range Filter - B&S Signals", shorttitle="RF - B&S Signals", overlay=true)

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Functions
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Range Size Function
rng_size(x, qty, n)=> 
//    AC       = Cond_EMA(abs(x - x[1]), 1, n)
    wper      = (n*2) - 1
    avrng     = ema(abs(x - x[1]), n)
    AC = ema(avrng, wper)*qty
    rng_size = AC

//Range Filter Function
rng_filt(x, rng_, n)=>
    r          = rng_
    var rfilt  = array.new_float(2, x)
    array.set(rfilt, 1, array.get(rfilt, 0))
    if x - r > array.get(rfilt, 1)
        array.set(rfilt, 0, x - r)
    if x + r < array.get(rfilt, 1)
        array.set(rfilt, 0, x + r)
    rng_filt1 = array.get(rfilt, 0)
    
    hi_band   = rng_filt1 + r
    lo_band   = rng_filt1 - r
    rng_filt  = rng_filt1
    [hi_band, lo_band, rng_filt]
 
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Inputs
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Range Source
rng_src = input(defval=close, type=input.source, title="Swing Source")

//Range Period
rng_per = input(defval=20, minval=1, title="Swing Period")

//Range Size Inputs
rng_qty   = input(defval=3.5, minval=0.0000001, title="Swing Multiplier")

//Bar Colors
use_barcolor = input(defval=false, type=input.bool, title="Bar Colors On/Off")

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Definitions
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Range Filter Values
[h_band, l_band, filt] = rng_filt(rng_src, rng_size(rng_src, rng_qty, rng_per), rng_per)

//Direction Conditions
var fdir = 0.0
fdir    := filt > filt[1] ? 1 : filt < filt[1] ? -1 : fdir
upward   = fdir==1 ? 1 : 0
downward = fdir==-1 ? 1 : 0

//Trading Condition
longCond = rng_src > filt and rng_src > rng_src[1] and upward > 0 or rng_src > filt and rng_src < rng_src[1] and upward > 0 
shortCond = rng_src < filt and rng_src < rng_src[1] and downward > 0 or rng_src < filt and rng_src > rng_src[1] and downward > 0

CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1

//Colors
filt_color = upward ? #05ff9b : downward ? #ff0583 : #cccccc
bar_color  = upward and (rng_src > filt) ? (rng_src > rng_src[1] ? #05ff9b : #00b36b) :
             downward and (rng_src < filt) ? (rng_src < rng_src[1] ? #ff0583 : #b8005d) : #cccccc

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Outputs
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Filter Plot
filt_plot = plot(filt, color=filt_color, transp=67, linewidth=3, title="Filter")

//Band Plots
h_band_plot = plot(h_band, color=color.new(#05ff9b, 100), title="High Band")
l_band_plot = plot(l_band, color=color.new(#ff0583, 100), title="Low Band")

//Band Fills
fill(h_band_plot, filt_plot, color=color.new(#00b36b, 92), title="High Band Fill")
fill(l_band_plot, filt_plot, color=color.new(#b8005d, 92), title="Low Band Fill")

//Bar Color
barcolor(use_barcolor ? bar_color : na)

//Plot Buy and Sell Labels
plotshape(longCondition, title = "Buy Signal", text ="BUY", textcolor = color.white, style=shape.labelup, size = size.normal, location=location.belowbar, color = color.new(color.green, 0))
plotshape(shortCondition, title = "Sell Signal", text ="SELL", textcolor = color.white, style=shape.labeldown, size = size.normal, location=location.abovebar, color = color.new(color.red, 0))

//Alerts
alertcondition(longCondition, title="Buy Alert", message = "BUY")
alertcondition(shortCondition, title="Sell Alert", message = "SELL")


// extend
fastEmaPeriod = input(50, "fastEmaPeriod")
slowEmaPeriod = input(200, "slowEmaPeriod")
loss = input(30, "loss")
trailPoints = input(30, "trailPoints")
trailOffset = input(30, "trailOffset")
amount = input(1, "amount")

emaFast = ta.ema(close, fastEmaPeriod)
emaSlow = ta.ema(close, slowEmaPeriod)

buyCondition = longCondition and emaFast > emaSlow and close > open and close > emaFast
sellCondition = shortCondition and emaFast < emaSlow and close < open and close < emaFast

if buyCondition and strategy.position_size == 0
    strategy.entry("long", strategy.long, amount)
    strategy.exit("exit_long", "long", amount, loss=loss, trail_points=trailPoints, trail_offset=trailOffset)
if sellCondition and strategy.position_size == 0
    strategy.entry("short", strategy.short, amount)
    strategy.exit("exit_short", "short", amount, loss=loss, trail_points=trailPoints, trail_offset=trailOffset)

بیک ٹیسٹ

بیک ٹیسٹ کا وقت جنوری 2022 سے اکتوبر 2022 تک ہے۔ کے لائن کی مدت 15 منٹ ہے اور بیک ٹیسٹ کے لئے اختتامی قیمت کا ماڈل استعمال کیا جاتا ہے۔ مارکیٹ بائننس ETH_USDT دائمی معاہدے کا انتخاب کرتی ہے۔ پیرامیٹرز ماخذ ویڈیو میں تیز لائن کی 50 مدت اور سست لائن کی 200 مدت کے مطابق مقرر کیے گئے ہیں۔ دیگر پیرامیٹرز ڈیفالٹ کے مطابق تبدیل نہیں ہوتے ہیں۔ میں اسٹاپ نقصان اور ٹریکنگ اسٹاپ منافع کے پوائنٹس کو 30 پوائنٹس تک ذہنی طور پر مقرر کرتا ہوں۔

img

img

img

بیک ٹسٹنگ کے نتائج معمول کے مطابق ہیں ، اور ایسا لگتا ہے کہ اسٹاپ نقصان کے پیرامیٹرز کا بیک ٹسٹنگ کے نتائج پر کچھ اثر پڑتا ہے۔ مجھے لگتا ہے کہ اس پہلو کو ابھی بھی بہتر بنانے اور ڈیزائن کرنے کی ضرورت ہے۔ تاہم ، اسٹریٹجک سگنل ٹریڈنگ کو متحرک کرنے کے بعد ، جیت کی شرح اب بھی ٹھیک ہے۔

آئیے ایک مختلف BTC_USDT دائمی معاہدہ آزمائیں:

img

بی ٹی سی پر بیک ٹیسٹ کا نتیجہ بھی بہت منافع بخش تھا:

img

img

حکمت عملی:https://www.fmz.com/strategy/385745

ایسا لگتا ہے کہ یہ تجارتی طریقہ رجحان کو سمجھنے کے لئے نسبتا reliable قابل اعتماد ہے ، آپ اس خیال کے مطابق ڈیزائن کو بہتر بنانا جاری رکھ سکتے ہیں۔ اس مضمون میں ، ہم نے نہ صرف ڈبل موونگ ایوریج حکمت عملی کے خیال کے بارے میں سیکھا ، بلکہ یوٹیوب پر تجربہ کاروں کی حکمت عملی پر کارروائی اور سیکھنے کا طریقہ بھی سیکھا۔ ٹھیک ہے ، مذکورہ بالا حکمت عملی کا کوڈ صرف میرا اینٹوں اور مارٹر ہے ، بیک ٹیسٹ کے نتائج مخصوص اصلی بوٹ کے نتائج کی نمائندگی نہیں کرتے ہیں ، حکمت عملی کا کوڈ ، ڈیزائن صرف حوالہ کے لئے ہے۔ آپ کی حمایت کے لئے شکریہ ، ہم آپ کو اگلی بار دیکھیں گے!


متعلقہ

مزید