ব্ল্যাকবিট ট্রেডার এক্সও ম্যাক্রো ট্রেন্ড স্ক্যানার কৌশল

লেখক:চাওঝাং, তারিখঃ ২০২৪-০১-২৫ ১৫ঃ২১ঃ৪৬
ট্যাগঃ

img

সারসংক্ষেপ

এই কৌশলটি ট্রেন্ডের দিকনির্দেশ এবং প্রবেশের পয়েন্টগুলি সনাক্ত করতে ডাবল চলমান গড় এবং স্টকআরএসআই সূচককে একত্রিত করে। মূল বৈশিষ্ট্যটি হ'ল এটি ট্রেন্ডের প্রাথমিক পর্যায়ে বাজারে প্রবেশ করতে পারে, যখন স্টকআরএসআইয়ের অতিরিক্ত ক্রয় / অতিরিক্ত বিক্রয় বৈশিষ্ট্যগুলিকে মিথ্যা ব্রেকআউটগুলি ফিল্টার করতে ব্যবহার করে।

কৌশলগত যুক্তি

কৌশলটি একটি ডাবল চলমান গড় সিস্টেম তৈরি করতে দ্রুত চলমান গড় ইএমএ ((১২) এবং ধীর চলমান গড় ইএমএ ((২৫) ব্যবহার করে। যখন দ্রুত লাইন ধীর লাইনের উপরে অতিক্রম করে, তখন ক্রয় সংকেত উত্পন্ন হয়। যখন দ্রুত লাইন ধীর লাইনের নীচে অতিক্রম করে, তখন বিক্রয় সংকেত উত্পন্ন হয়। এটি প্রধান প্রবণতার দিক নির্ধারণ করতে ব্যবহৃত হয়।

একই সময়ে, কৌশলটি এন্ট্রি টাইমিং আরও সনাক্ত করতে স্টকআরএসআই ক্রসওভারকে অন্তর্ভুক্ত করে। স্টকআরএসআই স্টোকাস্টিক কেডিজে এবং আরএসআইকে একত্রিত করে। যখন কে লাইন ওভারসোল্ড জোন থেকে ডি লাইন উপরে অতিক্রম করে, তখন কিনুন সংকেত উত্পন্ন হয়। যখন কে লাইন ওভারসোল্ড জোন থেকে ডি লাইন নীচে অতিক্রম করে, তখন বিক্রয় সংকেত উত্পন্ন হয়।

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

সুবিধা বিশ্লেষণ

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

এছাড়াও, কৌশলটি প্রবণতা বিশ্লেষণ এবং অতিরিক্ত ক্রয় / oversold বিচার উভয় একত্রিত করে, প্রবণতা অনুসরণ এবং গড় বিপরীত উভয় শক্তি বৈশিষ্ট্য। প্রবণতা ট্র্যাকিং বা কম কিনতে এবং উচ্চ বিক্রি, এই কৌশল সব দিক থেকে সুযোগ ক্যাপচার করতে পারেন।

ঝুঁকি বিশ্লেষণ

এই কৌশলটির মূল ঝুঁকিটি ডাবল মুভিং এভারেজ সিস্টেমের বিলম্বের মধ্যে রয়েছে। যখন বাজার হঠাৎ করে হিংস্রভাবে পরিবর্তিত হয়, ডাবল মুভিং এভারেজ সিস্টেমটি প্রায়শই সংকেত তৈরি করতে সময় নেয়, সহজেই সেরা প্রবেশের সময়টি মিস করে।

এছাড়া, স্টোকআরএসআই ভুল সংকেতও তৈরি করতে পারে, যা অপ্রয়োজনীয় লেনদেনের দিকে পরিচালিত করে, বিশেষ করে রেঞ্জিং মার্কেটে যেখানে কে এবং ডি লাইন প্রায়শই ক্রস করতে পারে, যা অত্যধিক অবৈধ লেনদেনের ঝুঁকি তৈরি করে।

অপ্টিমাইজেশান নির্দেশাবলী

এই কৌশলটির অপ্টিমাইজেশান প্রধানত বেশ কয়েকটি দিকের উপর দৃষ্টি নিবদ্ধ করেঃ

  1. ডাবল চলমান গড়ের পরামিতিগুলিকে এমন সময়সীমা গ্রহণের জন্য সামঞ্জস্য করুন যা প্রবণতা ধরাতে আরও অনুকূল;

  2. স্টকআরএসআই এর পরামিতিগুলিকে আরও যুক্তিসঙ্গত ওভারকুপ/ওভারসোল্ড মানদণ্ডের জন্য অপ্টিমাইজ করা;

  3. অর্ডারের আকার বাড়ানো বা উচ্চতর রিটার্ন অর্জনের জন্য স্টপ লস/টেক প্রফিট সামঞ্জস্য করা।

  4. অবৈধ সংকেত আরও হ্রাস করার জন্য ফিল্টার শর্ত হিসাবে অন্যান্য সূচক অন্তর্ভুক্ত করুন।

সংক্ষিপ্তসার

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


/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-24 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/
// © btc_charlie / @TheParagonGrp

//@version=5
strategy('BlackBit Trader XO Macro Trend Scanner', overlay=true)

// Variables
var ok = 0
var countBuy = 0
var countSell = 0
src = input(close, title='OHLC Type')
i_fastEMA = input(12, title='Fast EMA')
i_slowEMA = input(25, title='Slow EMA')
i_defEMA = input(25, title='Consolidated EMA')

// Allow the option to show single or double EMA
i_bothEMAs = input(title='Show Both EMAs', defval=true)

// Define EMAs
v_fastEMA = ta.ema(src, i_fastEMA)
v_slowEMA = ta.ema(src, i_slowEMA)
v_biasEMA = ta.ema(src, i_defEMA)

// Color the EMAs
emaColor = v_fastEMA > v_slowEMA ? color.green : v_fastEMA < v_slowEMA ? color.red : #FF530D

// Plot EMAs
plot(i_bothEMAs ? na : v_biasEMA, color=emaColor, linewidth=3, title='Consolidated EMA')
plot(i_bothEMAs ? v_fastEMA : na, title='Fast EMA', color=emaColor)
plot(i_bothEMAs ? v_slowEMA : na, title='Slow EMA', color=emaColor)

// Colour the bars
buy = v_fastEMA > v_slowEMA
sell = v_fastEMA < v_slowEMA

if buy
    countBuy += 1
    countBuy

if buy
    countSell := 0
    countSell

if sell
    countSell += 1
    countSell

if sell
    countBuy := 0
    countBuy

buysignal = countBuy < 2 and countBuy > 0 and countSell < 1 and buy and not buy[1]
sellsignal = countSell > 0 and countSell < 2 and countBuy < 1 and sell and not sell[1]

barcolor(buysignal ? color.green : na)
barcolor(sellsignal ? color.red : na)


bull = countBuy > 1
bear = countSell > 1

barcolor(bull ? color.green : na)
barcolor(bear ? color.red : na)

// Set Alerts

// alertcondition(ta.crossover(v_fastEMA, v_slowEMA), title='Bullish EMA Cross', message='Bullish EMA crossover')
// alertcondition(ta.crossunder(v_fastEMA, v_slowEMA), title='Bearish EMA Cross', message='Bearish EMA Crossover')

// Stoch RSI code

smoothK = input.int(3, 'K', minval=1)
smoothD = input.int(3, 'D', minval=1)
lengthRSI = input.int(14, 'RSI Length', minval=1)
lengthStoch = input.int(14, 'Stochastic Length', minval=1)

rsi1 = ta.rsi(src, lengthRSI)
k = ta.sma(ta.stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = ta.sma(k, smoothD)

bandno0 = input.int(80, minval=1, title='Upper Band', group='Bands (change this instead of length in Style for Stoch RSI colour to work properly)')
bandno2 = input.int(50, minval=1, title='Middle Band', group='Bands (change this instead of length in Style for Stoch RSI colour to work properly)')
bandno1 = input.int(20, minval=1, title='Lower Band', group='Bands (change this instead of length in Style for Stoch RSI colour to work properly)')

// Alerts

crossoverAlertBgColourMidOnOff = input.bool(title='Crossover Alert Background Colour (Middle Level) [ON/OFF]', group='Crossover Alerts', defval=false)
crossoverAlertBgColourOBOSOnOff = input.bool(title='Crossover Alert Background Colour (OB/OS Level) [ON/OFF]', group='Crossover Alerts', defval=false)

crossoverAlertBgColourGreaterThanOnOff = input.bool(title='Crossover Alert >input [ON/OFF]', group='Crossover Alerts', defval=false)
crossoverAlertBgColourLessThanOnOff = input.bool(title='Crossover Alert <input [ON/OFF]', group='Crossover Alerts', defval=false)

maTypeChoice = input.string('EMA', title='MA Type', group='Moving Average', options=['EMA', 'WMA', 'SMA', 'None'])
maSrc = input.source(close, title='MA Source', group='Moving Average')
maLen = input.int(200, minval=1, title='MA Length', group='Moving Average')

maValue = if maTypeChoice == 'EMA'
    ta.ema(maSrc, maLen)
else if maTypeChoice == 'WMA'
    ta.wma(maSrc, maLen)
else if maTypeChoice == 'SMA'
    ta.sma(maSrc, maLen)
else
    0

crossupCHECK = maTypeChoice == 'None' or open > maValue and maTypeChoice != 'None'
crossdownCHECK = maTypeChoice == 'None' or open < maValue and maTypeChoice != 'None'

crossupalert = crossupCHECK and ta.crossover(k, d) and (k < bandno2 or d < bandno2)
crossdownalert = crossdownCHECK and ta.crossunder(k, d) and (k > bandno2 or d > bandno2)
crossupOSalert = crossupCHECK and ta.crossover(k, d) and (k < bandno1 or d < bandno1)
crossdownOBalert = crossdownCHECK and ta.crossunder(k, d) and (k > bandno0 or d > bandno0)

aboveBandalert = ta.crossunder(k, bandno0)
belowBandalert = ta.crossover(k, bandno1)

bgcolor(color=crossupalert and crossoverAlertBgColourMidOnOff ? #4CAF50 : crossdownalert and crossoverAlertBgColourMidOnOff ? #FF0000 : na, title='Crossover Alert Background Colour (Middle Level)', transp=70)
bgcolor(color=crossupOSalert and crossoverAlertBgColourOBOSOnOff ? #fbc02d : crossdownOBalert and crossoverAlertBgColourOBOSOnOff ? #000000 : na, title='Crossover Alert Background Colour (OB/OS Level)', transp=70)

bgcolor(color=aboveBandalert and crossoverAlertBgColourGreaterThanOnOff ? #ff0014 : crossdownalert and crossoverAlertBgColourMidOnOff ? #FF0000 : na, title='Crossover Alert - K > Upper level', transp=70)
bgcolor(color=belowBandalert and crossoverAlertBgColourLessThanOnOff ? #4CAF50 : crossdownalert and crossoverAlertBgColourMidOnOff ? #FF0000 : na, title='Crossover Alert - K < Lower level', transp=70)

// alertcondition(crossupalert or crossdownalert, title='Stoch RSI Crossover', message='STOCH RSI CROSSOVER')

// Calculate start/end date and time condition
startDate = input(timestamp('2000-12-24T00:00:00'),group = "---------TIME RANGE SETTINGS---------")
finishDate = input(timestamp('2029-02-26T00:00:00'),group = "---------TIME RANGE SETTINGS---------")
time_cond = true


//ema filter
emalen = input(200,"EMA Filter Length",group = "EMA FILTER SETTINGS")
emasource = input(close,"EMA Filter Source",group = "EMA FILTER SETTINGS")
ema_fil = ta.ema(emasource,emalen)
plot(ema_fil,"EMA Filter")

//macd
fast_length = input(title="Fast Length", defval=26,group = "MACD FILTER SETTINGS")
slow_length = input(title="Slow Length", defval=100,group = "MACD FILTER SETTINGS")
src_macd = input(title="Source", defval=close,group = "MACD FILTER SETTINGS")
signal_length = input.int(title="Signal Smoothing",  minval = 1, maxval = 50, defval = 9,group = "MACD FILTER SETTINGS")
sma_source = input.string(title="Oscillator MA Type",  defval="EMA", options=["SMA", "EMA"],group = "MACD FILTER SETTINGS")
sma_signal = input.string(title="Signal Line MA Type", defval="EMA", options=["SMA", "EMA"],group = "MACD FILTER SETTINGS")

// Calculating
fast_ma = sma_source == "SMA" ? ta.sma(src_macd, fast_length) : ta.ema(src_macd, fast_length)
slow_ma = sma_source == "SMA" ? ta.sma(src_macd, slow_length) : ta.ema(src_macd, slow_length)
macd = fast_ma - slow_ma
signal = sma_signal == "SMA" ? ta.sma(macd, signal_length) : ta.ema(macd, signal_length)
hist = macd - signal

//tpsl
takeprofit=input.float(defval=0.3,title="Enter The Take Profit %",group="TP/SL CONDITION INPUTS HERE")/100
stoploss=input.float(defval=0.16,title="Enter The Stop %",group="TP/SL CONDITION INPUTS HERE")/100
tp = strategy.opentrades.entry_price(0)*takeprofit/syminfo.mintick
sl = strategy.opentrades.entry_price(0)*stoploss/syminfo.mintick

lg_rule = buysignal and hist > 0 and close > ema_fil
sh_rule = sellsignal and hist < 0 and close < ema_fil

// Plot Bull/Bear

plotshape(lg_rule, title='Bull', text='Bull', style=shape.triangleup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.black, 0), size=size.tiny)
plotshape(sh_rule, title='Bear', text='Bear', style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.black, 0), size=size.tiny)

//alert
lg_entryal = input("Long entry","Long entry alert",group = "ALERT MESSAGE SETTINGS")
sh_entryal = input("Short entry","Short entry alert",group = "ALERT MESSAGE SETTINGS")

if lg_rule and time_cond and barstate.isconfirmed
    strategy.entry("LONG",strategy.long)
    alert(lg_entryal,alert.freq_once_per_bar_close)
if strategy.position_size > 0
    strategy.exit("LONG EX","LONG",loss = sl,profit = tp,comment_loss = "LONG SL",comment_profit = "LONG TP")

if sh_rule and time_cond and barstate.isconfirmed
    strategy.entry("SHORT",strategy.short)
    alert(sh_entryal,alert.freq_once_per_bar_close)

if strategy.position_size < 0
    strategy.exit("SHORT EX","SHORT",loss = sl,profit = tp,comment_loss = "SHORT SL",comment_profit = "SHORT TP")

//end

আরো