ইএমএ ক্রসওভারের উপর ভিত্তি করে কৌশল অনুসরণ করে প্রবণতা

লেখক:চাওঝাং, তারিখ: ২০২৩-০৯-১৫ 11:51:34
ট্যাগঃ

এই নিবন্ধটি ট্রেডিং সংকেত তৈরির জন্য ইএমএ ক্রসওভার ব্যবহার করে একটি প্রবণতা অনুসরণকারী কৌশল বিস্তারিতভাবে ব্যাখ্যা করে। এটি চলমান গড় পরামিতিগুলিকে অনুকূলিতকরণের মাধ্যমে কৌশল স্থিতিশীলতা উন্নত করার লক্ষ্যে।

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

মূল নিয়মগুলো হল:

  1. দামের পরিবর্তনের সংবেদনশীলতার জন্য দ্রুত EMA এবং প্রবণতার জন্য ধীর EMA দিয়ে দ্রুত EMA এবং ধীর EMA সেট করুন।

  2. ধীর EMA এর উপরে দ্রুত EMA ক্রসওভারে লম্বা যান এবং নীচে ক্রসওভারে শর্ট যান।

  3. মিথ্যা সংকেত হ্রাস করার জন্য EMA অনুপাত সেট করুন যেখানে ধীর সময় ≥ 3 বার দ্রুত সময়।

  4. বিপরীত প্রবণতা ট্রেড এড়ানোর জন্য শুধুমাত্র দীর্ঘ মোডের জন্য বিকল্প।

  5. প্যারামিটার অপ্টিমাইজেশনের জন্য কাস্টমাইজযোগ্য ব্যাকটেস্ট সময়কাল।

ইএমএ পরামিতিগুলি সামঞ্জস্য করে, প্রবণতা থেকে মুনাফা অর্জনের জন্য সংবেদনশীলতা এবং স্থিতিশীলতা ভারসাম্যপূর্ণ করা যেতে পারে।

২. কৌশলটির সুবিধা

সবচেয়ে বড় সুবিধা হল ব্যবহারের সহজতা, যা সময় সীমিত ব্যবসায়ীদের জন্য উপযুক্ত।

আরেকটি সুবিধা হল প্যারামিটার অপ্টিমাইজেশনের মাধ্যমে হুইপসকে হ্রাস করার ক্ষমতা।

অবশেষে, দীর্ঘ শুধুমাত্র মোডটি বিপরীত প্রবণতা ট্রেডগুলি এড়ায় এবং স্টকগুলির মতো নির্দিষ্ট বাজারে ফিট করে।

৩. সম্ভাব্য দুর্বলতা

যাইহোক, কিছু সমস্যা আছেঃ

প্রথমত, ইএমএ-র অন্তর্নিহিতভাবে পিছিয়ে যাওয়া ইস্যু রয়েছে, যার ফলে অনুকূল এন্ট্রিগুলি মিস করা হয়।

দ্বিতীয়ত, ভুল সেটিংস ওভার ফিল্টারিং হতে পারে যা মিসড ট্রেডের কারণ হতে পারে।

অবশেষে, স্টপ লস এবং লাভ নেওয়ার ব্যবস্থা উন্নত করা দরকার।

IV. সংক্ষিপ্ত বিবরণ

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


/*backtest
start: 2023-08-15 00:00:00
end: 2023-09-12 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
// 
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © gregoirejohnb
//
// Moving average crossover systems measure drift in the market. They are great strategies for time-limited people.
// So, why don't more people use them?
// 
// I think it's due to poor choice in choosing EMA lengths: Market Wizard Ed Seykota has a guideline for moving average crossovers: the slow line should be at least 3x the fast line.
// This removes a lot of the whipsaws inherent in moving average systems, which means greater profitability.
// His other piece of advice: long-only strategies are best in stock markets where there's a lot more upside potential.
//
// Using these simple rules, we can reduce a lot of the whipsaws and low profitability trades! This strategy was made so you can see for yourself before trading.
//
// === HOW TO USE THIS INDICATOR ===
// 1) Choose your market and timeframe.
// 2) Choose the length.
// 3) Choose the multiplier.
// 4) Choose if the strategy is long-only or bidirectional. 
//
// Don't overthink the above! We don't know the best answers, that's why this strategy exists! We're going to test and find out.
//  After you find a good combination, set up an alert system with the default Exponential Moving Average indicators provided by TradingView.
//
// === TIPS ===
// Increase the multiplier to reduce whipsaws (back and forth trades).
// Increase the length to take fewer trades, decrease the length to take more trades.
// Try a Long-Only strategy to see if that performs better.
//
strategy(title="EMA Crossover Strategy", shorttitle="EMA COS", overlay=true, pyramiding=0, default_qty_type=strategy.percent_of_equity, default_qty_value=10, currency=currency.USD,commission_type=strategy.commission.percent,commission_value=0.1)

// === GENERAL INPUTS ===
//strategy start date
start_year = input(defval=2020, title="Backtest Start Year")

// === LOGIC ===
length = input(type=input.integer,defval=20,minval=1,title="Length")
ratio = input(type=input.integer,defval=3,title="Multiplier (3x length, 4x length, etc)",options=[3,4,5,6,7,8,9,10])
longOnly = input(type=input.bool,defval=false,title="Long Only")
fast = ema(hl2,length)
slow = ema(hl2,length * ratio)
plot(fast,linewidth=2,color=color.orange,title="Fast")
plot(slow,linewidth=2,color=color.blue,title="Slow")

longEntry = crossover(fast,slow)
shortEntry = crossunder(fast,slow)

plotshape(longEntry ? close : na,style=shape.triangleup,color=color.green,location=location.belowbar,size=size.small,title="Long Triangle")
plotshape(shortEntry and not longOnly ? close : na,style=shape.triangledown,color=color.red,location=location.abovebar,size=size.small,title="Short Triangle")
plotshape(shortEntry and longOnly ? close : na,style=shape.xcross,color=color.black,location=location.abovebar,size=size.small,title="Exit Sign")

// === STRATEGY - LONG POSITION EXECUTION ===
enterLong() =>
    crossover(fast,slow) and 
       time > timestamp(start_year, 1, 1, 01, 01)
exitLong() =>
    longOnly and crossunder(fast,slow)
strategy.entry(id="Long", long=strategy.long, when=enterLong())
strategy.close(id="Long", when=exitLong())
// === STRATEGY - SHORT POSITION EXECUTION ===
enterShort() =>
    not longOnly and crossunder(fast,slow) and 
       time > timestamp(start_year, 1, 1, 01, 01)
exitShort() =>
    false
strategy.entry(id="Short", long=strategy.short, when=enterShort())
strategy.close(id="Short", when=exitShort())

আরো