Binary Options Strategy Library
Info
The Binary Options Strategy Library is a Library for MetaTrader 4 that this library provides input parameters and functions to build your binary options strategy stored in an indicator to test and improve your strategy in the strategy tester of metatrader 4 with the utility from marketplace. Installation: Download this library (BinaryOptionsStrategyLibrary.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Library works exclusively on MetaTrader 4 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL4/Libraries folder via File ? Open Data Folder in MetaTrader 4.
How to Install and Use Binary Options Strategy Library
1. Storage: Place library files in the MQL/Libraries directory to ensure they are accessible to your projects.
2. Implementation: Include the library in your code using the #import directive, ensuring you match the exact function names and parameters.
3. Compilation: Ensure the library is present in the directory before you compile your main EA or script, as the compiler links them during this phase.
4. Management: Keep libraries organized in sub-folders if you manage many custom functions to maintain a clean project structure.
Frequently Asked Questions
Q: What is a library file used for? A: Libraries store reusable code modules, allowing you to centralize common logic used by multiple EAs or indicators.
Q: Is a library executable? A: No, libraries are non-executable files containing functions; they must be imported into an EA, indicator, or script to function.
Q: Can I update a library while the platform is running? A: You should compile your EA or script after updating a library to ensure the latest code changes are integrated.
What this tool does
This library provides input parameters and functions to build your Binary Options strategy stored in an indicator to test and improve your strategy in the Strategy Tester of MetaTrader 4 with the utility from Marketplace.
Typical Use Case
This Library excels in automated trading and technical analysis on MetaTrader 4.
Compatible Platform & Setup
This Library works on MetaTrader 4. Place the file in the MQL4/Libraries folder and restart the terminal.
Description & Settings
Related: Authenticate into an MT4 account from MQ L4 (tested in build 880) - another powerful library for MetaTrader 4 traders.
Also recommended: Stdlib - similar library with strong performance on MetaTrader 4.
This library provides input parameters and functions to build your Binary Options strategy stored in an indicator to test and improve your strategy in the Strategy Tester of MetaTrader 4 with the utility from Marketplace.Installation:
Download this library (
BinaryOptionsStrategyLibrary.mqh)
and place it into
\Include
folder ([path to your MetaTrader 4]\MQL4\Include). After that you are able to use the functions by including the file (see Usage).
Usage:
If you have downloaded and stored the libary into \Include folder ([path to your MetaTrader 4]\MQL4\Include), you are able to include it like this:
#include <BinaryOptionsStrategyLibrary.mqh> The library will be available like described in the example above if it is placed in \Include folder of your MetaTrader 4.
Changing the content of the library is not needed!
Provided input parameters:
The library provides the following input parameters to use in your indicator which contains your Binary Options strategy:
//---- Input parameters input YesNo oneTradePerCandle = YES; //Just one SELL/BUY Trade per candle input YesNo shouldCheckOnlyAtBeginningOfCandle = YES; //Check only at beginning of new candles (not on every tick) Provided functions:
The library provides the following functions to use in your indicator which contains your Binary Options strategy.
PlaceTrade()
Place a trade (OP_SELL or OP_BUY) in Binary-Options-Strategy-Tester.
//+------------------------------------------------------------------+ //| Function to place orders for Strategy-Tester. | //| Input parameter: OP_SELL or OP_BUY | //+------------------------------------------------------------------+ void PlaceTrade( int _tradeOperation //Trade operation OP_SELL or OP_BUY );
Parameters:
_tradeOperation - [in] Trade operation type. It can be OP_SELL or OP_BUY of Trade operation enumeration.
Return value:
No return value.
PrintDebugValue()
Prints out debug values while Binary-Options-Strategy-Tester is running.
//+------------------------------------------------------------------+ //| Function to print out debug-values | //+------------------------------------------------------------------+ void PrintDebugValue( string _labelText="", //Text for the label string _valueText="", //Value to print out int _row=0 //Row of the message, starting with 0 );
Parameters:
_labelText - [in] Text of the label.
_valueText - [in] Value to print out.
_row - [in] Row of the message, starting with 0.
Return value:
No return value.
CallStrategy()
Function will decide if tester has to check for the strategy rules. Call this function in OnCalculate event of your indicator which contains your Binary Options strategy.
//+------------------------------------------------------------------+ //| Function to decide if we have to check for our rules or not. | //| Call this function in OnCalculate-event of your indicator. | //+------------------------------------------------------------------+ void CallStrategy();
Parameters:
No parameters.
Return value:
No return value.
Note: CallStrategy() function in the library will call a function named CheckMyRules() in your indicator where you have to place your conditions of your Binary Option strategy. Therefore
you have to implement the function CheckMyRules() in your Binary Options strategy indicator
. Example:
See "" for an example how to use this library and implement CheckMyRules() in combination with Binary Options Strategy Tester utility from marketplace.
FAQ:
Question: I can not compile the library without errors. What is going wrong?
Answer: You do not need to compile the library (this mqh file). It will be included in your Binary Options strategy.
Question: Why you did not show a complete example how to use the library on this page to go the next steps?
Answer: A complete example is shown in the article "".
Question: Do I need to rent the Binary-Options-Strategy Tester in Marketplace to test and improve my Binary Options strategies?
Answer: Yes. To use the utility "Binary-Options-Strategy Tester" from Marketplace you have to rent it.
Question: I got errors like "Cannot call .. BinaryOptionsStrategyTester.ex4::PrintDebugValue" or "Cannot load .. \Experts\Market\BinaryOptionsStrategyTester.ex4" in the log of MetaTrader 4. What can I do? Further informations:
— Binary Options Test Framework utility from marketplace to test and improve your Binary Options strategy with Strategy Tester of MetaTrader 4.
— Article with an example of a Binary Options strategy stored in an indicator to use with Binary-Options-Strategy-Tester. Changelog:
v1.01
Fixed "Cannot load.." and "Cannot call.." errors by changing the import filename from "..\\Experts\\Market\\BinaryOptionsStrategyTester.ex4" to "..\\Experts\\Market\\Binary Options Strategy Tester.ex4". Filename of Binary Options Strategy Tester from Marketplace is "Binary Options Strategy Tester.ex4" instead of assumed "BinaryOptionsStrategyTester.ex4". Therefore the import of the file did not match the correct filename of Binary Options Strategy Tester utility which causes in errors like "Cannot call .. BinaryOptionsStrategyTester.ex4::PrintDebugValue" or "Cannot load .. \Experts\Market\BinaryOptionsStrategyTester.ex4".
You may also like: BB MA C D funcs - excellent alternative for library users on MetaTrader 4.
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.