
গড়রেখার বিপরীতমুখী ট্রেডিং কৌশল হল এমন একটি কৌশল যা গড়রেখার থেকে দামের বিচ্যুতির উপর ভিত্তি করে ট্রেডিং করে। এই কৌশলটি দীর্ঘমেয়াদী গড়রেখার থেকে দামের স্বল্পমেয়াদী বিচ্যুতির বৈশিষ্ট্যগুলি ব্যবহার করে, যখন দাম গড়রেখার উল্লেখযোগ্যভাবে নীচে বা উপরে থাকে তখন অবস্থান স্থাপন করে এবং যখন দাম গড়রেখার দিকে ফিরে আসে তখন স্থির স্থির স্থির করে।
এই কৌশলটি প্রথমে একটি নির্দিষ্ট সময়ের চলমান গড় গণনা করে, যা দীর্ঘমেয়াদী মূল্যের প্রবণতাকে উপস্থাপন করে। তারপরে অবস্থান স্থাপনের সময় এবং অবস্থানের আকারটি নির্ধারণ করে যে দামটি চলমান গড়ের থেকে কতটা বিচ্যুত।
যখন দামটি চলমান গড়ের নীচে একটি নির্দিষ্ট অনুপাতের নীচে থাকে, তখন দাম দীর্ঘমেয়াদী প্রবণতা থেকে বিচ্যুত হয়, তখন একটি নির্দিষ্ট অবস্থানের অনুপাত অনুসারে ধীরে ধীরে একাধিক অর্ডার স্থাপন করা হয়। দামের বিচ্যুতি যত বেশি হয়, ততই বড় অবস্থান স্থাপন করা হয়। যখন দামটি চলমান গড়ের উপরে ফিরে আসে, তখন দীর্ঘমেয়াদী প্রবণতার দিকে ফিরে আসে, তখন অবস্থানের অনুপাতের ভিত্তিতে পজিশন সুইপারেজ।
একইভাবে, যখন দামটি চলমান গড়ের তুলনায় একটি নির্দিষ্ট অনুপাতের উপরে থাকে, তখন একটি খালি কার্ড তৈরি করা হয়। যখন দামটি চলমান গড়ের দিকে ফিরে আসে, তখন অনুপাতের সাথে সমতল করা হয়।
গড়রেখার ট্রেন্ড সনাক্তকরণের ক্ষমতা ব্যবহার করে, শেয়ারের দামের দীর্ঘমেয়াদী সমান্তরাল প্রবণতা অনুসরণ করে, প্রধান প্রবণতার দিকটি ধরে রাখে।
ব্যাচ তৈরি করে পজিশন তৈরি করুন, গুদাম নির্মাণের খরচ কমিয়ে নিন, ভাল দামের দাম পান।
ধাপে ধাপে স্টপ ব্যবহার করে, বিভিন্ন স্তরের প্রত্যাবর্তন গড়রেখার বিভিন্ন স্টপ সুযোগ রয়েছে, যা ঝুঁকি হ্রাস করে।
পজিশন কন্ট্রোলঃ একক লোকসান এড়াতে নির্দিষ্ট অংশ ব্যবহার করুন।
প্যারামিটার সেটিং নমনীয়, বিভিন্ন জাতের উপর ভিত্তি করে চলমান গড় লাইন সময়কাল বা অবস্থানের অনুপাত সামঞ্জস্য করা যেতে পারে।
দামের অস্থিরতার সময়, ঘন ঘন ক্ষতি হতে পারে। যথাযথভাবে স্টপ ল্যাম্পটি শিথিল করা যেতে পারে, বা অন্যান্য ফিল্টারিং শর্তগুলি প্রয়োগ করা যেতে পারে।
শক্তিশালী শেয়ারগুলি সরাসরি গড় লাইনটি অতিক্রম করতে পারে এবং উত্থান বা পতন অব্যাহত রাখতে পারে, গড় লাইন বন্ধে ফিরে আসতে পারে না। প্রবণতা সূচকগুলির সাথে মিলিত হয়ে শক্তিশালী প্রবণতা নির্ধারণ করতে পারে, অবস্থানটি হ্রাস করতে পারে।
ভুল প্যারামিটার সেট করা হতে পারে অত্যধিক পজিশনিং বা স্টপ লস। প্যারামিটারগুলি সাবধানতার সাথে পরীক্ষা করা উচিত এবং বাজারের সাথে সামঞ্জস্য করা উচিত।
লেনদেনের ঘনত্বের সাথে লেনদেনের ব্যয় বেশি হতে পারে, ব্যয় ফ্যাক্টর অপ্টিমাইজেশান প্যারামিটারগুলি বিবেচনা করা উচিত।
বিভিন্ন জাতের বৈশিষ্ট্যের সাথে সামঞ্জস্য রেখে চলমান গড়ের চক্রের অপ্টিমাইজেশন।
পজিশনের অনুপাত অনুকূলিতকরণ, ঝুঁকি-লাভের ভারসাম্য।
৩. অন্যান্য প্রযুক্তিগত সূচকগুলিকে ফিল্টার করে অপ্রয়োজনীয় লেনদেন এড়ানো।
বাজারের অস্থিরতা অনুযায়ী পজিশন অনুপাতের সমন্বয় করুন।
ক্রেডিট কমানো, রিস্ক কমানো, রিটার্ন বাড়ানো।
সমান্তরাল প্রত্যাবর্তন কৌশলটি স্টকগুলির সুষম প্রত্যাবর্তনের বৈশিষ্ট্যটি ব্যবহার করে, যখন দামটি চলমান গড়ের কাছ থেকে বিচ্যুত হয় তখন পজিশন স্থাপন করে, যখন দামটি প্রত্যাবর্তন হয় তখন থামবে, কার্যকরভাবে স্টকগুলির দীর্ঘমেয়াদী প্রবণতা ধরে রাখতে পারে। প্যারামিটার অপ্টিমাইজেশন এবং সূচক ফিল্টারিংয়ের মাধ্যমে, বাজারের পরিবর্তনের সাথে খাপ খাইয়ে নিতে সক্ষম, ঝুঁকি নিয়ন্ত্রণের পূর্বশর্তে ভাল রিটার্ন পেতে পারে। এই কৌশলটি প্রবণতা ট্র্যাকিং এবং ঝুঁকি নিয়ন্ত্রণের উপর মনোযোগ দেয়, বিনিয়োগকারীদের গবেষণার জন্য উপযুক্ত।
/*backtest
start: 2022-10-19 00:00:00
end: 2023-10-25 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("YJ Mean Reversion", overlay=true)
//Was designed firstly to work on an index like the S&P 500 , which over time tends to go up in value.
//Avoid trading too frequently (e.g. Daily, Weekly), to avoid getting eaten by fees.
//If you change the underlying asset, or time frame, tweaking the moving average may be necessary.
//Can work with a starting capital of just $1000, optimise the settings as necessary.
//Accepts floating point values for the amount of units to purchase (e.g. Bitcoin ).
//If price of units exceeds available capital, script will cancel the buy.
//Adjusted the input parameters to be more intuitive.
//input variables
movingAverage = input(title="Moving Average (bars)", type=input.integer, defval=28, minval=1, maxval=1000)
//riskPercentage = input(title="Amount to Risk (%)", type=input.integer, defval=1, minval=1, maxval=50)
deviation = input(title="Deviation Increment (%)", type=input.float, defval=5, minval=0.01, maxval=100) / 100
unitsLevel1 = input(title="Level 1 (units)", type=input.float, defval=1, minval=0.0001, maxval=10000)
unitsLevel2 = input(title="Level 2 (units)", type=input.float, defval=2, minval=0.0001, maxval=10000)
unitsLevel3 = input(title="Level 3 (units)", type=input.float, defval=4, minval=0.0001, maxval=10000)
unitsLevel4 = input(title="Level 4 (units)", type=input.float, defval=8, minval=0.0001, maxval=10000)
unitsLevel5 = input(title="Level 5 (units)", type=input.float, defval=16, minval=0.0001, maxval=10000)
//moving average and ma slope (use on weekly chart)
ma = sma(close, movingAverage)
//sl = ma > ma[4]
//units to buy
//amount = riskPercentage / 100 * (strategy.initial_capital + strategy.netprofit)
//units = floor(amount / close)
//mode 1
//strategy.order("buy", true, 1, when = (close < 0.95 * ma) and (strategy.position_size < 10))
//strategy.order("sell", false, strategy.position_size, when = (close > 1.05 * ma) and (strategy.position_size > 0))
//mode 2
//strategy.order("buy", true, 1, when = close < 0.8 * ma)
//strategy.order("sell", false, strategy.position_size, when = (close > 310) and (strategy.position_size > 0))
//mode 3
//strategy.order("buy", true, 1, when = (close < 0.95 * ma) and (close > 0.9 * ma))
//strategy.order("buy", true, 2, when = (close < 0.9 * ma) and (close > 0.85 * ma))
//strategy.order("buy", true, 4, when = (close < 0.85 * ma) and (close > 0.8 * ma))
//strategy.order("buy", true, 8, when = (close < 0.8 * ma) and (close > 0.75 * ma))
//strategy.order("buy", true, 16, when = (close < 0.75 * ma))
//strategy.order("sell", false, strategy.position_size, when = (close > 310) and (strategy.position_size > 0))
//mode 4
//strategy.order("buy", true, 1, when = (close < 0.98 * ma) and (close > 0.96 * ma) and (sl))
//strategy.order("buy", true, 2, when = (close < 0.96 * ma) and (close > 0.94 * ma) and (sl))
//strategy.order("buy", true, 4, when = (close < 0.94 * ma) and (close > 0.92 * ma) and (sl))
//strategy.order("buy", true, 8, when = (close < 0.92 * ma) and (close > 0.90 * ma) and (sl))
//strategy.order("buy", true, 16, when = (close < 0.90 * ma) and (sl))
//strategy.order("sell", false, strategy.position_size, when = (close > 310) and (strategy.position_size > 0))
//mode 5
//strategy.order("buy", true, 1, when = (close < 0.95 * ma) and (close > 0.9 * ma))
//strategy.order("buy", true, 2, when = (close < 0.9 * ma) and (close > 0.85 * ma))
//strategy.order("buy", true, 4, when = (close < 0.85 * ma) and (close > 0.8 * ma))
//strategy.order("buy", true, 8, when = (close < 0.8 * ma) and (close > 0.75 * ma))
//strategy.order("buy", true, 16, when = (close < 0.75 * ma))
//strategy.order("sell", false, 1, when = (close > 1.05 * ma) and (close < 1.1 * ma) and (strategy.position_size > 0))
//strategy.order("sell", false, 2, when = (close > 1.1 * ma) and (close < 1.15 * ma) and (strategy.position_size > 0))
//strategy.order("sell", false, 4, when = (close > 1.15 * ma) and (close < 1.2 * ma) and (strategy.position_size > 0))
//strategy.order("sell", false, 8, when = (close > 1.2 * ma) and (close < 1.25 * ma) and (strategy.position_size > 0))
//strategy.order("sell", false, 16, when = (close > 1.25 * ma) and (close < 1.3 * ma) and (strategy.position_size > 0))
//mode 6
//strategy.order("B1", true, unitsLevel1 * units, when = (close < 0.95 * ma) and (close > 0.9 * ma))
//strategy.order("B2", true, unitsLevel2 * units, when = (close < 0.9 * ma) and (close > 0.85 * ma))
//strategy.order("B3", true, unitsLevel3 * units, when = (close < 0.85 * ma) and (close > 0.8 * ma))
//strategy.order("B4", true, unitsLevel4 * units, when = (close < 0.8 * ma) and (close > 0.75 * ma))
//strategy.order("B5", true, unitsLevel5 * units, when = (close < 0.75 * ma))
//strategy.order("S1", false, unitsLevel1 * units, when = (close > 1.05 * ma) and (close < 1.1 * ma) and (strategy.position_size > 0))
//strategy.order("S2", false, unitsLevel2 * units, when = (close > 1.1 * ma) and (close < 1.15 * ma) and (strategy.position_size > 0))
//strategy.order("S3", false, unitsLevel3 * units, when = (close > 1.15 * ma) and (close < 1.2 * ma) and (strategy.position_size > 0))
//strategy.order("S4", false, unitsLevel4 * units, when = (close > 1.2 * ma) and (close < 1.25 * ma) and (strategy.position_size > 0))
//strategy.order("S5", false, unitsLevel5 * units, when = (close > 1.25 * ma) and (close < 1.3 * ma) and (strategy.position_size > 0))
//mode 7
//strategy.order("B1", true, units, when = (close < 0.95 * ma) and (close > 0.9 * ma))
//strategy.order("B2", true, units, when = (close < 0.9 * ma) and (close > 0.85 * ma))
//strategy.order("B3", true, units, when = (close < 0.85 * ma) and (close > 0.8 * ma))
//strategy.order("B4", true, units, when = (close < 0.8 * ma) and (close > 0.75 * ma))
//strategy.order("B5", true, units, when = (close < 0.75 * ma))
//strategy.order("S1", false, units, when = (close > 1.05 * ma) and (close < 1.1 * ma) and (strategy.position_size > 0))
//strategy.order("S2", false, units, when = (close > 1.1 * ma) and (close < 1.15 * ma) and (strategy.position_size > 0))
//strategy.order("S3", false, units, when = (close > 1.15 * ma) and (close < 1.2 * ma) and (strategy.position_size > 0))
//strategy.order("S4", false, units, when = (close > 1.2 * ma) and (close < 1.25 * ma) and (strategy.position_size > 0))
//strategy.order("S5", false, units, when = (close > 1.25 * ma) and (close < 1.3 * ma) and (strategy.position_size > 0))
//banding calculations
aH = 1.0 - deviation
aL = aH - deviation
bH = aL
bL = bH - deviation
cH = bL
cL = cH - deviation
dH = cL
dL = dH - deviation
eH = dL
strategy.initial_capital = 50000
//mode 8
strategy.order("B1", true, unitsLevel1, when = (close < aH * ma) and (close > aL * ma) and (unitsLevel1 * close < (strategy.initial_capital + strategy.netprofit)))
strategy.order("B2", true, unitsLevel2, when = (close < bH * ma) and (close > bL * ma) and (unitsLevel2 * close < (strategy.initial_capital + strategy.netprofit)))
strategy.order("B3", true, unitsLevel3, when = (close < cH * ma) and (close > cL * ma) and (unitsLevel3 * close < (strategy.initial_capital + strategy.netprofit)))
strategy.order("B4", true, unitsLevel4, when = (close < dH * ma) and (close > dL * ma) and (unitsLevel4 * close < (strategy.initial_capital + strategy.netprofit)))
strategy.order("B5", true, unitsLevel5, when = (close < eH * ma) and (unitsLevel5 * close < (strategy.initial_capital + strategy.netprofit)))
//banding calculations
fL = 1.0 + deviation
fH = fL + deviation
gL = fH
gH = gL + deviation
hL = gH
hH = hL + deviation
iL = hH
iH = iL + deviation
jL = iH
strategy.order("S1", false, unitsLevel1, when = (close > fL * ma) and (close < fH * ma) and (strategy.position_size > 0))
strategy.order("S2", false, unitsLevel2, when = (close > gL * ma) and (close < gH * ma) and (strategy.position_size > 0))
strategy.order("S3", false, unitsLevel3, when = (close > hL * ma) and (close < hH * ma) and (strategy.position_size > 0))
strategy.order("S4", false, unitsLevel4, when = (close > iL * ma) and (close < iH * ma) and (strategy.position_size > 0))
strategy.order("S5", false, unitsLevel5, when = (close > jL * ma) and (strategy.position_size > 0))
plot(ma, color=#666666, linewidth=5)