
এই কৌশলটি একটি উচ্চ-ফ্রিকোয়েন্সি ট্রেডিং সিস্টেম যা ওপেন-রেঞ্জের উপর ভিত্তি করে এবং ট্রেডিংয়ের দিন সকাল 9:30-9:45 এর মধ্যে গঠিত মূল্যের ব্যাপ্তির উপর দৃষ্টি নিবদ্ধ করে। কৌশলটি 15 মিনিটের এই ব্যাপ্তিটি অতিক্রম করে কিনা তা পর্যবেক্ষণ করে ট্রেডিং সিদ্ধান্ত গ্রহণ করে, যখন ঝুঁকি-লাভের সর্বোত্তম সমন্বয় অর্জনের জন্য গতিশীল স্টপ-লস এবং লাভের সেটিংয়ের সাথে মিলিত হয়। সিস্টেমটিতে ট্রেডিং ডে ফিল্টারিংয়ের বৈশিষ্ট্যও রয়েছে যা বিভিন্ন সময়সীমার বাজারের বৈশিষ্ট্য অনুসারে নির্বাচনীভাবে বাণিজ্য করতে পারে।
কৌশলটির কেন্দ্রীয় যুক্তি হল প্রতিটি ট্রেডিং দিবসের খোলার 15 মিনিটের মধ্যে (৯ঃ৩০-৯ঃ৪৫ ইএসটি) একটি মূল্যের ব্যাপ্তি তৈরি করা, এই সময়ের মধ্যে সর্বোচ্চ এবং সর্বনিম্ন মূল্য রেকর্ড করা। একবার ব্যাপ্তি তৈরি হয়ে গেলে, কৌশলটি সেই দিনের দুপুরের আগে মূল্যের ব্রেকডাউন পর্যবেক্ষণ করবেঃ
এটি একটি যুক্তিসঙ্গত, যুক্তিসঙ্গতভাবে কঠোর ওপেনিং ব্রেকিং কৌশল যা বাজারের সবচেয়ে সক্রিয় সময়গুলিতে ফোকাস করে ট্রেডিংয়ের সুযোগগুলি ধরার জন্য ডিজাইন করা হয়েছে। কৌশলটির সুবিধাগুলি তার স্পষ্ট ট্রেডিং লজিক এবং উন্নত ঝুঁকি নিয়ন্ত্রণের ব্যবস্থা রয়েছে, তবে এটির সাথে ভুয়া ব্রেকিং এবং বাজার পরিবেশের উপর নির্ভরশীলতার মতো সম্ভাব্য ঝুঁকিগুলিও রয়েছে। ক্রমাগত অপ্টিমাইজেশন এবং পরিমার্জনের মাধ্যমে, কৌশলটি প্রকৃত লেনদেনের ক্ষেত্রে স্থিতিশীল উপার্জনের সম্ভাবনা রয়েছে।
/*backtest
start: 2025-01-21 00:00:00
end: 2025-01-24 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Binance","currency":"DOGE_USDT"}]
args: [["MaxCacheLen",580,358374]]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © UKFLIPS69
//@version=6
strategy("ORB", overlay=true, fill_orders_on_standard_ohlc = true)
trade_on_monday = input(false, "Trade on Monday")
trade_on_tuesday = input(true, "Trade on Tuesday")
trade_on_wednesday = input(true, "Trade on Wednesday")
trade_on_thursday = input(false, "Trade on Thursday")
trade_on_friday = input(true, "Trade on Friday")
// Get the current day of the week (1=Monday, ..., 6=Saturday, 0=Sunday)
current_day = dayofweek(time)
current_price = request.security(syminfo.tickerid, "1", close)
// Define trading condition based on the day of the week
is_trading_day = (trade_on_monday and current_day == dayofweek.monday) or
(trade_on_tuesday and current_day == dayofweek.tuesday) or
(trade_on_wednesday and current_day == dayofweek.wednesday) or
(trade_on_thursday and current_day == dayofweek.thursday) or
(trade_on_friday and current_day == dayofweek.friday)
// ─── Persistent variables ─────────────────────────
var line orHighLine = na // reference to the drawn line for the OR high
var line orLowLine = na // reference to the drawn line for the OR low
var float orHigh = na // stores the open-range high
var float orLow = na // stores the open-range low
var int barIndex930 = na // remember the bar_index at 9:30
var bool rangeEstablished = false
var bool tradeTakenToday = false // track if we've opened a trade for the day
// ─── Detect times ────────────────────────────────
is930 = (hour(time, "America/New_York") == 9 and minute(time, "America/New_York") == 30)
is945 = (hour(time, "America/New_York") == 9 and minute(time, "America/New_York") == 45)
// Between 9:30 and 9:44 (inclusive of 9:30 bar, exclusive of 9:45)?
inSession = (hour(time, "America/New_York") == 9 and minute(time, "America/New_York") >= 30 and minute(time, "America/New_York") < 45)
// ─── Reset each day at 9:30 ─────────────────────
if is930
// Reset orHigh / orLow
orHigh := na
orLow := na
rangeEstablished := false
tradeTakenToday := false
// Record the bar_index for 9:30
barIndex930 := bar_index
// ─── ONLY FORM OR / TRADE IF TODAY IS ALLOWED ─────────────────────
if is_trading_day
// ─── Accumulate the OR high/low from 9:30 to 9:44 ─
if inSession
orHigh := na(orHigh) ? high : math.max(orHigh, high)
orLow := na(orLow) ? low : math.min(orLow, low)
// ─── Exactly at 9:45, draw the lines & lock range ─
if is945 and not na(orHigh) and not na(orLow)
// Mark that the OR is established
rangeEstablished := true
// ─── TRADING LOGIC AFTER 9:45, but BEFORE NOON, and if NO trade taken ─
if rangeEstablished and not na(orHigh) and not na(orLow)
// Only trade if it's still BEFORE 12:00 (noon) EST and we haven't taken a trade today
if hour(time, "America/New_York") < 12 and (not tradeTakenToday)
// 1) Compute distances for stops & targets
float stopSize = 0.5 * (orHigh - orLow) // half the OR size
float targetSize = 3 * stopSize // 3x the stop => 1.5x the entire OR
// 2) Check if price breaks above OR => go long
if close > orHigh
// Only enter a new long if not already in a long position (optional)
if strategy.position_size <= 0
strategy.entry("ORB Long", strategy.long)
strategy.exit("Long Exit", from_entry = "ORB Long", stop = orHigh - stopSize, limit = strategy.position_avg_price + targetSize)
// Flag that we've taken a trade today
tradeTakenToday := true
// 3) Check if price breaks below OR => go short
if close < orLow
// Only enter a new short if not already in a short position (optional)
if strategy.position_size >= 0
strategy.entry("ORB Short", strategy.short)
strategy.exit("Short Exit", from_entry = "ORB Short", stop = orLow + stopSize, limit = strategy.position_avg_price - targetSize)
// Flag that we've taken a trade today
tradeTakenToday := true
if hour(time, "America/New_York") == 16 and minute(time, "America/New_York") == 0
strategy.close_all()