
यह एक स्मार्ट ट्रेंड ट्रैकिंग रणनीति है जो कई तकनीकी संकेतकों के क्रॉस सिग्नल पर आधारित है। यह रणनीति तीन प्रमुख तकनीकी संकेतकों को एकीकृत करती है जैसे कि चलती औसत (ईएमए), अपेक्षाकृत मजबूत सूचक (आरएसआई) और चलती औसत प्रवृत्ति विचलन (एमएसीडी), बाजार की प्रवृत्ति को पहचानने के लिए बहुआयामी सिग्नल की पुष्टि करने के लिए, और गतिशील स्टॉप-लॉस स्टॉप के साथ जोखिम प्रबंधन के लिए। रणनीति को पूरी तरह से स्वचालित ट्रेडिंग के लिए डिज़ाइन किया गया है, विशेष रूप से दिन के कारोबार के लिए उपयुक्त है।
इस रणनीति का मुख्य तर्क तीन स्तरों पर आधारित है:
इनपुट सिग्नल के उत्पादन के लिए निम्नलिखित शर्तों को पूरा करना आवश्यक हैः
रणनीति का उपयोग पूंजी का प्रतिशत धारण करने के लिए किया जाता है, प्रत्येक लेनदेन पर 10% खाता ब्याज का उपयोग किया जाता है, और जोखिम नियंत्रण के लिए 2% स्टॉप और 1% स्टॉप-लॉस के साथ काम किया जाता है।
जोखिम नियंत्रण सुझाव:
इस रणनीति के माध्यम से कई तकनीकी संकेतकों के सामंजस्यपूर्ण कार्य के माध्यम से एक अपेक्षाकृत पूर्ण प्रवृत्ति ट्रैकिंग प्रणाली का निर्माण किया गया है। इस रणनीति के फायदे संकेत की विश्वसनीयता, जोखिम प्रबंधन में सुधार, लेकिन यह भी एक निश्चित पिछड़ापन और बाजार की स्थिति पर निर्भरता है। इस रणनीति के अनुकूलन दिशा के माध्यम से अपनी अनुकूलन क्षमता और स्थिरता को और बढ़ाया जा सकता है। वास्तविक क्षेत्र के अनुप्रयोगों में, यह पर्याप्त प्रतिक्रिया और पैरामीटर अनुकूलन की सिफारिश की है, और बाजार की वास्तविक स्थिति के साथ उचित समायोजन किया गया है।
/*backtest
start: 2024-02-22 00:00:00
end: 2025-02-19 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © egidiopalmieri
//@version=5
strategy("BTCUSD Intraday - AI-like Strategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.1)
// ==========================
// Risk and Strategy Parameters
// ==========================
takeProfitPerc = input.float(2.0, "Take Profit (%)", step=0.1) / 100.0 // Target profit: 2%
stopLossPerc = input.float(1.0, "Stop Loss (%)", step=0.1) / 100.0 // Stop loss: 1%
// ==========================
// Technical Indicators
// ==========================
emaShortPeriod = input.int(9, "Short EMA (period)", minval=1)
emaLongPeriod = input.int(21, "Long EMA (period)", minval=1)
emaShort = ta.ema(close, emaShortPeriod)
emaLong = ta.ema(close, emaLongPeriod)
// RSI Indicator
rsiPeriod = input.int(14, "RSI (period)", minval=1)
rsiValue = ta.rsi(close, rsiPeriod)
// MACD Indicator
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// ==========================
// Entry Conditions
// ==========================
// LONG entry: short EMA crosses above long EMA, RSI not in overbought zone, MACD in bullish trend
longCondition = ta.crossover(emaShort, emaLong) and (rsiValue < 70) and (macdLine > signalLine)
// SHORT entry: short EMA crosses below long EMA, RSI not in oversold zone, MACD in bearish trend
shortCondition = ta.crossunder(emaShort, emaLong) and (rsiValue > 30) and (macdLine < signalLine)
// ==========================
// Signal Visualization
// ==========================
plotshape(longCondition, title="Long Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Long")
plotshape(shortCondition, title="Short Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Short")
// ==========================
// Entry Logic
// ==========================
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// ==========================
// Stop Loss and Take Profit Management
// The levels are calculated dynamically based on the average entry price
// ==========================
if strategy.position_size > 0
// For long positions
longSL = strategy.position_avg_price * (1 - stopLossPerc)
longTP = strategy.position_avg_price * (1 + takeProfitPerc)
strategy.exit("Exit Long", from_entry="Long", stop=longSL, limit=longTP)
if strategy.position_size < 0
// For short positions
shortSL = strategy.position_avg_price * (1 + stopLossPerc)
shortTP = strategy.position_avg_price * (1 - takeProfitPerc)
strategy.exit("Exit Short", from_entry="Short", stop=shortSL, limit=shortTP)
// ==========================
// Final Notes
// ==========================
// This script uses rules based on technical indicators to generate signals
// "AI-like". The integration of actual AI algorithms is not natively supported in PineScript.
// It is recommended to customize, test, and validate the strategy before using it in live trading.