
এই কৌশলটি একটি স্বয়ংক্রিয় ট্রেডিং সিস্টেম যা একটি 5-মিনিটের সময় ফ্রেমের উপর ভিত্তি করে যা চলমান গড় প্রবণতা অনুসরণ এবং ভলিউম বিশ্লেষণ পদ্ধতিগুলিকে একত্রিত করে। কৌশলটি বাজারের প্রবণতা নির্ধারণের জন্য 50-পিরিয়ড সিম্পল মুভিং এভারেজ (SMA) ব্যবহার করে এবং ট্রেডিং সিগন্যালের কার্যকারিতা যাচাই করার জন্য ভলিউম বিশ্লেষণও প্রবর্তন করে। সম্পূর্ণ স্বয়ংক্রিয় ট্রেডিং অর্জনের জন্য সিস্টেমটি নির্দিষ্ট স্টপ লস এবং লাভের লক্ষ্য গ্রহণ করে।
কৌশলটির মূল যুক্তিতে নিম্নলিখিত মূল উপাদানগুলি অন্তর্ভুক্ত রয়েছে:
এই কৌশলটি ট্রেন্ড ট্র্যাকিং এবং ভলিউম বিশ্লেষণকে একত্রিত করে একটি সম্পূর্ণ উচ্চ-ফ্রিকোয়েন্সি ট্রেডিং সিস্টেম তৈরি করে। কৌশলটির প্রধান সুবিধা বহুমাত্রিক সংকেত নিশ্চিতকরণ প্রক্রিয়া এবং সম্পূর্ণ ঝুঁকি নিয়ন্ত্রণ ব্যবস্থার মধ্যে রয়েছে। যদিও কিছু অন্তর্নিহিত ঝুঁকি রয়েছে, প্রস্তাবিত অপ্টিমাইজেশন দিকনির্দেশের মাধ্যমে কৌশলটির স্থায়িত্ব এবং অভিযোজনযোগ্যতা আরও উন্নত করা যেতে পারে। যুক্তিসঙ্গত প্যারামিটার অপ্টিমাইজেশান এবং ঝুঁকি ব্যবস্থাপনার মাধ্যমে স্পষ্ট প্রবণতা সহ একটি বাজার পরিবেশে কাজ করার জন্য কৌশলটি স্থিতিশীল ট্রেডিং ফলাফল অর্জন করবে বলে আশা করা হচ্ছে।
/*backtest
start: 2024-01-10 00:00:00
end: 2025-01-08 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Jerryorange
//@version=6
//@version=6
strategy("Autonomous 5-Minute Robot", overlay=true, fill_orders_on_standard_ohlc=true)
// --- Inputs ---
maLength = input.int(50, title="Trend MA Length") // Moving average length for trend detection
volumeLength = input.int(10, title="Volume Length") // Length for volume analysis
stopLossPercent = input.float(3, title="Stop Loss (%)") // 3% stop loss
takeProfitPercent = input.float(29, title="Take Profit (%)") // 29% take profit
// --- Market Trend Detection ---
ma = ta.sma(close, maLength) // Simple moving average for trend direction
isBullish = close > ma // Market is bullish if the close is above the moving average
isBearish = close < ma // Market is bearish if the close is below the moving average
// --- Volume Analysis ---
buyVolume = (high != low) ? volume * (close - low) / (high - low) : 0
sellVolume = (high != low) ? volume * (high - close) / (high - low) : 0
totalVolume = volume
// --- Define Market Direction over Last 30 Minutes (6 candles in 5-minute chart) ---
lookback = 6 // 30 minutes / 5 minutes = 6 bars
prevClose = close[lookback] // Previous close 30 minutes ago
currentClose = close // Current close
uptrend = currentClose > prevClose and isBullish // Uptrend condition
downtrend = currentClose < prevClose and isBearish // Downtrend condition
// --- Strategy Logic ---
longCondition = uptrend and buyVolume > sellVolume // Buy signal when trend is up and buy volume exceeds sell volume
shortCondition = downtrend and sellVolume > buyVolume // Sell signal when trend is down and sell volume exceeds buy volume
// --- Entry and Exit Strategy ---
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// --- Exit Strategy based on Stop Loss and Take Profit ---
strategy.exit("Exit Long", "Long", stop=close * (1 - stopLossPercent / 100), limit=close * (1 + takeProfitPercent / 100))
strategy.exit("Exit Short", "Short", stop=close * (1 + stopLossPercent / 100), limit=close * (1 - takeProfitPercent / 100))
// --- Plotting for Visualization ---
plot(ma, color=color.blue, title="50-period MA") // Trend line
plotshape(longCondition, style=shape.labelup, location=location.belowbar, color=color.green, text="BUY")
plotshape(shortCondition, style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL")