
میڈین رجعت کی متحرک حکمت عملی ایک رجحان ٹریڈنگ حکمت عملی ہے جو مختصر مدت کی قیمتوں کی اوسط کو ٹریک کرتی ہے۔ یہ میڈین رجعت کے اشارے اور متحرک اشارے کو ملا کر مارکیٹ کے درمیانی مدت کے رجحان کا فیصلہ کرتی ہے۔
اس حکمت عملی میں پہلے قیمت کی میڈین ریگرینس لائن اور معیاری فرق کا حساب لگایا جاتا ہے۔ پھر اوپری حد اور کم حد کے پیرامیٹرز کے ساتھ اچھی طرح سے طے شدہ محور کو ملا کر ، یہ حساب لگایا جاتا ہے کہ آیا قیمت میڈین ریگرینس لائن سے ایک معیاری فرق کی حد سے باہر ہے۔ اگر اس سے زیادہ ہو تو ، ایک تجارتی سگنل پیدا ہوتا ہے۔
کثیر سر سگنل کے لئے ، قیمت اوسط واپسی لائن سے ایک معیاری فرق سے نیچے ، بند قیمت لمبائی کی مدت کے لئے SMA اوسط سے کم ، اور ٹرینڈ SMA اوسط سے زیادہ کی ضرورت ہوتی ہے ، ان تینوں شرائط کو پورا کرنے کے لئے کثیر جہتی پوزیشن کھولنے کی ضرورت ہے۔ بیج کی شرط قیمت پر لمبائی کی مدت کے لئے SMA اوسط ہے۔
خالی سر سگنل کے لئے ، قیمت اوسط واپسی لائن سے ایک معیاری فرق سے زیادہ ، بند قیمت LENGTH دورانیے کے لئے SMA اوسط سے زیادہ ، اور ٹرینڈ SMA اوسط سے کم ، ان تینوں شرائط کو پورا کرنے کے لئے ، خالی کرنے کی سمت میں پوزیشن کھولنے کی ضرورت ہے۔ بیج پوزیشن کی شرط قیمت کے نیچے LENGTH دورانیے کے لئے SMA اوسط ہے۔
اس حکمت عملی میں فی صد منافع کا ہدف اور فی صد سٹاپ نقصان کے ساتھ مل کر اسٹاپ نقصان کا انتظام ہوتا ہے۔
باہر نکلنے کے طریقوں میں سے ایک منتخب کیا جاسکتا ہے کہ وہ منتقل اوسط یا لکیری رجعت کو توڑنے کے لۓ ہے.
مارکیٹ کے وسط مدتی رجحانات کا اندازہ لگانے اور ان کا سراغ لگانے کے لئے کثیر فاریکس دو طرفہ تجارت ، رجحان فلٹرنگ ، اسٹاپ اسٹاپ نقصانات اور اسی طرح کے مجموعے کا استعمال کیا جاتا ہے۔
اوسط ریگریشن اشارے مؤثر طریقے سے قیمتوں کی قیمتوں کا تعین کرنے کے قابل ہے
اسمارٹ مارکیٹ کے شور کو فلٹر کرنے کے لئے متحرک SMA
کثیر جہتی دوطرفہ تجارت ، رجحانات کے مواقع کو بھرپور طریقے سے پکڑنے کے لئے
اسٹاپ نقصان کا طریقہ کار خطرے کو مؤثر طریقے سے کنٹرول کرتا ہے
مارکیٹ کے حالات کے مطابق اپنی مرضی کے مطابق باہر نکلنے کے اختیارات
مڈٹرم رجحانات کو بہتر طور پر پکڑنے کے لئے ایک مکمل رجحان ٹریڈنگ حکمت عملی
میڈین ریگریشن اشارے پیرامیٹر کی ترتیب کے لئے حساس ہے ، غلط حد بندی سے غلط سگنل پیدا ہوسکتے ہیں
بڑے زلزلے کے دوران نقصانات کی کثرت
ہلچل کے رجحان کے دوران ، تجارت کی کثرت زیادہ ہوسکتی ہے ، جس سے تجارت کی فیس اور اسکیلپنگ کا خطرہ بڑھ جاتا ہے
ٹریڈنگ کی اقسام میں کم لیکویڈیٹی کے ساتھ ، سلائڈ پوائنٹ کنٹرول غیر مناسب ہوسکتا ہے
کثیر فضائی دوطرفہ تجارت میں زیادہ خطرہ ہے اور احتیاط سے فنڈ مینجمنٹ کی ضرورت ہے
ان خطرات کو پیرامیٹرز کو بہتر بنانے، سٹاپ نقصان کو ایڈجسٹ کرنے اور فنڈ مینجمنٹ جیسے طریقوں سے کنٹرول کیا جاسکتا ہے۔
اوسط ریگریشن اور متحرک اشارے کے پیرامیٹرز کی ترتیب کو بہتر بنائیں تاکہ یہ مختلف اقسام کی خصوصیات کے مطابق ہو
رجحانات کی شناخت کے لئے رجحانات کی شناخت کے لئے بڑھتے ہوئے اشارے
نقصان کی روک تھام کی حکمت عملی کو بہتر بنانے کے لئے مارکیٹ میں بڑے پیمانے پر اتار چڑھاو کے لئے بہتر بنانے کے لئے
پوزیشن مینجمنٹ ماڈیول شامل کریں اور مارکیٹ کی شرائط کے مطابق پوزیشن کا سائز ایڈجسٹ کریں
مزید ونڈ کنٹرول ماڈیولز جیسے زیادہ سے زیادہ واپسی کنٹرول ، خالص قیمت وکر کنٹرول وغیرہ شامل کریں
حکمت عملی کے پیرامیٹرز کو خودکار طور پر بہتر بنانے کے لئے مشین لرننگ کے ساتھ مل کر غور کریں
خلاصہ یہ ہے کہ ، اوسط قیمت کی واپسی کی متحرک حکمت عملی ، ایک سادہ اور موثر اشارے کے ڈیزائن کے ذریعہ ، درمیانی مدت کے قدر کی واپسی کے رجحانات کو پکڑنے کے قابل ہے۔ حکمت عملی میں مضبوط موافقت اور عالمگیریت ہے ، لیکن اس میں کچھ خطرات بھی شامل ہیں۔ مسلسل اصلاح اور دیگر حکمت عملیوں کے امتزاج سے بہتر کارکردگی حاصل کی جاسکتی ہے۔ یہ حکمت عملی مجموعی طور پر مکمل ہے ، اور یہ ایک رجحان ٹریڈنگ کا طریقہ ہے جس پر غور کیا جانا چاہئے۔
/*backtest
start: 2023-10-15 00:00:00
end: 2023-11-14 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © GlobalMarketSignals
//@version=4
strategy("GMS: Mean Reversion Strategy", overlay=true)
LongShort = input(title="Long Only or Short Only or Both?", type=input.string, defval="Both", options=["Both", "Long Only", "Short Only"])
Lookback = input(title="Length", type=input.integer, defval=10, minval=0)
LThr1 = input(title="Upper threshold", type=input.float, defval=1, minval=0)
LThr = input(title="Lower threshold", type=input.float, defval=-1, maxval=0)
src = input(title="Source", type=input.source, defval=close)
LongShort2 = input(title="Linear Regression Exit or Moving Average Exit?", type=input.string, defval="MA", options=["LR", "MA"])
SMAlenL = input(title="MA/LR Exit Length", type = input.integer ,defval=10)
SMALen2 = input(title="Trend SMA Length", type = input.integer ,defval=200)
AboveBelow = input(title="Above or Below Trend SMA?", type=input.string, defval="Above", options=["Above", "Below", "Don't Include"])
PTbutton = input(title="Profit Target On/Off", type=input.bool, defval=true)
ProfitTarget = input(title="Profit Target %", type=input.float, defval=1, step=0.1, minval=0)
SLbutton = input(title="Stop Loss On/Off", type=input.bool, defval=true)
StopLoss = input(title="Stop Loss %", type=input.float, defval=-1, step=0.1, maxval=0)
x = (src-linreg(src,Lookback,0))/(stdev(src,Lookback))
plot(linreg(src,Lookback,0))
//PROFIT TARGET & STOPLOSS
if PTbutton == true and SLbutton == true
strategy.exit("EXIT", profit=((close*(ProfitTarget*0.01))/syminfo.mintick), loss=((close*(StopLoss*-0.01))/syminfo.mintick))
else
if PTbutton == true and SLbutton == false
strategy.exit("PT EXIT", profit=((close*(ProfitTarget*0.01))/syminfo.mintick))
else
if PTbutton == false and SLbutton == true
strategy.exit("SL EXIT", loss=((close*(StopLoss*-0.01))/syminfo.mintick))
else
strategy.cancel("PT EXIT")
////////////////////////
//MOVING AVERAGE EXIT//
//////////////////////
if LongShort=="Long Only" and AboveBelow=="Above" and LongShort2 =="MA"
strategy.entry("LONG", true, when = x<LThr and close<sma(close,SMAlenL) and close>sma(close,SMALen2))
strategy.close("LONG", when = close>sma(close,SMAlenL))
if LongShort=="Long Only" and AboveBelow=="Below" and LongShort2 =="MA"
strategy.entry("LONG", true, when = x<LThr and close<sma(close,SMAlenL) and close<sma(close,SMALen2))
strategy.close("LONG", when = close>sma(close,SMAlenL))
if LongShort=="Long Only" and AboveBelow=="Don't Include" and LongShort2 =="MA"
strategy.entry("LONG", true, when = x<LThr and close<sma(close,SMAlenL) )
strategy.close("LONG", when = close>sma(close,SMAlenL))
///////
if LongShort=="Short Only" and AboveBelow=="Above" and LongShort2 =="MA"
strategy.entry("SHORT", false, when = x>LThr1 and close>sma(close,SMAlenL) and close>sma(close,SMALen2))
strategy.close("SHORT", when = close<sma(close,SMAlenL))
if LongShort=="Short Only" and AboveBelow=="Below" and LongShort2 =="MA"
strategy.entry("SHORT", false, when = x>LThr1 and close>sma(close,SMAlenL) and close<sma(close,SMALen2))
strategy.close("SHORT", when = close<sma(close,SMAlenL))
if LongShort=="Short Only" and AboveBelow=="Don't Include" and LongShort2 =="MA"
strategy.entry("SHORT", false, when = x>LThr1 and close>sma(close,SMAlenL) )
strategy.close("SHORT", when = close<sma(close,SMAlenL))
//////
if LongShort=="Both" and AboveBelow=="Above" and LongShort2 =="MA"
strategy.entry("LONG", true, when = x<LThr and close<sma(close,SMAlenL) and close>sma(close,SMALen2))
strategy.close("LONG", when = close>sma(close,SMAlenL))
if LongShort=="Both" and AboveBelow=="Below" and LongShort2 =="MA"
strategy.entry("LONG", true, when = x<LThr and close<sma(close,SMAlenL) and close<sma(close,SMALen2))
strategy.close("LONG", when = close>sma(close,SMAlenL))
if LongShort=="Both" and AboveBelow=="Don't Include" and LongShort2 =="MA"
strategy.entry("LONG", true, when = x<LThr and close<sma(close,SMAlenL) )
strategy.close("LONG", when = close>sma(close,SMAlenL))
///////
if LongShort=="Both" and AboveBelow=="Above" and LongShort2 =="MA"
strategy.entry("SHORT", false, when = x>LThr1 and close>sma(close,SMAlenL) and close>sma(close,SMALen2))
strategy.close("SHORT", when = close<sma(close,SMAlenL))
if LongShort=="Both" and AboveBelow=="Below" and LongShort2 =="MA"
strategy.entry("SHORT", false, when = x>LThr1 and close>sma(close,SMAlenL) and close<sma(close,SMALen2))
strategy.close("SHORT", when = close<sma(close,SMAlenL))
if LongShort=="Both" and AboveBelow=="Don't Include" and LongShort2 =="MA"
strategy.entry("SHORT", false, when = x>LThr1 and close>sma(close,SMAlenL) )
strategy.close("SHORT", when = close<sma(close,SMAlenL))
/////////////////
//LIN REG EXIT//
///////////////
if LongShort=="Long Only" and AboveBelow=="Above" and LongShort2 =="LR"
strategy.entry("LONG", true, when = x<LThr and close<linreg(close,SMAlenL,0) and close>sma(close,SMALen2))
strategy.close("LONG", when = close>linreg(close,SMAlenL,0))
if LongShort=="Long Only" and AboveBelow=="Below" and LongShort2 =="LR"
strategy.entry("LONG", true, when = x<LThr and close<linreg(close,SMAlenL,0) and close<sma(close,SMALen2))
strategy.close("LONG", when = close>linreg(close,SMAlenL,0))
if LongShort=="Long Only" and AboveBelow=="Don't Include" and LongShort2 =="LR"
strategy.entry("LONG", true, when = x<LThr and close<linreg(close,SMAlenL,0) )
strategy.close("LONG", when = close>linreg(close,SMAlenL,0))
///////
if LongShort=="Short Only" and AboveBelow=="Above" and LongShort2 =="LR"
strategy.entry("SHORT", false, when = x>LThr1 and close>linreg(close,SMAlenL,0) and close>sma(close,SMALen2))
strategy.close("SHORT", when = close<linreg(close,SMAlenL,0))
if LongShort=="Short Only" and AboveBelow=="Below" and LongShort2 =="LR"
strategy.entry("SHORT", false, when = x>LThr1 and close>linreg(close,SMAlenL,0) and close<sma(close,SMALen2))
strategy.close("SHORT", when = close<linreg(close,SMAlenL,0))
if LongShort=="Short Only" and AboveBelow=="Don't Include" and LongShort2 =="LR"
strategy.entry("SHORT", false, when = x>LThr1 and close>linreg(close,SMAlenL,0) )
strategy.close("SHORT", when = close<linreg(close,SMAlenL,0))
//////
if LongShort=="Both" and AboveBelow=="Above" and LongShort2 =="LR"
strategy.entry("LONG", true, when = x<LThr and close<linreg(close,SMAlenL,0) and close>sma(close,SMALen2))
strategy.close("LONG", when = close>linreg(close,SMAlenL,0))
if LongShort=="Both" and AboveBelow=="Below" and LongShort2 =="LR"
strategy.entry("LONG", true, when = x<LThr and close<linreg(close,SMAlenL,0) and close<sma(close,SMALen2))
strategy.close("LONG", when = close>linreg(close,SMAlenL,0))
if LongShort=="Both" and AboveBelow=="Don't Include" and LongShort2 =="LR"
strategy.entry("LONG", true, when = x<LThr and close<linreg(close,SMAlenL,0) )
strategy.close("LONG", when = close>linreg(close,SMAlenL,0))
///////
if LongShort=="Both" and AboveBelow=="Above" and LongShort2 =="LR"
strategy.entry("SHORT", false, when = x>LThr1 and close>linreg(close,SMAlenL,0) and close>sma(close,SMALen2))
strategy.close("SHORT", when = close<linreg(close,SMAlenL,0))
if LongShort=="Both" and AboveBelow=="Below" and LongShort2 =="LR"
strategy.entry("SHORT", false, when = x>LThr1 and close>linreg(close,SMAlenL,0) and close<sma(close,SMALen2))
strategy.close("SHORT", when = close<linreg(close,SMAlenL,0))
if LongShort=="Both" and AboveBelow=="Don't Include" and LongShort2 =="LR"
strategy.entry("SHORT", false, when = x>LThr1 and close>linreg(close,SMAlenL,0) )
strategy.close("SHORT", when = close<linreg(close,SMAlenL,0))