Best bot

MQL5 Esperti Python

Specifiche

import json
import os
import time

# Install via: pip install google-genai
from google import genai
from google.genai import types

class GeminiProTradingBot:
    """
    Automated Pro Trading Bot using Gemini API for AI-driven technical and trend analysis.
    """
    def __init__(self, symbol: str = "BTC/USDT", min_confidence: float = 0.75):
        self.symbol = symbol
        self.min_confidence = min_confidence
        # Initializes client using the standard GEMINI_API_KEY environment variable
        self.client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))

    def _build_system_instruction(self) -> str:
        return (
            "You are an expert quantitative trading algorithm. Analyze the provided OHLCV candle data "
            "and technical indicators. Output a strict JSON signal evaluating market state, "
            "recommendation (BUY, SELL, HOLD), confidence score (0.0 to 1.0), and risk management parameters."
        )

    def analyze_market(self, market_payload: dict) -> dict:
        """
        Sends formatted candle data to Gemini and returns structured trading signals.
        """
        prompt = f"""
        Analyze the following market state for asset: {self.symbol}
        
        Recent Candles (OHLCV) & Indicators:
        {json.dumps(market_payload, indent=2)}

        Determine the immediate market direction, entry price target, stop loss, and take profit levels.
        """

        # Define JSON Schema enforce exact AI response parameters
        response_schema = {
            "type": "OBJECT",
            "properties": {
                "action": {"type": "STRING", "enum": ["BUY", "SELL", "HOLD"]},
                "confidence": {"type": "NUMBER"},
                "reasoning": {"type": "STRING"},
                "target_entry": {"type": "NUMBER"},
                "stop_loss": {"type": "NUMBER"},
                "take_profit": {"type": "NUMBER"},
                "risk_reward_ratio": {"type": "NUMBER"}
            },
            "required": ["action", "confidence", "reasoning", "stop_loss", "take_profit"]
        }

        try:
            response = self.client.models.generate_content(
                model="gemini-2.5-flash",
                contents=prompt,
                config=types.GenerateContentConfig(
                    system_instruction=self._build_system_instruction(),
                    response_mime_type="application/json",
                    response_schema=response_schema,
                    temperature=0.2, # Low temperature for deterministic risk evaluation
                ),
            )
            return json.loads(response.text)
        except Exception as e:
            print(f"[Error] Gemini AI API query failed: {e}")
            return {"action": "HOLD", "confidence": 0.0, "reasoning": "API execution error."}

    def execute_signal(self, signal: dict):
        """
        Validates confidence thresholds and triggers simulated or real execution.
        """
        action = signal.get("action")
        confidence = signal.get("confidence", 0.0)

        print("\n--- [AI SIGNAL RECEIVED] ---")
        print(f"Action: {action} | Confidence: {confidence * 100:.1f}%")
        print(f"Reasoning: {signal.get('reasoning')}")
        
        if confidence < self.min_confidence or action == "HOLD":
            print("Status: Execution skipped (Insufficient confidence or HOLD signal).")
            return

        print(f"Status: EXECUTING {action} ORDER")
        print(f"Entry Price Target : {signal.get('target_entry')}")
        print(f"Stop Loss Target    : {signal.get('stop_loss')}")
        print(f"Take Profit Target  : {signal.get('take_profit')}")
        # Place broker API execution call here (e.g., CCXT, MetaTrader, or exchange REST APIs)


# --- Example Run ---
if __name__ == "__main__":
    # Mock OHLCV candle feed with RSI & MACD indicators
    sample_market_data = {
        "timeframe": "5m",
        "current_price": 64250.00,
        "rsi_14": 28.5, # Oversold
        "macd": {"macd_line": -120.4, "signal_line": -145.2, "histogram": 24.8},
        "recent_candles": [
            {"close": 64500, "volume": 12.4},
            {"close": 64350, "volume": 18.1},
            {"close": 64100, "volume": 25.6},
            {"close": 64250, "volume": 32.0}
        ]
    }

    bot = GeminiProTradingBot(symbol="BTC/USDT", min_confidence=0.70)
    signal = bot.analyze_market(sample_market_data)
    bot.execute_signal(signal)

