
এই ইস্যুতে, আমরা ইউটিউবের একটি “জাদুকরী ডাবল EMA কৌশল” নিয়ে আলোচনা করব এই কৌশলটিকে “স্টক এবং ক্রিপ্টোকারেন্সি মার্কেট কিলার” বলা হয়। সম্পাদক ভিডিওটি দেখেছেন এবং শিখেছেন যে এই কৌশলটি একটি ট্রেডিং ভিউ পাইন ভাষার কৌশল, 2টি ট্রেডিং ভিউ সূচক ব্যবহার করে৷ আমি দেখেছি যে ভিডিওতে ব্যাকটেস্টের ফলাফলগুলি খুব ভাল ছিল, এবং FMZ ট্রেডিং ভিউ-এর পাইন ভাষাকেও সমর্থন করে, তাই আমি সাহায্য করতে পারিনি তবে আমি নিজেই এটি ব্যাকটেস্ট এবং বিশ্লেষণ করতে চাই। তাহলে শুরু করা যাক! এখন ভিডিওতে কৌশলগুলি অনুলিপি করা শুরু করুন।
ডিজাইনের সরলতার জন্য, আমরা ভিডিওতে তালিকাভুক্ত মুভিং এভারেজ এক্সপোনেনশিয়াল ব্যবহার করব না। আমরা ট্রেডিং ভিউতে বিল্ট-ইন ta.ema ব্যবহার করি (আসলে এগুলো একই রকম)।
এটি ট্রেডিং ভিউ এর একটি সূচক যা সোর্স কোড ডাউনলোড করতে আমাদের ট্রেডিং ভিউতে যেতে হবে।

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")
EMA সূচক: কৌশল দুটি EMA মুভিং এভারেজ ব্যবহার করে, একটি ফাস্ট লাইন (ছোট পিরিয়ড প্যারামিটার) এবং একটি স্লো লাইন (বড় পিরিয়ড প্যারামিটার)। ডাবল EMA মুভিং এভারেজের প্রধান কাজ হল আমাদের বাজারের প্রবণতার দিক নির্ণয় করতে সাহায্য করা।
মাল্টি-হেড বিন্যাস ফাস্ট লাইন স্লো লাইনের উপরে।
সংক্ষিপ্ত আয়োজন ফাস্ট লাইন স্লো লাইনের নিচে।
VuManChu সুইং ফ্রি সূচক: VuManChu সুইং ফ্রি সূচকটি সংকেত পাঠাতে ব্যবহৃত হয়, এবং তারপরে অর্ডার দিতে হবে কিনা তা নির্ধারণ করতে অন্যান্য শর্তের সাথে মিলিত হয়। এটি VuManChu সুইং ফ্রি ইন্ডিকেটর সোর্স কোড থেকে দেখা যায়: লংকন্ডিশন ভেরিয়েবল বাই সিগন্যালকে প্রতিনিধিত্ব করে এবং শর্টকন্ডিশন ভেরিয়েবল সেল সিগন্যালকে প্রতিনিধিত্ব করে। এই দুটি ভেরিয়েবল পরে অর্ডার শর্ত লেখার সময় ব্যবহার করা হবে।
এখন কৌশলটির নির্দিষ্ট ট্রেডিং সিগন্যাল ট্রিগার শর্ত সম্পর্কে কথা বলা যাক:
দীর্ঘ অবস্থানে প্রবেশের নিয়ম: ধনাত্মক K লাইনের ক্লোজিং প্রাইস অবশ্যই EMA ফাস্ট লাইনের উপরে হতে হবে, দুটি EMA মুভিং এভারেজ অবশ্যই লং পজিশনে থাকতে হবে (ফাস্ট লাইনটি স্লো লাইনের উপরে), এবং VuManChu সুইং ফ্রি ইন্ডিকেটরের অবশ্যই একটি ক্রয় সিগন্যাল থাকতে হবে ( দীর্ঘ শর্ত সত্য)। যদি তিনটি শর্ত পূরণ করা হয়, এই K-লাইনটি দীর্ঘ প্রবেশের জন্য মূল K-লাইন, এবং এই K-লাইনের সমাপ্তি মূল্য হল প্রবেশের অবস্থান।
সংক্ষিপ্ত অবস্থানে প্রবেশের নিয়ম (লং পজিশনের বিপরীতে): Yin K-লাইনের ক্লোজিং প্রাইস অবশ্যই EMA ফাস্ট লাইনের নিচে হতে হবে, দুটি EMA মুভিং এভারেজ অবশ্যই সংক্ষিপ্ত অবস্থানে থাকতে হবে (দ্রুত লাইনটি ধীর রেখার নিচে), এবং VuManChu সুইং ফ্রি সূচকে অবশ্যই একটি বিক্রয় সংকেত থাকতে হবে (শর্টকন্ডিশন সত্য)। যদি তিনটি শর্ত পূরণ করা হয়, তাহলে এই K লাইনের সমাপ্তি মূল্য হল সংক্ষিপ্ত প্রবেশের অবস্থান।
ট্রেডিং লজিক কি খুব সহজ নয়? যেহেতু সোর্স ভিডিওতে লাভ-লাভ এবং স্টপ-লস নির্দিষ্ট করা নেই, তাই সম্পাদক একটি স্থির-পয়েন্ট স্টপ-লস এবং ট্র্যাকিং ব্যবহার করে আরও মাঝারি লাভ-লাভ এবং স্টপ-লস পদ্ধতি ব্যবহার করবেন। লাভ-লাভ।
আমরা VuManChu সুইং ফ্রি নির্দেশকের কোডটি সরাসরি আমাদের কৌশল কোডে অক্ষত রেখেছি।

