
আলিগ্যাটার দীর্ঘমেয়াদী ট্রেডিং কৌশল হল একটি পরিমাণগত ট্রেডিং কৌশল যা উইলিয়ামস আলিগ্যাটার সূচকের উপর ভিত্তি করে তৈরি করা হয়। এই কৌশলটি বিভিন্ন সময়কালের চলমান গড়ের সমন্বয় ব্যবহার করে বাজারের মূল প্রবণতা ক্যাপচার করে। এটি মাঝারি এবং দীর্ঘমেয়াদী ট্রেডিংয়ের জন্য প্রবণতা অনুসরণ করে। কৌশলটির মূল ধারণাটি হ’ল আলিগ্যাটার সূচকের খোলার দিক এবং দামের আলিগ্যাটার সূচকের সাথে তুলনামূলক অবস্থানের মাধ্যমে প্রবণতার দিকনির্দেশ এবং শক্তি বিচার করা, যাতে ট্রেডিংয়ের সিদ্ধান্ত নেওয়া যায়।
আলিগ্যাটার সূচকটি তৈরি করার জন্য আলিগ্যাটার দীর্ঘমেয়াদী ট্রেন্ড ট্র্যাকিং ট্রেডিং কৌশলটি তিনটি পৃথক পিরিয়ডের চলমান গড় ব্যবহার করেঃ
যখন Alligator সূচকের খোলার দিকটি উপরে থাকে, অর্থাৎ Jaw লাইনটি নীচে, Teeth লাইনটি মাঝখানে এবং Lips লাইনটি শীর্ষে থাকে এবং দামটি Alligator সূচকের উপরে থাকে, তখন কৌশলটি আরও বেশি পজিশন খুলবে। এই পরিস্থিতিটি ইঙ্গিত দেয় যে একটি ঊর্ধ্বমুখী প্রবণতা তরঙ্গ নিশ্চিত হয়ে গেছে এবং আমরা প্রবণতা শেষ না হওয়া পর্যন্ত পজিশনটি ধরে রাখতে চাই।
যখন দাম Jaw Line এর নিচে চলে যায়, তখন কৌশলটি পল্টন করে দেয়। এটি নিশ্চিত করে যে আমরা একটি ভাল বাজার চলাকালীন আমাদের অবস্থান ধরে রাখব না।
Alligator দীর্ঘমেয়াদী প্রবণতা ট্র্যাকিং ট্রেডিং কৌশল একটি সহজ, সহজ ব্যবহার, ব্যাপক পরিসীমা পরিমাণগত ট্রেডিং কৌশল। Alligator সূচক ব্যবহার করে বাজারের প্রধান প্রবণতা ক্যাপচার করে, কৌশলটি মাঝারি বা দীর্ঘমেয়াদে স্থিতিশীল আয় অর্জন করতে পারে। যদিও কৌশলটিতে কিছু সম্ভাব্য ঝুঁকি রয়েছে, তবে ঝুঁকি ব্যবস্থাপনা মডিউল, অন্যান্য প্রযুক্তিগত সূচকগুলির সাথে মিলিত এবং প্যারামিটার সেটিংয়ের অনুকূলিতকরণের মতো পদ্ধতিগুলি যুক্ত করে কৌশলটির কার্যকারিতা এবং স্থায়িত্বকে আরও উন্নত করা যেতে পারে।
/*backtest
start: 2023-05-11 00:00:00
end: 2024-05-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//_______ <licence>
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Skyrex
//_______ <version>
//@version=5
//_______ <declaration_statement>
strategy(title = "Alligator Long Term Trend Following Strategy [Skyrex.io]",
shorttitle = "Alligator Strategy [Skyrex.io]",
overlay = true,
format = format.inherit,
pyramiding = 1,
calc_on_order_fills = false,
calc_on_every_tick = true,
default_qty_type = strategy.percent_of_equity,
default_qty_value = 100,
initial_capital = 10000,
currency = currency.NONE,
commission_type = strategy.commission.percent,
commission_value = 0.1,
slippage = 5)
//_______ <constant_declarations>
var color skyrexGreen = color.new(#2ECD99, 0)
var color skyrexGray = color.new(#F2F2F2, 0)
var color skyrexWhite = color.new(#FFFFFF, 0)
var color barcolor = na
//_______ <inputs>
// Trading bot settings
sourceUuid = input.string(title = "sourceUuid:", defval = "yourBotSourceUuid", group = "Trading Bot Settings")
secretToken = input.string(title = "secretToken:", defval = "yourBotSecretToken", group = "Trading Bot Settings")
// Trading Period Settings
lookBackPeriodStart = input(title = "Trade Start Date/Time", defval = timestamp('2023-01-01T00:00:00'), group = "Trading Period Settings")
lookBackPeriodStop = input(title = "Trade Stop Date/Time", defval = timestamp('2025-01-01T00:00:00'), group = "Trading Period Settings")
//_______ <function_declarations>
//@function Used to calculate Simple moving average for Alligator
//@param src Sourse for smma Calculations
//@param length Number of bars to calculate smma
//@returns The calculated smma value
smma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? ta.sma(src, length) : (smma[1] * (length - 1) + src) / length
smma
//@function Used to decide if current candle above the Alligator
//@param jaw Jaw line of an Alligator
//@param teeth Teeth line of an Alligator
//@param lips Lips line of an Alligator
//@returns Bool value
is_LowAboveAlligator(jaw, teeth, lips) =>
result = low > jaw and low > lips and low > teeth
result
//@function Used to decide if current candle below the Alligator
//@param jaw Jaw line of an Alligator
//@param teeth Teeth line of an Alligator
//@param lips Lips line of an Alligator
//@returns Bool value
is_HighBelowAlligator(jaw, teeth, lips) =>
result = high < jaw and high < lips and high < teeth
result
//@function Used to decide if Alligator's mouth is open
//@param jaw Jaw line of an Alligator
//@param teeth Teeth line of an Alligator
//@param lips Lips line of an Alligator
//@returns Bool value
is_AlligatorHungry(jaw, teeth, lips) =>
result = lips > jaw[5] and lips > teeth[2] and teeth > jaw[3]
result
//_______ <calculations>
jaw = smma(hl2, 13)[8]
teeth = smma(hl2, 8)[5]
lips = smma(hl2, 5)[3]
jaw_o = smma(hl2, 13)
teeth_o = smma(hl2, 8)
lips_o = smma(hl2, 5)
//_______ <strategy_calls>
longCondition = is_LowAboveAlligator(jaw, teeth, lips) and is_AlligatorHungry(jaw_o, teeth_o, lips_o)
if (longCondition)
strategy.entry(id = "entry1", direction = strategy.long, alert_message = '{\n"base": "' + syminfo.basecurrency + '",\n"quote": "' + syminfo.currency + '",\n"position": "entry1",\n"price": "' + str.tostring(close) + '",\n"sourceUuid": "' + sourceUuid + '",\n"secretToken": "' + secretToken + '",\n"timestamp": "' + str.tostring(timenow) + '"\n}')
if close < jaw
strategy.close(id = "entry1", alert_message = '{\n"base": "' + syminfo.basecurrency + '",\n"quote": "' + syminfo.currency + '",\n"position": "close",\n"price": "' + str.tostring(close) + '",\n"sourceUuid": "' + sourceUuid + '",\n"secretToken": "' + secretToken + '",\n"timestamp": "' + str.tostring(timenow) + '"\n}')
//_______ <visuals>
if strategy.opentrades > 0
barcolor := skyrexGreen
else
barcolor := skyrexGray
barcolor(barcolor)
//_______ <alerts>