Assista a como baixar robôs de negociação gratuitos
Encontre-nos em Telegram!
Participe de nossa página de fãs
Acesse o CodeBase em seu terminal MetaTrader 5
Não encontrou o código mais adequado? Encomende-o na seção Freelance
Como escrever um Expert Advisor ou um indicador

Scripts para MetaTrader 4 com códigos fonte

icon

Scripts são pequenos aplicativos que executam uma ação única. Por exemplo, remover todos os objetos do gráfico, fechar todos os pedidos ou, inversamente, estabelecer um conjunto de ordens pendentes para uma posição aberta. Aqui você encontrará centenas de aplicativos que automatizam pequenas funções analíticas ou de negociação.

Os scripts podem ser livremente baixados e executados no MetaTrader 4.

Adicionar código
recentes | melhores

The Breakeven Point, or Titik Impas, denotes the price level at which a trade's profit becomes zero. By setting a position to Titik Impas Breakeven, the stop-loss is aligned with the position's opening price. This strategy proves valuable when you aim to allow profits to accumulate while ensuring that the trade remains secure and does not revert to negative territory.

All open trades must be of same symbol and type, e.g. all GBPUSD and all BUY. This script will close out your position using one large trade to hedge your position then using CloseBy() function to close all trades against the one large trade until all trades are closed. There can be a maximum of 500 open trades.

Multi_BreakEven is a script file that allows multiples entry positions to set to breakeven using pips or target price when the trade is in your favor.

Multi Selllimit and Sellstop orders are script files that enable traders to place multiple orders with ease. These orders allow traders to enter the market at a specific price level, or at a specified number of pips away from the current market price, with stop-loss and take-profit levels. By default, the pips value is set to 400, which means the trade will be placed 400 pips away from the current market price for a 5-digit broker. Moreover, the multi Selllimit and Sellstop orders offer traders the flexibility to customize their trading strategies. Traders can set the stop-loss level to zero if they do not use stop-loss, and can choose between a target price or a pip-based entry. This level of flexibility allows traders to tailor their trading strategies to their specific needs, which can result in better trading outcomes.

Multi buylimit and buystop orders are script files that enable traders to place multiple orders with ease. With just one command, traders can place multiple buylimit or buystop orders using either a target price or pips. By default, the pips value is set to 400, which means the trade will be placed 400 pips away from the current market price for a 5-digit broker. This setup includes stop-loss and take-profit levels, which can be adjusted based on the trader's preferences. Notably, these orders come with a level of flexibility that enables traders to fine-tune their trading strategies. For instance, a trader can opt to set the stop-loss level to zero if they do not use stop-loss.

To assist traders who wish to open multiple sell orders quickly, a script file has been developed that allows them to execute a large number of trades with just one command. The default take profit and stop loss values are set in 5-digit broker format, but for traders using a 4-digit broker, the default must be TP=40 and SL=20. Num_of_Sell is the number of trades to execute. This script file can be extremely useful for traders who want to take advantage of market conditions quickly and efficiently. By simplifying the process of opening multiple sell orders, it can save traders valuable time and allow them to focus on other aspects of their trading strategy.

To assist traders who wish to open multiple buy orders quickly, a script file has been developed that allows them to execute a large number of trades with just one command. The default take profit and stop loss values are set in 5-digit broker format, but for traders using a 4-digit broker, the default must be TP=40 and SL=20. Num_of_Buy is the number trades the trader wish to open instantly. This script file can be extremely useful for traders who want to take advantage of market conditions quickly and efficiently. By simplifying the process of opening multiple buy orders, it can save traders valuable time and allow them to focus on other aspects of their trading strategy.

Below you can find a super simple method to create a license based on MT4 account name. Place in your init function: CheckLicense(); The stringLower method makes sure the account name is in lowercase. Then you can check this value with the account name you want to check.

Find what are the highs and the lows that happened the last 60000 ms

Convert historical data from M1 to M1, M5, M15, M30, H1, H4, D1, W1 and MN, specifying the start date.

this Script will get content message from Popup Alert dialog

A Simple Trade Management Script

This Script Closed All Open Orders At Once (Except Pending Orders)

Draw trade history onto chart

Plot entry and exit as line objects from MQL5 signal CSV onto chart

This Script is the example of using function LineNotify that use to send message to LINE APP via Line Notify service As the function LineNotify use webrequest to send HTTP request so it can be used in EA or Script program only , can't use in Indicator program

This simple quick & dirty script code will output a CSV file of all the Signals' properties as reported by the MQL4 Trade Signals functionality.

Just simple codes to Disable/Enable Auto/Algo-Trading in both MT5 and MT4. Of course, DLLs must be allowed, This cannot be done without DLLs

Export the history of transactions on the MT4 trading account.

Just a Basic Functions For BreakEven.

This is an EA based on Bollinger band crossover with prices.

Simple stoploss script

it saves the current chart to default template , it just helps to do it faster than a manual save. you can assign a hotkey for it. it has no confirmation and immediately saves the template, if you want it to save to a template other than default just edit the code and replace "default.tpl" to any other name you want.

This code helps beginners in MQL4, specially those migrating from C++ to perform some basic fie operation.

The script is best use to clean up all drawings ( Delete All Object, Comment, horizontal line, vertical line, arrows etc) on current chart. Please feel free to modify based on your needs.

This Is Just A Normal Trailing Step Function.

This Is a Normal Trailing Function For All Open Order In MT4.

A script that displays MarketInfo and SymbolInfo data through a button list built from MarketWatch.

Script to download EVZ data for Euro FX Vix indicator

Building good trading habits by seeing things in terms of percentage not in terms of money.

Custom Function To Get Comma Separated Things From String.

This Custom Function Will Help To Get Round Time For Any Given Timeframe And Time.

Building good trading habits by seeing things in terms of percentage not in terms of money.

This one may not be the fastest, but it will definitely close all your positions.

The currency strength meter is a trading tool that is used to identify trending and consolidating markets based on the percentage rate of change in price from one period to the next.

The breakout strength meter is a trading tool that is used to identify which currencies are the strongest to breakout, and which currencies are the weakest to breakout

In MetaTrader 4, we intend to calculate the intersection coordinates of two straight line objects with different slopes using MQL4.

With this script, you can send a message from MetaTrader 4 to Telegram.

Script that opens 2 orders - one set to close percent of position when profit equals stoploss, another set to close at TP

This script was developed in order to help us detect if a chart is actually trending or going nowhere.

123456789