Guarda come scaricare robot di trading gratuitamente
Ci trovi su Facebook!
Unisciti alla nostra fan page
Accedi al CodeBase dal tuo terminale MetaTrader 5
Non hai trovato il codice che fa per te? Ordinane uno dalla sezione Freelance
Come scrivere un Expert Advisor o un indicatore

Codici sorgente MQL5 di Script per MetaTrader 5

icon

Gli script eseguono azioni uniche in MetaTrader 5, utilizzando un programma MQL5 e vengono eliminati dal grafico subito dopo. Le funzioni esemplificative includono il caricamento della cronologia di trading, la generazione di rapporti e il loro invio via e-mail, il download e l'elaborazione dei dati da un file. Gli script possono essere utilizzati anche per creare un'interfaccia grafica o per eseguire rapidamente operazioni di trading di un solo tipo, per esempio per chiudere immediatamente tutte le posizioni.

È possibile scaricare e lanciare gli script disponibili in MetaTrader 5. La libreria di script è anche disponibile direttamente dalla piattaforma MetaTrader 5 e dall'ambiente di sviluppo MetaEditor.

Invia il tuo codice
più recenti | migliori

Lo script TradeReportExporter è progettato per esportare la cronologia delle operazioni (trade) in un comodo file CSV. Raccoglie automaticamente i dati di tutte le operazioni dell'ultimo anno per lo strumento su cui è installato. Il file include dati quali data e ora, tipo di transazione (acquisto/vendita), prezzo, volume, commissione e profitto/perdita. Il risultato viene salvato in un file che può essere aperto in Excel o in qualsiasi altro editor di fogli di calcolo.

Partially close active sell orders

Script for partially close active buy orders

Il trading di XAUUSD (oro) è spesso influenzato da importanti eventi economici come i comunicati di USD, GBP o EUR. Per mitigare i rischi durante questi periodi di volatilità, l'utilizzo di un filtro sulle notizie nel vostro Expert Advisor (EA) è essenziale. In questo articolo condividerò come creare un semplice filtro sulle notizie su MT5 e applicarlo al trading su XAUUSD.

Lo scopo dello script è quello di esportare la cronologia delle quotazioni in un formato adatto all'analisi con programmi specializzati di analisi tecnica.

Un Expert Advisor semplice ed efficace basato sui segnali di inversione dell'oscillatore stocastico sul timeframe H1. I segnali di acquisto vengono attivati quando %K incrocia sopra %D al di sotto del livello 20. I segnali di vendita vengono attivati quando %K incrocia sotto %D al di sopra del livello 80. Il rischio viene calcolato in base al saldo del conto, con la dimensione del lotto impostata a 0,1 (regolabile in base alle esigenze). Il Take Profit (TP) è impostato a 300 punti per tutte le posizioni. Lo Stop Loss (SL) viene calcolato dinamicamente in base al segnale di crossover opposto. La posizione viene chiusa quando si verifica un crossover nella direzione opposta, così come quando viene raggiunto il TP o lo SL.

Recupero del contenuto degli appunti (clipboard)

Gli algoritmi di ottimizzazione basati sulla popolazione sono raccolti qui. L'archivio contiene tutti i file necessari per eseguire gli algoritmi su funzioni di prova.

Lo script fornisce lo scorrimento sincrono di tutti i grafici aperti nel terminale.

La funzione può essere utile per non sovraccaricare il server di richieste di compravendita in momenti in cui il mercato è chiuso per le contrattazioni.

La sceneggiatura disegna i livelli di Rudolph Axel

The Auto SL TP by Risk Reward Ratio script is a simple yet powerful tool designed for MetaTrader 5 traders who want to streamline their risk management process. This script automates the process of setting Stop Loss (SL) and Take Profit (TP) levels for open positions based on a user-defined Risk:Reward ratio and Stop Loss in pips. Whether you're a beginner or an experienced trader, this script saves time and ensures consistent risk management.

Firma della candela con esempio per la ricerca e lo sviluppo

