How to insert indicator code in EA

 

Please guys help me: I have an EA that was coded using the icustom () function for the Super Trend indicator, I would like to know how to insert the Super Trend indicator mql4 code directly into the EA code. How do I do that ?

Files:
 
Evanio Da Silva Martins:

Please guys help me: I have an EA that was coded using the icustom () function for the Super Trend indicator, I would like to know how to insert the Super Trend indicator mql4 code directly into the EA code. How do I do that ?

Why?

iCustom is the better way to use an indicator in an EA, there is no need to embeed the indicator code in the EA.

 

I want to put the EA up for sale, but I can't because of the indicator that is separate from the EA. Is it possible to sell an EA that uses the icustom function?
 
Evanio Da Silva Martins:

I want to put the EA up for sale, but I can't because of the indicator that is separate from the EA. Is it possible to sell an EA that uses the icustom function?
#resource "\\Indicators\\indicator.ex4"

iCustom(NULL,0,"::Indicators\\indicator.ex4",0,0);

In this way the indicator will be embedded in the EA

 

You only need to change the indicator name in it, using the one with ::

 

Thank you my friend.

 
Evanio Da Silva Martins: I would like to know how to insert the Super Trend indicator mql4 code directly into the EA code. How do I do that ?
Don't try to do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into the EA (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
          Detailed explanation of iCustom - MQL4 programming forum
Evanio Da Silva Martins: I want to put the EA up for sale, but I can't because of the indicator that is separate from the EA. Is it possible to sell an EA that uses the icustom function

There are no mind readers here and our crystal balls are cracked. Why didn't you state that originally?

 

Friends please help me with one more thing:

I was able to use the indicator with the icustom () function, I need the EA to send the buy / sell order ONLY AT THE TIME THE ARROW APPEARS.

I used the following command:  indicator (0.1)> 0, and the problem is that he already sends the purchase order based on the previous arrow.

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
  • www.mql5.com
For equity securities, the Depth of Market window is available, where you can see the current Buy and Sell orders. Desired direction of a trade operation, required amount and requested price are specified for each order. To obtain...
 
Evanio Da Silva Martins:

Friends please help me with one more thing:

I was able to use the indicator with the icustom () function, I need the EA to send the buy / sell order ONLY AT THE TIME THE ARROW APPEARS.

I used the following command:  indicator (0.1)> 0, and the problem is that he already sends the purchase order based on the previous arrow.

Do not double post. I have deleted your other topic.

 indicator (0.1)> 0

What is this supposed to do?

 
Keith Watford:

Do not double post. I have deleted your other topic.

What is this supposed to do?


The indicator (0.1)> 0 indicates that the indicator is trending upwards.

The purchase function looks like this:

bool BuySignal()

  {

   bool signal=false;

   if(indicator(0,1)>0)

     {

      signal=true;

     }

   return signal;

  }


As it stands, the EA opens the first purchase or sale transaction based on the previous arrow. But I want him to open the buy or sell transaction only when the new arrow appears, how it will open the transactions only when the arrows appear.

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
  • www.mql5.com
For equity securities, the Depth of Market window is available, where you can see the current Buy and Sell orders. Desired direction of a trade operation, required amount and requested price are specified for each order. To obtain...
 

Please use the code button (Alt S) when pasting code.

So it is not indicator(0.1)  it is indicator(0,1)

We don't know what your function does, so how are we supposed to help?