Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-sonnet-4-20250514· AnthropicHugging Face LMArena Human Preference 140K

سیگنال سل و بای را نشان دهد

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Mistralmistral-medium-2505’s answer.
  1. User

    سیگنال سل و بای را نشان دهد

  2. Claude Assistant

    کد قبلی باید سیگنال‌ها را نشان دهد، اما ممکن است شرایط خیلی سخت باشد. بیایید کد را بهبود دهم تا سیگنال‌های بیشتر و واضح‌تری نشان دهد:

    //@version=5
    indicator("Advanced Buy/Sell Signals", overlay=true)
    
    // تنظیمات
    rsi_length = input.int(14, "RSI Length")
    ma_fast = input.int(20, "Fast MA")
    ma_slow = input.int(50, "Slow MA")
    bb_length = input.int(20, "Bollinger Bands Length")
    bb_mult = input.float(2.0, "Bollinger Bands Multiplier")
    
    // محاسبه اندیکاتورها
    rsi = ta.rsi(close, rsi_length)
    ma_fast_line = ta.sma(close, ma_fast)
    ma_slow_line = ta.sma(close, ma_slow)
    [macd_line, signal_line, _] = ta.macd(close, 12, 26, 9)
    
    // Bollinger Bands
    basis = ta.sma(close, bb_length)
    dev = bb_mult * ta.stdev(close, bb_length)
    upper = basis + dev
    lower = basis - dev
    
    // Volume
    vol_ma = ta.sma(volume, 20)
    high_volume = volume > vol_ma * 1.2
    
    // شرایط سیگنال خرید (چندین حالت)
    buy_signal_1 = ta.crossover(ma_fast_line, ma_slow_line) and rsi < 70
    buy_signal_2 = close < lower and rsi < 30
    buy_signal_3 = ta.crossover(macd_line, signal_line) and close > ma_fast_line
    buy_signal_4 = rsi < 30 and close > open and high_volume
    
    // ترکیب سیگنال‌های خرید
    buy_signal = buy_signal_1 or buy_signal_2 or buy_signal_3 or buy_signal_4
    
    // شرایط سیگنال فروش (چندین حالت)
    sell_signal_1 = ta.crossunder(ma_fast_line, ma_slow_line) and rsi > 30
    sell_signal_2 = close > upper and rsi > 70
    sell_signal_3 = ta.crossunder(macd_line, signal_line) and close < ma_fast_line
    sell_signal_4 = rsi > 70 and close < open and high_volume
    
    // ترکیب سیگنال‌های فروش
    sell_signal = sell_signal_1 or sell_signal_2 or sell_signal_3 or sell_signal_4
    
    // نمایش سیگنال‌ها با اشکال بزرگ‌تر و رنگ‌های واضح‌تر
    plotshape(buy_signal, title="BUY", location=location.belowbar, style=shape.labelup, size=size.normal, color=color.new(color.green, 0), textcolor=color.white, text="BUY")
    plotshape(sell_signal, title="SELL", location=location.abovebar, style=shape.labeldown, size=size.normal, color=color.new(color.red, 0), textcolor=color.white, text="SELL")
    
    // نمایش میانگین متحرک‌ها
    plot(ma_fast_line, color=color.blue, title="Fast MA", linewidth=2)
    plot(ma_slow_line, color=color.orange, title="Slow MA", linewidth=2)
    
    // نمایش Bollinger Bands
    plot(upper, color=color.gray, title="BB Upper")
    plot(lower, color=color.gray, title="BB Lower")
    plot(basis, color=color.yellow, title="BB Middle")
    
    // رنگ پس‌زمینه برای روند
    trend_up = ma_fast_line > ma_slow_line
    trend_down = ma_fast_line < ma_slow_line
    bgcolor(trend_up ? color.new(color.green, 95) : trend_down ? color.new(color.red, 95) : na)
    
    // نمایش RSI در جدول کوچک
    var table info_table = table.new(position.top_right, 2, 3, bgcolor=color.white, border_width=1)
    if barstate.islast
        table.cell(info_table, 0, 0, "RSI", text_color=color.black)
        table.cell(info_table, 1, 0, str.tostring(math.round(rsi, 2)), text_color=rsi > 70 ? color.red : rsi < 30 ? color.green : color.black)
        table.cell(info_table, 0, 1, "MACD", text_color=color.black)
        table.cell(info_table, 1, 1, macd_line > signal_line ? "Bullish" : "Bearish", text_color=macd_line > signal_line ? color.green : color.red)
        table.cell(info_table, 0, 2, "Trend", text_color=color.black)
        table.cell(info_table, 1, 2, trend_up ? "UP" : "DOWN", text_color=trend_up ? color.green : color.red)
    
    // هشدارها
    alertcondition(buy_signal, title="Buy Alert", message="سیگنال خرید فعال شد!")
    alertcondition(sell_signal, title="Sell Alert", message="سیگنال فروش فعال شد!")
    

    ویژگی‌های این نسخه بهبود یافته:

    1. سیگنال‌های متنوع: چهار نوع مختلف سیگنال خرید و فروش
    2. نمایش واضح: استفاده از shape.labelup و shape.labeldown با متن "BUY" و "SELL"
    3. اندیکاتورهای بیشتر: RSI، MACD، میانگین متحرک، Bollinger Bands، Volume
    4. جدول اطلاعات: نمایش وضعیت فعلی RSI، MACD و روند
    5. شرایط آسان‌تر: سیگنال‌ها با شرایط متنوع و کمتر محدودکننده

    حالا باید سیگنال‌های خرید و فروش را به وضوح ببینید!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.