# ترکیب ابزارها برای شناسایی مناطق all_levels = list(fib_levels.values()) + [ema_value] + list(pivot_points.values()) for level in all_levels: count = 0 if level in fib_levels.values(): count += 1 if abs(level - ema_value) < 100: # اگر EMA نزدیک باشد count += 1 if level in pivot_points.values(): count += 1
if count >= 2: # حداقل دو ابزار تایید کننده if level < data['close'].iloc[-1]: # حمایت support_zones[level] = count else: # مقاومت resistance_zones[level] = count
return support_zones, resistance_zones
# اجرای ربات if __name__ == "__main__": df = fetch_data(symbol, timeframe) if df is not None: support_zones, resistance_zones = identify_support_resistance(df)
print("مناطق حمایت:") for zone, strength in support_zones.items(): print(f"قیمت: {zone}, قوت: {strength}")
print("\nمناطق مقاومت:") for zone, strength in resistance_zones.items(): print(f"قیمت: {zone}, قوت: {strength}")
Script de código aberto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.