
এই কৌশলটি MACD সূচকের দ্বৈত সমান্তরাল ক্রস গণনা করে ক্রয় এবং বিক্রয়ের সময় নির্ধারণ করে। এটি একটি ট্রেডিং সংকেত দেওয়ার জন্য চার্টে একটি তীরের আকৃতি আঁকে।
এই কৌশলটি প্রথমে ফাস্ট লাইন (ইএমএ 12), লো লাইন (ইএমএ 26) এবং ম্যাকডের পার্থক্য গণনা করে। তারপরে এটি ক্রয় এবং বিক্রয়ের সময় নির্ধারণ করে, যা ফাস্ট লাইন এবং লো লাইনের গোল্ডেন ফর্ক এবং ম্যাকডের পার্থক্যের ধনাত্মক এবং বিয়োগের উপর নির্ভর করেঃ
মিথ্যা সংকেতগুলি ফিল্টার করার জন্য, কোডটি পূর্ববর্তী কে লাইনের সংকেতের অবস্থাও বিচার করে। কেবলমাত্র বর্তমান কে লাইনটি বিপরীত সংকেত হলে (ক্রয় বিক্রয় বা বিক্রয় ক্রয়) বর্তমান সংকেতটি ট্রিগার করা হবে।
এছাড়াও, কোডটিতে একটি তীরচিহ্ন রয়েছে যা কে-লাইনে কেনার এবং বিক্রি করার সময় নির্দেশ করে।
এই কৌশলটির সুবিধাগুলো হলঃ
এই কৌশলটির কিছু ঝুঁকিও রয়েছেঃ
এই কৌশলটি নিম্নলিখিত দিকগুলি থেকে অপ্টিমাইজ করা যেতে পারেঃ
ডাবল ইয়ারলাইন ক্রস অ্যারো কৌশলটি সামগ্রিকভাবে সহজ এবং ব্যবহারিক, ডাবল ইয়ারলাইন ক্রস বিচার এবং এমএসিডি ডিফারেনশিয়াল ফিল্টারিংয়ের মাধ্যমে মধ্য-লং লাইন প্রবণতার মধ্যে ক্রয়-বিক্রয় পয়েন্টগুলি সনাক্ত করা যায়, মূল্যের ঘূর্ণনগুলি এড়ানো যায়। তীরের ইঙ্গিতগুলিও অপারেশনকে আরও পরিষ্কার করে তোলে। পরবর্তীতে প্যারামিটার অপ্টিমাইজেশন, ফিল্টারিংয়ের শর্তগুলি যুক্ত করার মতো পদ্ধতির মাধ্যমে কৌশলটির স্থায়িত্ব এবং লাভের হার আরও বাড়ানো যেতে পারে।
/*backtest
start: 2022-11-14 00:00:00
end: 2023-11-20 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
//Daniels stolen code
strategy(shorttitle="Daniels Stolen Code", title="Daniels Stolen Code", overlay=true, calc_on_order_fills=true, pyramiding=0)
//Define MACD Variables
fast = 12, slow = 26
fastMACD = ema(hlc3, fast)
slowMACD = ema(hlc3, slow)
macd = fastMACD - slowMACD
signal = sma(macd, 9)
hist = macd - signal
currMacd = hist[0]
prevMacd = hist[1]
currPrice = hl2[0]
prevPrice = hl2[1]
buy = currPrice > prevPrice and currMacd > prevMacd
sell = currPrice < prevPrice and currMacd < prevMacd
neutral = (currPrice < prevPrice and currMacd > prevMacd) or (currPrice > prevPrice and currMacd < prevMacd)
//Plot Arrows
timetobuy = buy==1 and (sell[1]==1 or (neutral[1]==1 and sell[2]==1) or (neutral[1]==1 and neutral[2]==1 and sell[3]==1) or (neutral[1]==1 and neutral[2]==1 and neutral[3]==1 and sell[4]==1) or (neutral[1]==1 and neutral[2]==1 and neutral[3]==1 and neutral[4]==1 and sell[5]==1) or (neutral[1]==1 and neutral[2]==1 and neutral[3]==1 and neutral[4]==1 and neutral[5]==1 and sell[6]==1))
timetosell = sell==1 and (buy[1]==1 or (neutral[1]==1 and buy[2]==1) or (neutral[1]==1 and neutral[2]==1 and buy[3]==1) or (neutral[1]==1 and neutral[2]==1 and neutral[3]==1 and buy[4]==1) or (neutral[1]==1 and neutral[2]==1 and neutral[3]==1 and neutral[4]==1 and buy[5]==1) or (neutral[1]==1 and neutral[2]==1 and neutral[3]==1 and neutral[4]==1 and neutral[5]==1 and buy[6]==1))
plotshape(timetobuy, color=blue, location=location.belowbar, style=shape.arrowup)
plotshape(timetosell, color=red, location=location.abovebar, style=shape.arrowdown)
//plotshape(neutral, color=black, location=location.belowbar, style=shape.circle)
//Test Strategy
// strategy.entry("long", true, 1, when = timetobuy and time > timestamp(2017, 01, 01, 01, 01)) // buy by market if current open great then previous high
// strategy.close("long", when = timetosell and time > timestamp(2017, 01, 01, 01, 01))
strategy.order("buy", true, 1, when=timetobuy==1 and time > timestamp(2019, 01, 01, 01, 01))
strategy.order("sell", false, 1, when=timetosell==1 and time > timestamp(2019, 01, 01, 01, 01))
// strategy.entry(id = "Short", long = false, when = enterShort())
// strategy.close(id = "Short", when = exitShort())
//strategy.entry("long", true, 1, when = open > high[1]) // enter long by market if current open great then previous high
// strategy.exit("exit", "long", profit = 10, loss = 5) // ge