• 2:57 مساءاً




ارجو من احد الأخوة التعديل علي هذا الكود

إضافة رد
أدوات الموضوع
الصورة الرمزية garra
عضو جديد
تاريخ التسجيل: Oct 2015
المشاركات: 101
خبرة السوق : 6 شهور الى سنة
الدولة: الاسكندرية
معدل تقييم المستوى: 11
garra is on a distinguished road
25 - 03 - 2024, 08:34 AM
  #1
garra غير متواجد حالياً  
افتراضي ارجو من احد الأخوة التعديل علي هذا الكود
طلب من موقع ذكاء اصطناعي عمل مؤشر لاستراتيجية ليعمل علي تريدنج فيو ولكن الكود به خطأ
ارجو من احد الأخوة ايجاد الخطأ و اصلاحه
هذا هو الكود :

//@version=5
strategy("Modified Moving Average and Stochastic Strategy", overlay=true)

// Moving Averages
fastMa = ta.w(close, 50)
slowMa = ta.wma(close, 100)

// High and Low values
highValue = ta.highest(high, 1)
lowValue = ta.lowest(low, 1)

// Stochastic Oscillator
[stochK, stochD] = ta.stoch(high, low, close, 21, 5, 5)

// Set plot colors
plot_color = fastMa > slowMa ? color.blue : color.red

// Plotting Moving Averages
plot(fastMa, color=plot_color, title="Fast MA")
plot(slowMa, color=plot_color, title="Slow MA")

// Plotting High and Low values
hline(highValue, color=color.blue, title="High Value")
hline(lowValue, color=color.blue, title="Low Value")

// Plotting Stochastic Oscillator
plot(stochK, color=color.red, title="Stochastic K")
plot(stochD, color=color.red, title="Stochastic D")

// PinBar Condition
isPinBar(close, body, shadow) =>
body > 0 and shadow > 2 * body and shadow > 2 * ta.atr(14) and close > open

// Engulfing Candle Condition
isEngulfing(top, bottom, reverse) =>
top > 0 and bottom > 0 and reverse > 0 and (close[1] > open[1] and close < open[1]) and (close < open and close[1] > open)

// Buy Entry Conditions
buyCondition = (isPinBar(close, body, shadow) or isEngulfing(close, open, high)) and close > ta.wma(close, 100)
and (close > ta.wma(close, 50) or ta.wma(close, 50) > ta.wma(close, 100))
and stochK < 50

// Sell Entry Conditions
sellCondition = (isPinBar(close, body, shadow) or isEngulfing(close, open, high)) and close < ta.wma(close, 100)
and (close < ta.wma(close, 50) or ta.wma(close, 50) < ta.wma(close, 100))
and stochK > 50

// Set Target and Stop Loss levels
target = strategy.position_avg_price + 30
stopLoss = strategy.position_avg_price - 30

// Buy Signal and Stop Loss
strategy.entry("Buy", strategy.long, when=buyCondition)
strategy.exit("Sell", "Buy", profit=target, loss=stopLoss)

// Sell Signal and Stop Loss
strategy.entry("Sell", strategy.short, when=sellCondition)
strategy.exit("Cover", "Sell", profit=target, loss=stopLoss)

// Plot Strategy Signals
plotshape(buyCondition, color=color.green, style=shape.labelup, text="Buy", title="Buy Signal")
plotshape(sellCondition, color=color.red, style=shape.labeldown, text="Sell", title="Sell Signal")
plot(stopLoss, title="Stop Loss", color=color.red)
plot(target, title="Target", color=color.green)
رد مع اقتباس


إضافة رد

الكلمات الدلالية (Tags)
استراتيجية ، كود ، طلب



جديد مواضيع منتدى المؤشرات و الاكسبرتات

المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
ارجو التعديل على الاكسبيرت azrouha منتدى المؤشرات و الاكسبرتات 3 25 - 07 - 2018 12:38 PM
ارجو من المبرمجين هدا الكود engineer34 منتدى المؤشرات و الاكسبرتات 3 25 - 04 - 2012 02:16 AM
الاستاذ نادر ارجو المساعدة في هذا الكود af159 منتدى المؤشرات و الاكسبرتات 0 13 - 05 - 2010 01:47 PM


02:57 PM