// Average True Range (ATR) for Stop Loss Calculation atr = ta.atr(atrLength) stopLossDistance = atr * 1.5 // ATR-based stop-loss takeProfitDistance = stopLossDistance * riskRewardRatio
// Volume Weighted Average Price (VWAP) vwap = ta.vwap(close)
// ==== ENTRY CONDITIONS ==== // Long Entry: Golden Cross + RSI Confirmation + VWAP Support + Supertrend Uptrend longCondition = ta.crossover(emaShort, emaLong) and rsi > 40 and rsi < 65 and close > vwap and supertrendDirection == 1
// Short Entry: Death Cross + RSI Confirmation + VWAP Resistance + Supertrend Downtrend shortCondition = ta.crossunder(emaShort, emaLong) and rsi > 60 and rsi < 80 and close < vwap and supertrendDirection == -1
// ==== EXIT CONDITIONS ==== // Stop-Loss and Take-Profit Levels for Long Positions longStopLoss = close - stopLossDistance longTakeProfit = close + takeProfitDistance
// Stop-Loss and Take-Profit Levels for Short Positions shortStopLoss = close + stopLossDistance shortTakeProfit = close - takeProfitDistance
// ==== TRADE EXECUTION ==== // Open Long Trade if (longCondition) strategy.entry("Long", strategy.long) strategy.exit("Long Exit", from_entry="Long", limit=longTakeProfit, stop=longStopLoss)
// Open Short Trade if (shortCondition) strategy.entry("Short", strategy.short) strategy.exit("Short Exit", from_entry="Short", limit=shortTakeProfit, stop=shortStopLoss)
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
לגישה מהירה לגרף, הוסף את הסקריפט הזה למועדפים שלך - למד עוד כאן.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
לגישה מהירה לגרף, הוסף את הסקריפט הזה למועדפים שלך - למד עוד כאן.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.