ডাবল মুভিং মিডিয়ার উপর ভিত্তি করে স্কেলপিং ট্রেডিং কৌশল

লেখক:চাওঝাং, তারিখঃ 2024-01-08 16:29:21
ট্যাগঃ

img

সারসংক্ষেপ

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

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

এই কৌশলটি দ্রুত ম্যাক হিসাবে একটি 6 পিরিয়ড আরএমএ এবং ধীর ম্যাক হিসাবে একটি 4 পিরিয়ড এইচএমএ ব্যবহার করে। এটি মূল্যের প্রবণতা বিচার করে এবং দ্রুত এবং ধীর লাইনের ক্রসওভারের উপর ভিত্তি করে ট্রেডিং সংকেত তৈরি করে।

যখন দ্রুত রেখা ধীর রেখার উপরে অতিক্রম করে, তখন এটি হ্রাস থেকে উত্থান পর্যন্ত একটি স্বল্পমেয়াদী প্রবণতা পরিবর্তন নির্দেশ করে, যা চিপ স্থানান্তরের সময়। সুতরাং একটি ক্রয় সংকেত উত্পন্ন হয়। বিপরীতভাবে, যখন দ্রুত রেখা ধীর রেখার নীচে অতিক্রম করে, তখন একটি বিক্রয় সংকেত উত্পন্ন হয়।

এছাড়াও, ট্রেন্ডের বিরুদ্ধে ট্রেডিং এড়ানোর জন্য দীর্ঘমেয়াদী প্রবণতা রায় দেওয়া হয়। প্রকৃত ক্রয় / বিক্রয় সংকেতগুলি কেবলমাত্র যখন দীর্ঘমেয়াদী প্রবণতা সংকেতের সাথে সামঞ্জস্য করে তখনই উত্পন্ন হয়।

সুবিধা

এই কৌশলটির সুবিধাগুলির মধ্যে রয়েছেঃ

  1. ডাবল এমএ ক্রসওভার কার্যকরভাবে স্বল্পমেয়াদী বিপরীত পয়েন্টগুলি চিহ্নিত করে।

  2. দ্রুত এবং ধীর এমএ দৈর্ঘ্যগুলি সঠিক সংকেত তৈরি করতে যুক্তিসঙ্গতভাবে একত্রিত করা হয়।

  3. দীর্ঘ/স্বল্পমেয়াদী প্রবণতা ফিল্টারিং বেশিরভাগ মিথ্যা সংকেত সরিয়ে দেয়।

  4. লাভ এবং স্টপ লস লজিক সক্রিয়ভাবে ঝুঁকি পরিচালনা করে।

  5. এটি বোঝা এবং বাস্তবায়ন করা সহজ, নতুনদের জন্য উপযুক্ত।

ঝুঁকি এবং সমাধান

এছাড়াও কিছু ঝুঁকি আছেঃ

  1. অনেক ছোট মুনাফা, কিন্তু একটা বড় ক্ষতি।

  2. ব্যাপ্তি সীমাবদ্ধ বাজারে ঘন ঘন ট্রেডিং।

  3. ওভারফিটিং প্যারামিটার, স্থিতিশীলতা পরীক্ষা প্রয়োজন।

  4. ট্রেন্ডিং মার্কেটের অধীনে দুর্বল পারফরম্যান্স। ট্রেন্ড মডিউল যুক্ত করুন বা ট্রেন্ড কৌশলগুলির সাথে একত্রিত করুন।

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

কৌশলটি অপ্টিমাইজ করার জন্য কিছু দিকনির্দেশঃ

  1. অ্যাডাপ্টিভ কালমান ফিল্টার ইত্যাদি দিয়ে এমএ আপগ্রেড করুন।

  2. সিগন্যালের নির্ভুলতা বাড়াতে এমএল মডেল যোগ করুন।

  3. ঝুঁকি নিয়ন্ত্রণ স্বয়ংক্রিয় করার জন্য মূলধন ব্যবস্থাপনা মডিউল যোগ করুন।

  4. শক্তিশালী সংকেতের জন্য উচ্চ-ফ্রিকোয়েন্সি ফ্যাক্টরগুলির সাথে একত্রিত করুন।

  5. পণ্যগুলির মধ্যে ক্রস-মার্কেট আর্বিট্রেজ।