তারপরে আমরা লেনদেন ফাংশন বাস্তবায়ন করতে পাইন ভাষার কোডের একটি অংশ লিখি:
// 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) // 计算快线EMA
emaSlow = ta.ema(close, slowEmaPeriod) // 计算慢线EMA
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)
A. আপনি দেখতে পারেন যে যখন buyCondition সত্য হয়:
- লং কন্ডিশন ভেরিয়েবলটি সত্য (ভুমানচু সুইং ফ্রি ইন্ডিকেটর দীর্ঘ যাওয়ার জন্য একটি সংকেত পাঠায়)।
- emaFast > emaSlow (EMA দীর্ঘ বিন্যাস)। ৩. বন্ধ করুন > খোলা (যা নির্দেশ করে যে বর্তমান BAR একটি ধনাত্মক লাইন), বন্ধ করুন > emaFast (যা নির্দেশ করে যে সমাপনী মূল্য EMA দ্রুত লাইনের উপরে)।
দীর্ঘ পথ চলার তিনটি শর্ত প্রতিষ্ঠিত।
B. বিক্রয় শর্ত সত্য হলে, স্বল্প বিক্রয়ের জন্য তিনটি শর্ত প্রতিষ্ঠিত হয় (এখানে পুনরাবৃত্তি করা হয়নি)।
তারপর, যখন যদি শর্তসাপেক্ষ বিচারের সংকেতটি ট্রিগার হয়, তখন একটি অবস্থান প্রবেশ করতে এবং খুলতে কৌশল. এন্ট্রি ফাংশনটি ব্যবহার করুন এবং একই সাথে লস এবং ট্রেলিং টেক প্রফিট বন্ধ করতে কৌশল. বহির্গমন ফাংশন সেট করুন।
/*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 মিনিট, এবং ব্যাকটেস্টিংয়ের জন্য বন্ধ মূল্য মডেল ব্যবহার করা হয়। বাজার Binance এর ETH_USDT চিরস্থায়ী চুক্তি বেছে নেয়। পরামিতি সেটিংস উৎস ভিডিওতে বলা হয়েছে: দ্রুত লাইনের জন্য 50টি চক্র এবং ধীর লাইনের জন্য 200টি চক্র ডিফল্টরূপে অপরিবর্তিত থাকে। আমি স্টপ লস এবং ট্রেইলিং টেক প্রফিট পয়েন্ট সম্পর্কে আরও বিষয়ভিত্তিক, তাই আমি 30 পয়েন্ট সেট করেছি।


ব্যাকটেস্ট ফলাফলগুলি তাই-ই একাধিক ব্যাকটেস্টের পরে, মনে হচ্ছে স্টপ-প্রফিট এবং স্টপ-লসের প্যারামিটারগুলি ব্যাকটেস্ট ফলাফলের উপর কিছু প্রভাব ফেলে। আমি মনে করি যে ডিজাইনটি এখনও এই দিকটিতে অপ্টিমাইজ করা দরকার। যাইহোক, কৌশল সংকেত লেনদেন ট্রিগার করার পরে জয়ের হার এখনও গ্রহণযোগ্য।
আসুন একটি BTC_USDT চিরস্থায়ী চুক্তিতে পরিবর্তন করার চেষ্টা করি:

বিটিসি-তে ব্যাকটেস্টের ফলাফলও বিস্ফোরক:


কৌশল ঠিকানা: https://www.fmz.com/strategy/385745
মনে হচ্ছে এই ট্রেডিং পদ্ধতি প্রবণতা নির্ধারণে তুলনামূলকভাবে নির্ভরযোগ্য, এবং এই ধারণার উপর ভিত্তি করে ডিজাইনটি অপ্টিমাইজ করা চালিয়ে যেতে পারে। এই নিবন্ধে, আমরা শুধুমাত্র একটি ডবল মুভিং এভারেজ স্ট্র্যাটেজির ধারণাটিই বুঝি না, তবে কীভাবে ইউটিউবে মাস্টারদের কৌশলগুলি প্রক্রিয়া করতে এবং শিখতে হয় তাও বুঝতে পারি। ঠিক আছে, উপরের কৌশল কোডটি কেবলমাত্র সম্পাদকের পরামর্শ। আপনার সমর্থনের জন্য আপনাকে ধন্যবাদ, পরের বার দেখা হবে!