Si tiene conto del fatto che ci sono 30 giorni in un mese, 365 giorni in un anno Lo script mostra il contatore del tempo fino all'inizio del nuovo anno

Questo script CalculateHistoryProfit versione 1.0 è stato progettato per calcolare il profitto per un periodo specifico utilizzando un pannello grafico.

These are some #define statements that are useful to perform operations in your EA. You only need to assign the name of your variables at the beginning of the file, and then let the other #define statements do the work. In order to use this file, add #include <DEFINE_statements.mqh> to the first line in your EA file.

A simple starting-point script to collect data and send to a CSV in oldest-newest ordering. In this example only the close price data is collected.

A script which when dragged onto the chart will print out in the experts window the number of bars that are on that chart - like magic.

Unfortunately, I discovered that some brokers are a bit sloppy with the server time change due to the daylight saving time (DST), which I did not expect and which surprised me a lot. Here is a script with which anyone can check their broker.

This script was developed for displaying saved Strategy report from the Strategy Tester into a chart.

This script is a reference solution for mapping symbol names configured by users in MetaTrader 5 EAs or scripts to the actual names provided by the broker. It uses the Levenshtein distance algorithm to automatically identify the most similar symbol in Market Watch. It is ideal for developers facing compatibility issues with prefixes or suffixes in symbol names. This is a customizable starting point to adapt to any specific needs.

The script MinMargins.mq5 is designed to help traders quickly calculate and document the minimum amount of money required to open a position with the smallest lot size for all symbols available in the Market Watch. This data is saved to a CSV file for easy review and analysis.

This service periodically checks swaps for predefined symbols and saves detected changes into CSV-files for further analysis and potential replay (not implemented here). Also it monitors and alerts swap changes of existing positions.

This script saves a predefined set of economic events from the MetaTrader's built-in economic calendar into CSV file.

This MQL5 script exports candlestick data for various timeframes into a CSV file, capturing essential market information like open, high, low, and close prices. It analyzes each candlestick's characteristics, including body and wick sizes, while calculating additional metrics such as candle gaps. After processing the latest 21 bars, it notifies the user upon successful data export.

Time-related functions for empirical detection of server time zone and daylight savings mode (DST) from history of quotes

- The script scans through the current chart for any available chart objects, - Counts and delete them accordingly - And log the the names of the objects on the chart respectively.

Translate risk percentages to the monetary figure based on the account balance

A script which when run displays the maximum lot size permitted on the asset.

script to open a buy position at the current price in the MT5 window with a specified stop loss (in pips) and take profit (in pips)

This script saves all the OHLCV data available on the chart to a CSV file.

It will delete all objects on the chart when the compiled executable is dragged onto the chart

Script For Trap News High Impact

Sample code to count consecutive no. of bull or bear bars.

This script helps traders understand the distribution and range of candles in a specific period, which can be useful for making trading decisions such as determining which historical values to use for Take Profit or Stop Loss.

Script to determine whether your Broker follows the US, UK or AU daylight (DST) schedule.

This is a script to export rates and ticks of current chart's symbol into CSV-files compatible with MT5's export/import format.

While manually adjusting the stop-loss of a single trade to match its open price is a relatively simple task, managing numerous positions individually can be cumbersome and time-intensive. The Titik Impas Breakeven script for MT4/MT5 streamlines this process, providing efficiency and convenience for traders dealing with multiple positions.

Sec-WebSocket-Key Generator

This function performs the main logic of opening a trade. Calculates the opening price, take profit levels and stop loss based on symbol information and parameters provided by the user. Prepare a trade request (MqlTradeRequest) with the necessary information, such as symbol, volume, order type, deviation, comment, magic number, etc. Call the OrderSend function to send the operation request and get the result. SetTypeFillingBySymbol function: Determines the order fill type (Fill or Kill, Immediate or Cancel, or Return) based on the symbol's filling policy. GetMinTradeLevel function: Calculates the minimum operating level based on the freeze level and the symbol stops level. Adjusts the minimum level to make sure it is within certain limits and returns the result.

12345678