সিদ্ধান্ত

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


/*backtest
start: 2023-12-31 00:00:00
end: 2024-01-07 00:00:00
period: 3m
basePeriod: 1m
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/
// © dc_analytics
// https://datacryptoanalytics.com/


//@version=5
strategy("Scalping Trading", overlay=true)

//  INPUTS  //
bar_color       = input(true, title='Bar Color', group='⚙ Settings',tooltip='Color chart bars.', inline = "1")
mostrar         = input(true, 'Show Alerts', group='⚙ Settings', inline = "1")
tempo           = input.timeframe('60', group='⚙ Settings', title='🕗 Timeframe', options=['1', '5', '15', '30', '60', '120', '240', '360', '720', 'D', 'W'])

i_position      = input.string("Bottom Center", title = "⚙ D-Panel Location", 
 options = ["Top Right", "Bottom Center", "Bottom Right"], group='⚙ D-Panel Settings️',
 tooltip='Choose the location of the information table on the chart.(D-Panel) ')

position        = i_position == "Top Right" ? position.top_right : i_position == "Bottom Center" ? position.bottom_center : position.bottom_right

i_tam           = input.string('Big', title = '⚙ D-Painel Size', 
 options = ["Tiny", "Small", "Big"], group='⚙ D-Panel Settings️',tooltip='Choose the size of the information panel (D-Panel).')

tamanho         = i_tam == "Tiny" ? size.tiny : i_tam == "Small" ? size.small : size.normal

show_tp_sl      = input(true, title='Show Take Profit/Stop Loss', group='⚙ Settings',tooltip='Show Take Profit/Stop Loss.')
TP              = input.float(defval=4500, title='Take Profit:',group='⚙ Risk Management',tooltip='Choose amount of profit')
SL              = input.float(defval=2500, title='Stop Loss:', group='⚙ Risk Management',tooltip='Choose amount of loss') 
//  END INPUTS  //


//  DECLARATIONS  //
t_up    = '📈'
t_down  = '📉'

c_buy   = 'Long ⇡'
c_sell  = 'Short ⇣'

// _DECLARATION TREND
t_sma       = ta.hma(close, 200)
tend_sma    = ta.sma(close, 12)

tendencia   = request.security(syminfo.tickerid, timeframe.period, t_sma, barmerge.gaps_off, barmerge.lookahead_off)
tend_tabela = request.security(syminfo.tickerid, timeframe.period, tend_sma, barmerge.gaps_off, barmerge.lookahead_off)
// _END DECLARATION TREND

circle = plot.style_circles
//  END DECLARATIONS  //


//  COLORS  //
color gray   = color.gray
color red    = color.new(#ff8c05, 0)
color orange = color.new(#ff8c05, 0)
color silver = color.silver
color up_vol = color.new(color.green, 0)
color dn_vol = color.new(color.purple, 0)

color orange_tranp  = color.new(#ff8c05, 95)
// END COLORS //

//  SCANNER MARKET MAKERS  //
periodo  = input.int(20, 'Period Volume', group='⚙️ Scanner Market Makers Settings')
fator    = input.float(1.85, 'Proportion to the mean: (1.25 = 125% of the mean)', minval=0, group='⚙️ Scanner Market Makers Settings')
vol_up   = close > open
vol_down = open > close
vol      = volume
pesado   = volume > ta.ema(volume, periodo) * fator

palette  = pesado and vol_up ? gray : pesado and vol_down ? orange : vol_up ? silver : gray
//  END SCANNER MARKET MAKERS  //


//  LOGIC ONE  //
s = ta.rma(close, 6)
v = ta.hma(close, 4)

//  TREND  
t_baixa     = tendencia > tendencia[1]
t_alta      = tendencia < tendencia[1]

te_d        = tend_tabela > tend_tabela[1]
trend       = te_d ? t_up : t_down
//  END TREND  

a = request.security(syminfo.tickerid, tempo, s)
b = request.security(syminfo.tickerid, tempo, ohlc4)

c_dn   = a > b and a[1] < b[1]
c_up   = b > a and b[1] < a[1]

compra = mostrar and c_up ? a : na
venda  = mostrar and c_dn ? a : na

s_sell = venda and t_alta
s_buy  = compra and t_baixa
c_vela = b > a and te_d ? gray : orange

s_up = false
s_dw = false

b_sinal = not s_up and s_buy
s_sinal = not s_dw and s_sell

if b_sinal
    s_dw := false
    s_up := true
    s_up

if s_sinal
    s_dw := true
    s_up := false
    s_up

// END LOGIC ONE //


//  DATA TABLE  //
c = b > a ? orange : gray 
c_sinal = b > a ? c_buy : c_sell
//  END DATA TABLE  //


//  PLOT/BARCOLOR  //
c_barcolor = pesado and vol_up ? up_vol : pesado and vol_down ? dn_vol : vol_up ? c : c

barcolor(bar_color ? c_barcolor : na)
plot(a, color=orange_tranp, style=circle)
//  END PLOT/BARCOLOR  //


//  TABLE  //
var dash = table.new(position=position, columns=2, rows=3, border_width=1)
if barstate.islast
    table.cell(table_id=dash, column=1, row=2, text='Scalping DCA', bgcolor=orange)
    table.cell(table_id=dash, column=1, row=0, text='Trade: ' + c_sinal)
    table.cell(table_id=dash, column=1, row=1, text='Trend: ' + trend)
//  END TABLE  //


//  SETTINGS STRATEGY  //
exitPrice = strategy.closedtrades.exit_price(strategy.closedtrades - 1)

// OPEN ORDER
if (b_sinal)
    strategy.order("Long", strategy.long , comment = "Entry: " + str.tostring(close, "#.####"))
//    strategy.exit("EXIT", trail_points = 1000, trail_offset = 0, comment_trailing = "Close with Profit: " + str.tostring(close, "#.####"))
//    strategy.entry("long", strategy.long)

if (s_sinal)
    strategy.order("Short", strategy.short , comment = "Entry: " + str.tostring(close, "#.####"))
//    strategy.exit("EXIT", trail_points = 1000, trail_offset = 0, comment_trailing = "Close with Profit: " + str.tostring(close, "#.####"))
//    strategy.entry("short", strategy.short)

//  TP/SL ORDERS
if strategy.position_size > 0
    strategy.exit('Long_Close', 'Long',profit = TP , loss=SL, qty_percent=100, comment_profit = "Profit Long: " + str.tostring(exitPrice, "#.####"), comment_loss = "Stop Long: " + str.tostring(exitPrice, "#.####"))
//if  strategy.position_size > 0
//    strategy.exit("Long", "Long", stop = longSL, limit = longTP, comment_profit = "Profit Long: " + str.tostring(exitPrice, "#.####"), comment_loss = "Stop Long: " + str.tostring(exitPrice, "#.####"))
    
if strategy.position_size < 0
    strategy.exit('Short_Close', 'Short',profit = TP, loss=SL, qty_percent=100, comment_profit = "Profit Short: " + str.tostring(exitPrice, "#.####"), comment_loss = "Stop Short: " + str.tostring(exitPrice, "#.####"))
//if strategy.position_size < 0
//    strategy.exit("Short", "Short", stop = shortSL, limit = shortTP, comment_profit = "Profit Short: "+ str.tostring(exitPrice, "#.####"), comment_loss = "Stop Short: " + str.tostring(exitPrice, "#.####")) 

//  END SETTINGS STRATEGY  //

// LOGS 
// if strategy.opentrades > 10
//     log.warning("{0} positions opened in the same direction in a row. Try adjusting `bracketTickSizeInput`", strategy.opentrades)

// last10Perc = strategy.initial_capital / 10 > strategy.equity
// if (last10Perc and not last10Perc[1])
//     log.error("The strategy has lost 90% of the initial capital!")

আরো