make EA from an Indicator

Back to topics list To post a new topic, please log in or register
avatar
14
phil09 2015.12.03 15:29
 

Hi,

I would like to make an EA from an Indicator, and my problem is: the indicator paint an arrow and make alert, how can I capture the paint arrow. I tried iCustom, but unluncky, not got results.

Anybody can tell me with example how can I capture the arrow paint?



avatar
70
Keelan 2015.12.03 16:22 #
 

I believe the iCustom are for taking values from an indicator not implementing them, As far as im aware you cant initiate an indicator from an EA so what you really want is some value from the indicator? Other wise just put the indicator on the chart aswell?

 For example i have a simple line of best fit indicator, with various lines etc but i only use it to check that the values are correct in my EA, just visual reference. 

 

 

avatar
14
phil09 2015.12.03 16:46 #
 
Thanks for reply, I want to make EA from an indicator, so I need capture the arrow and open and order. How can I do this? When the indicator paint an arrow, how can I "capture"?
avatar
15
KingOfSand 2015.12.03 16:55 #
 

Indicator: 

First you need the buffer:

 double EABuffer[];

 

Then you need to "send" some value to the EA, for example:

RSItemp = iRSI(NULL,0,RSIperiod,PRICE_CLOSE,0);

if (RSItemp < 30){
  EABuffer[0] = 1; // Or any number that you like to translate as a "buy"
}

if (RSItemp > 70){
  EABuffer[0] = 2; // Or any number that you like to translate as a "sell"
}
EABuffer[0] = 0; // Just to set a value that is neither a buy or sell when RSItemp is between 30 and 70

 

So in the EA you need to:

 

 double InfoFromIndicator;
   InfoFromIndicator=iCustom(NULL,0,"nameOfYourIndicator",3,0);

     if(InfoFromIndicator==1){
// Make whatever you need to make for a Buy
        }


     if(InfoFromIndicator==2){
// Make whatever you need to make for a Sell        
        }

 

Let me know if it was of any help :)

avatar
14
phil09 2015.12.03 17:18 #
 

it seems to I have to use the iCustom function, (i dont have the indicator source code) but the iCustom shows only zero or 2147483647.0

still unlucky. Any suggestion?

avatar
15
KingOfSand 2015.12.03 17:19 #
 
phil09:

it seems to I have to use the iCustom function, (i dont have the indicator source code) but the iCustom shows only zero or 2147483647.0

still unlucky. Any suggestion?

Sorry, then it is impossible.
avatar
12984
WHRoeder 2015.12.03 20:11 #
 
phil09 I want to make EA from an indicator, I tried iCustom, but unluncky, not got results.
  1. Don't do that. Just get the value of the indicator. Detailed explanation of iCustom - MQL4 forum
  2. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.

avatar
14
phil09 2015.12.03 21:55 #
 

Thanks WHRoeder,

I dont give up. My Metatrader 920 dont make an EX4 file (Win 10 issue), and crash when I try compile with older Metaeditor but this is another story...

When I hoover over the painted arrow it shows the name and a price value, thats means (if have name) the arrows painted not by an indicator?

Now I'm try ObjectsTotal() function.

Update: It seems that the arrow is an object.

avatar
Moderator
3404
GumRai 2015.12.03 22:40 #
 
phil09:

Thanks WHRoeder,

I dont give up. My Metatrader 920 dont make an EX4 file (Win 10 issue), and crash when I try compile with older Metaeditor but this is another story...

When I hoover over the painted arrow it shows the name and a price value, thats means (if have name) the arrows painted not by an indicator?

The indicator may place arrows on the chart as objects instead of using buffers. This would mean that you would have to look for the object instead of using iCustom.
Back to topics list  

To add comments, please log in or register