<< <%SKIN-STRTRANS-SYNTOC%> >> Navigation: Video Tutorial > Create EA From Custom Indicator |
In this tutorial, I'm going to show you how to create an Expert Advisor from your custom indicator.
Let's say your custom indicator displays blue and red arrows to buy or sell.
Add condition and upload your custom indicator.
Your custom indicator will appear here in the list:
Now you can use it just like any other indicator.
To open a buy order when a blue arrow is displayed, choose the appropriate Indicator Buffer...
is not equal to Value zero.
This means that there is a blue arrow at the current bar. For the sell order, choose the other indicator buffer and do the same.
From this point, you can add Stop Loss, Take Profit and develop it further into a more complex Expert Advisor. Don't forget to limit the Maximum Open Trades to 1. Otherwise, it will open multiple trades whenever the arrow appears and disappears.
Important: Custom indicators used in any EA must be programmed in the new MQL4 language. The MQL4 language has significantly changed since build 600 in the beginning of 2014. Old, incompatible indicators include functions init() and start() whereas new indicators include functions OnInit() and OnCalculate().