Trading REST API
With the trade4.me API, you can send signals to your binary options account and your copiers from Metatrader 4 and 5, Ninjatrader, Matlab, … or just any software or language capable of HTTP calls. To work with the API, only a few lines of code are necessary. Automating your favorite EAs and indicators has never been so easy!
This is your Trade4.me username, e.g. username=testusername
This is your Trade4.me password, e.g. password=testpassword
Name of the asset as displayed on the broker or the trade4.me webtrader, e.g. asset=EUR/USD
The direction is either UP or DOWN, e.g. direction=UP
Expiration of your binary options position (in minutes), e.g. for 15 minutes expiry, set expiry=15
Amount to be traded in your broker currency, e.g. amount=25
Simply modify the URL below with your parameters and open it in your browser to send a trading order.
This example sends an UP order to your broker account for EUR/USD with 15 minutes expiry and $25 investment.
How to use the API with Metatrader 4 and 5?
- Open Metatrader. Click Tools > Options > Expert Advisors > check Allow DLL imports and Allow automated trading. Click OK.
- Click Files > Open DataFolder. This will open Windows Explorer in your DataFolder.
- Download this archive. It contains the functions library and code examples. Extract the archive into your DataFolder, merging the MQL4 or MQL5 folders together.
- You’re done 🙂 Restart Metatrader. You will find :
- !Trade4me_functions.mqh in your Include folder. This file contains the trade4me() functions that allows you to send signals to https://trade4.me/order/. Notice that this file is simply an HTTP reader.
- !Trade4me_script_example.mq4/5 in your Scripts folder. This file is a simple example that sends a EURUSD signal to trade4.me when you add it to a chart. Notice that it first includes the !Trade4me_functions.mqh library then calls the trade4me(“username”, “password”, “asset”, “direction”, “expiry”, “amount”) function. You can modify the source code and create new scripts based on this example.
- !Trade4me_BUY_Line.mq4/5 and !Trade4me_SELL_Line.mq4/5 in your Indicators folder. These files are indicators that will display a line on the chart at a value you choose and trigger a signal automatically when the price reach that value. You can use the indicators as are or modify them if you want.
- !Trade4me_ea_example.mq4/5 in your Experts folder. This file is a simple example of an Expert Advisor that send an UP signal when the RSI is oversold, and a DOWN signal when the RSI is overbought. You can modify the source code and create new Expert Advisors based on this example.
- !Trade4me_interface.mq4/5 in your Experts folder. This file adds an interface to your chart allowing you to send signals manually by simply clicking on UP and DOWN buttons on the chart. When opening a new trade, this EA also simulates the outcome of the trade. Notice that the simulated trade might have a different outcome than the actual trade on your broker. The “balance” displayed on the chart is also simulated and is not related to your actual balance. Future versions of this EA will display your actual balance. Always check your broker account for the actual trade results.
How to use the API with NinjaTrader, Matlab, C#, etc…?
For this, just make HTTP calls from your program to the tared4me API url https://trade4.me/order.php with the parameters presented above.
Users have reported being able to do so with the aforementioned programs. Although trade4.me does not provide code examples, make sure to contact our support (in the lower right corner of this page) to check for available codes. Our support team can also code it for you. Contact us for a quotation.
API for Balance and History
If you wanna check your broker balance with the API, use :
If you want an history of your 20 latest trades, use :
Notice that you are only allowed to call these functions once per hour. If you call them more, your IP will be banned.
Hire us and we’ll automate your strategy for you!
Trade4.me is owned and operated by SAS NEUTRINO, a company specialized in binary options autotrading. We have CS engineers and tech specialists that can help you code your strategy and/or automate your favorite EAs and indicators to binary options. Contact us (in the lower right corner of this page) and we’ll provide you with a quote and timeline for your project.