0% found this document useful (0 votes)
529 views6 pages

01.08 Create EA From Custom Indicator

This document provides instructions for creating an expert advisor from a custom indicator that displays buy and sell signals. It explains how to add the custom indicator, check the indicator buffer values to identify buy and sell signals, and use those signals to open and close trades through the expert advisor. The key steps are adding the custom indicator, checking the buffer values to identify signals, and using those signals to open and close trades while limiting the expert advisor to one open trade at a time.

Uploaded by

Enrique Blanco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
529 views6 pages

01.08 Create EA From Custom Indicator

This document provides instructions for creating an expert advisor from a custom indicator that displays buy and sell signals. It explains how to add the custom indicator, check the indicator buffer values to identify buy and sell signals, and use those signals to open and close trades through the expert advisor. The key steps are adding the custom indicator, checking the buffer values to identify signals, and using those signals to open and close trades while limiting the expert advisor to one open trade at a time.

Uploaded by

Enrique Blanco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

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().

You might also like