
এই কৌশলটি একটি ট্রেন্ড ট্র্যাকিং গ্রিড কৌশল যা কেবলমাত্র বেশি এবং খালি না করে, বড় ট্রেন্ডের সময়কালের জন্য ট্রেন্ড ট্র্যাকিং গ্রিড কৌশল। ডিফল্ট গ্রিডের আকারটি 1x এটিআর, ডাউন ট্র্যাকিংয়ের জন্য 1, 2, 3 স্তরের গ্রিড স্থাপন করা হয়, 5 ম স্তর বন্ধ হয়ে যায়। যখন খালি স্টোরটি একটি গ্রিডকে ভেঙে দেয়, তখন পুরো গ্রিডটি উপরে চলে যায়।
এই কৌশলটি ইএমএর মাধ্যমে বড় প্রবণতার দিক নির্ধারণ করে, তারপরে গ্রিড কৌশলটির সাথে মিলিত হয়, যা বড় প্রবণতার ঊর্ধ্বমুখী প্রবণতার ক্ষেত্রে আরও বেশি লাভ অর্জন করতে পারে। গ্রিডটি একাধিক মূল্য পয়েন্ট স্থাপন করে, একটি পজিশনের ঝুঁকি হ্রাস করতে পারে। স্টপ লস সেটিংটি লাভকে লক করতে দেয় এবং সর্বাধিক ক্ষতি নিয়ন্ত্রণ করে। যখন পজিশনটি সম্পূর্ণরূপে পজিশনে থাকে, তখন গ্রিডের উচ্চতা পুনরায় গণনা করতে পারে, আবার পজিশন খোলার জন্য, যার ফলে লাভের সর্বাধিকীকরণ করা যায়।
এই কৌশলটির প্রধান সুবিধা হল ট্রেন্ড ট্রেডিং এবং গ্রিড ট্রেডিংয়ের সংমিশ্রণ, যা ট্রেন্ডের দিকনির্দেশের সঠিকতা নিশ্চিত করে এবং গ্রিড কৌশলটির ঝুঁকি বিচ্ছিন্নতা অর্জন করে। এছাড়াও, পজিশনের সমতল হওয়ার পরে গ্রিডটি পুনরায় গণনা করা যায়, যার ফলে বাজারে একটি বড় ঢেউ দেখা দিলে প্রচুর অর্থ উপার্জন করা যায়।
মূল ঝুঁকিটি হ’ল বড় প্রবণতাটি ভুলভাবে বিচার করা, যার ফলে বিপরীতমুখী অবস্থান তৈরি করা এবং ব্যাপক ক্ষতি হতে পারে। তদুপরি, যদি বাজারে তীব্র ঝড় হয়, তবে একাধিক গ্রিড একই সাথে বন্দী হয়ে গেলে ক্ষতি আরও বাড়বে। দামের দ্রুত পতন স্টপ লসকে ট্রিগার করার কারণে পজিশনটি সম্পূর্ণরূপে খালি হয়ে যায় এবং পরবর্তী লাভের সুযোগ হারাতে পারে। দামের প্রত্যাবর্তনের পরে প্রাথমিক সেরা গ্রিড পজিশনে প্রবেশ করা খুব কঠিন।
EMA প্যারামিটারগুলিকে অপ্টিমাইজ করে বড় প্রবণতা নির্ধারণের নির্ভুলতা বাড়ানো যেতে পারে। গ্রিডের ব্যবধান এবং প্রথম আদেশের সংখ্যা সামঞ্জস্য করাও সামগ্রিক ক্ষতি নিয়ন্ত্রণ করতে পারে। স্টপ পয়েন্টের অবস্থান সেট করার জন্য বাজারের ওঠানামার ফ্রিকোয়েন্সি বিবেচনা করা দরকার। এছাড়াও, এটি বিবেচনা করা যেতে পারে যে কিছু পজিশন লাভজনক হওয়ার পরে বন্ধ হয়ে যায়, সমস্ত পজিশন খালি না করে।
এই কৌশলটি নিম্নলিখিত দিকগুলি থেকে অপ্টিমাইজ করা যেতে পারেঃ
এই অপ্টিমাইজেশানগুলি ব্যবহার করে, কৌশলগুলি বড় আকারের পরিস্থিতিতে আরও বেশি লাভ অর্জন করতে পারে এবং ঝুঁকি নিয়ন্ত্রণ করতে পারে এবং স্বাভাবিক অস্থিরতার মধ্যে ক্ষতি হ্রাস করতে পারে।
এই কৌশলটি প্রবণতা ট্রেডিং এবং গ্রিড ট্রেডিংয়ের একটি জৈবিক সংমিশ্রণ। এটি ইএমএ ব্যবহার করে বড় দিক নির্ধারণ করে এবং তারপরে গ্রিড কৌশলটি ব্যবহার করে ধারাবাহিকভাবে পজিশন তৈরি করে। ঝুঁকি নিয়ন্ত্রণ করা হয়, স্টপ লস এবং পুনরায় গণনা করা গ্রিডের ট্র্যাকিং প্রক্রিয়া রয়েছে। সামগ্রিকভাবে, কৌশলটি বাজারের বড় প্রবণতার মধ্যে ভাল মুনাফা অর্জন করতে পারে এবং ঝুঁকিও নিয়ন্ত্রণ করে। যদি প্যারামিটারগুলি আরও অপ্টিমাইজ করা হয় এবং বিচার সঠিকতা বাড়ানো হয় তবে উপার্জন আরও বেশি মূল্যবান হতে পারে।
/*backtest
start: 2022-12-01 00:00:00
end: 2023-12-07 00:00:00
period: 1d
basePeriod: 1h
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/
// © zxcvbnm3260
//@version=5
strategy("grid strategy long", overlay=true)
// 版本更新记录:
// v1.0 2021/11/09 只做多、不做空,选择大趋势向上的时间段。网格大小默认为1倍ATR,往下1、2、3个网格吃单,第5个网格止损。空仓时到达往上一个网格则网格整体抬升。(Only go long, not short, choose a time period when the general trend is up. The default grid size is 1x ATR, the next one, two, and three grids will take orders, and the fifth grid will stop loss. When the empty position reaches the upper grid, the grid as a whole rises.)
X_ATR = input.float(title='网格大小是多少倍ATR?', defval = 1)
// 1.基础变量
ema169 = ta.ema(close, 169)
ema144 = ta.ema(close, 144)
ema12 = ta.ema(close, 12)
ema576 = ta.ema(close, 576)
ema676 = ta.ema(close, 676)
plot(ema169, color=color.new(color.orange, 0), linewidth=2)
// plot(ema144, color=color.orange)
plot(ema12, color=color.blue)
// plot(ema676, color=color.orange, linewidth=1)
mtr = math.max(high - low, math.abs(close[1] - high), math.abs(close[1] - low))
atr = ta.ema(mtr, 30)
is_0930 = hour(time, 'GMT-4') == 9 and minute(time, 'GMT-4') == 30
is_1500 = hour(time, 'GMT-4') == 15 and minute(time, 'GMT-4') == 00
is_1530 = hour(time, 'GMT-4') == 15 and minute(time, 'GMT-4') == 30
is_yangxian = close>open
is_yinxian = close<open
// 2.基本趋势标记
big_trend = ema12 >= ema169 ? 1 : 0
big_trend2 = ema12 <= ema169 ? 1 : 0
// 背景的变色处理:
bgcolor(big_trend == 1 ? color.new(color.green, 90) : color.new(color.red, 90) )
// 3.网格点位初始化
grid_size = atr * X_ATR // 网格大小
price_entry1 = open - grid_size*1
price_entry2 = open - grid_size*2
price_entry3 = open - grid_size*3
price_stop_loss = open - grid_size*5
price_exit1 = price_entry1 + grid_size*1
price_exit2 = price_entry2 + grid_size*1
price_exit3 = price_entry3 + grid_size*1
qty1 = int(1000/price_entry1)
qty2 = int(1000/price_entry2)
qty3 = int(1000/price_entry3)
// 标出各种点位
slm_lines_time(time, price_entry1, price_entry2, price_entry3, price_stop_loss, price_exit1)=>
time2 = time + 1000*3600*24*5
line.new(time, price_stop_loss, time2, price_stop_loss, color=color.red, xloc = xloc.bar_time, width=2) // 止损位
line.new(time, price_entry1, time2, price_entry1, color=color.green, xloc = xloc.bar_time) //
line.new(time, price_entry2, time2, price_entry2, color=color.green, xloc = xloc.bar_time) //
line.new(time, price_entry3, time2, price_entry3, color=color.green, xloc = xloc.bar_time) //
line.new(time, price_exit1, time2, price_exit1, color=color.green, xloc = xloc.bar_time, width=2) //
slm_lines(time, price_entry1, price_entry2, price_entry3, price_stop_loss, price_exit1)=>
line.new(bar_index, price_stop_loss, bar_index[5], price_stop_loss, color=color.red, xloc = xloc.bar_index, width=2) // 止损位
line.new(bar_index, price_entry1, bar_index[5], price_entry1, color=color.green, xloc = xloc.bar_index) //
line.new(bar_index, price_entry2, bar_index[5], price_entry2, color=color.green, xloc = xloc.bar_index) //
line.new(bar_index, price_entry3, bar_index[5], price_entry3, color=color.green, xloc = xloc.bar_index) //
line.new(bar_index, price_exit1, bar_index[5], price_exit1, color=color.green, xloc = xloc.bar_index, width=2) //
// 4.网格点位更新和下单
is_entry0 = big_trend==1 and year>=2020
var is_entry = false
// 未进场时:
if is_entry0 and not is_entry
is_entry := true
grid_size := atr * X_ATR // 网格大小
price_entry1 := close - grid_size*1
price_entry2 := close - grid_size*2
price_entry3 := close - grid_size*3
price_stop_loss := close - grid_size*5
price_exit1 := price_entry1 + grid_size*1
price_exit2 := price_entry2 + grid_size*1
price_exit3 := price_entry3 + grid_size*1
qty1 := int(1000/price_entry1)
qty2 := int(1000/price_entry2)
qty3 := int(1000/price_entry3)
// slm_lines(time, price_entry1, price_entry2, price_entry3, price_stop_loss, price_exit1)
strategy.entry("open1", strategy.long, qty1, limit = price_entry1)
strategy.entry("open2", strategy.long, qty2, limit = price_entry2)
strategy.entry("open3", strategy.long, qty3, limit = price_entry3)
strategy.exit("close1", qty = qty1, limit = price_exit1, stop = price_stop_loss)
strategy.exit("close2", qty = qty2, limit = price_exit2, stop = price_stop_loss)
strategy.exit("close3", qty = qty3, limit = price_exit3, stop = price_stop_loss)
// 已进场的各类情况
// 1.止损
if is_entry and close <= price_stop_loss
strategy.close_all()
is_entry := false
// 2.网格抬升
if is_entry and close >= price_exit1
is_entry := false