Con risposta

1
Sviluppatore 1
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
2
Sviluppatore 2
Valutazioni
(64)
Progetti
144
46%
Arbitraggio
20
40% / 20%
In ritardo
32
22%
Gratuito
3
Sviluppatore 3
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
4
Sviluppatore 4
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
5
Sviluppatore 5
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
1
0% / 0%
In ritardo
0
In elaborazione
6
Sviluppatore 6
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
7
Sviluppatore 7
Valutazioni
(2)
Progetti
2
50%
Arbitraggio
0
In ritardo
0
Gratuito
8
Sviluppatore 8
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
9
Sviluppatore 9
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
Hi, can you define entry conditions based on 100 or 200 trades? If you need more history, i can give you more trades. It is EURUSD with great results! If you can do it, contact me
I buy EA for USDEUR or XAUUSD for FTMO with proven backtest. Send me images with backtest reports where daily max dd is 1% on 200k account. I can buy several eas if you have them with proofs. Need images of backtesting for 5 years
I am looking for an experienced developer to build a cloud-based MT5 trade copier . Requirements: One master MT5 account sends trades to multiple client MT5 accounts. Clients must not need to install an EA or run MT5/VPS themselves . Client accounts should connect using MT5 login, trading password and broker server. Copy market orders, pending orders, SL/TP changes, partial closes and full closes. Support risk/lot
i need someone that can make me an EA really easy with the martingala system?, I am looking for something that doesn't exceed 5 trades for the martingale, I think I did it, but it only works for propfirms, So i need to develop it on ninja trader I have identified a very very simple strategy but it only works on propfirms, with only two propfirm accounts, i absolutely need account A and account, And they have to open
Hi, do you have a proven EA for MT5, suitable for live accounts and prop firms, including the Brazilian market? I’m looking for ready, tested EAs. Can you send a backtest or demo? Please if you do have and can send me nacktest or demo you should Message me
Access and confidentiality restrictions: You will receive only a separately named copy of the Commander . Existing trading EAs, presets, account credentials, Telegram credentials and proprietary entry/exit code will not be shared. The Commander intelligence must be developed using: Defined signal/input interfaces Anonymized historical logs and replay data Mock EA signals and test harnesses Documented authority and
We are looking for an expert algorithmic trading developer to build a high-performance, fully automated Custom Expert Advisor (EA) or trading bot. The bot must integrate advanced Smart Money Concepts (SMC) , Inner Circle Trader (ICT) methodologies, and Volume Spread Analysis (VSA) with a high-frequency trading (HFT) style execution and scaling model. The core objective is to program a bot that identifies
Develop an Expert Advisor for MetaTrader 5 that manages existing positions. Features Automatically detect all open positions. Apply Break-Even after price reaches a configurable profit. Partial Close: Close X% of volume at the first target. Move Stop Loss to Break-Even. ATR Trailing Stop (optional). Magic Number filter. Comment filter. Symbol filter. Trading session filter. Retry mechanism for trade operations
Requirements Specification Here is an example of Requirements Specification for the development of the MACD Sample Expert Advisor, which is available in the MetaTrader 5 standard package. 1. The idea of the trading system is as follows : market entries are performed when MACD's main and signal lines intersect in the current trend direction . 2. Trend is determined based on the Exponential Moving Average with
JazzDaBot 30+ USD
""" Wick Reversal Strategy — core logic ===================================== Rules (as specified): - Timeframe: 15-minute candles - Entry: candle wick >= WICK_MULTIPLIER x body -> signal candle - long lower wick -> enter LONG at next candle's open - long upper wick -> enter SHORT at next candle's open - Exit: an opposite-direction wick candle forms while in a position - Stop-loss: just beyond the signal candle's

Informazioni sul progetto

Budget
50+ USD
Scadenze
da 1 a 30 giorno(i)

Cliente

Ordini effettuati1
Numero di arbitraggi0