How to insert indicator code in EA - page 2

[Deleted]  
The problem is, my EA when attached to a chart will execute a buy/sell order almost immediately, because its buy/sell condition has been met. However, this could be halway through or at the end of the trend. The EA doesn't discriminate
Keith Watford
Moderator
33974
Evanio Da Silva Martins:
The problem is, my EA when attached to a chart will execute a buy/sell order almost immediately, because its buy/sell condition has been met. However, this could be halway through or at the end of the trend. The EA doesn't discriminate

You should post a job in Freelance.

Freelance

You are intending to sell your EA, so you shouldn't object to paying someone to code it.

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
I have currently used an ea coded on mql4 which uses purely martingale. Code = 300 lines. I'd like to code it for mql5. It basically opens positions as the variable distance between positions is exceeded, when the price moves against the position opened, and each time, the size of the position is bigger. i need a translation and some small...
[Deleted]  
Keith Watford:

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?

 

 double indicator1(int buffer,int shift)
  {
   double value=iCustom(_Symbol,0,"::Indicators\\indicator1.ex4",0,0);
   if(value==EMPTY_VALUE)
      value=0;
   return value;
  }

double indicator2(int buffer,int shift)
  {
   
   double value=iCustom(_Symbol,0,"::Indicators\\indicator2.ex4",0,0);
   if(value==EMPTY_VALUE)
      value=0;
   return value;
  }


bool BuySignal()
  {
   bool signal=false;

   if(indicator1(0,1)>0 && indicator2(0,1)>0)
     {
      signal=true;
     }

   return signal;
  }


bool SellSignal()
  {
   bool signal=false;

   if(indicator1(1,1)>0 && indicator2(1,1)>0)
     {
      signal=true;
     }
   return signal;
  }
[Deleted]  
Evanio Da Silva Martins:

 


So, I call indicator1 and indicator2 through icustom. The EA opens the orders correctly following the sign of the two indicators, the problem is that if I close the order manually the EA will open another order again and I would like the EA to open a new order only when new signs of indicator1 and indicator2 appear .

Keith Watford
Moderator
33974
double indicator1(int buffer,int shift)
  {
   double value=iCustom(_Symbol,0,"::Indicators\\indicator1.ex4",0,0);
   if(value==EMPTY_VALUE)
      value=0;
   return value;
  }

Why do you pass values to the function and not use them?

[Deleted]  
Keith Watford:

Why do you pass values to the function and not use them?

How can I use the values ​​?? 

How can I fix this?
William Roeder
26828
William Roeder  
Evanio Da Silva Martins:

How can I use the values ​​?? 

How can I fix this?
  1. MT4: Learn to code it.
    MT5: Begin learning to code it. If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.
  2. or pay (Freelance) someone to code it.
              Hiring to write script - General - MQL5 programming forum
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help
[Deleted]  
William Roeder:
  1. MT4: Learn to code it.
    MT5: Begin learning to code it. If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.
  2. or pay (Freelance) someone to code it.
              Hiring to write script - General - MQL5 programming forum
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help
Actually this code was a job I ordered here in the mql4 market. But the developer did so, I've asked him to fix but he does not correct and wants to charge me 40 deláres again.
The way he did the EA is not functional : because if the orders are closed by take profit or stop loss the EA will open a new order immeditatedly (following the previous sign) and in these cases I would like the EA to open a new order only with the NEXT sign.
 
I feel aggrieved because I paid for the service and the developer did not give me the necessary support.
 
[Deleted]  
Keith Watford:

Why do you pass values to the function and not use them?

Actually this code was a job I ordered here in the mql4 market. But the developer did so, I've asked him to fix but he does not correct and wants to charge me 40 deláres again.
The way he did the EA is not functional : because if the orders are closed by take profit or stop loss the EA will open a new order immeditatedly (following the previous sign) and in these cases I would like the EA to open a new order only with the NEXT sign.
 
I feel aggrieved because I paid for the service and the developer did not give me the necessary support.