I need help with coding an EA for mt4

 

Hi, i got an mql4 file of an EA and i would like to add a code in it.

i want the EA not to trade if the spread goes above 12 .

what should i do ? please help.


thanks in advance

 
if(MarketInfo(Symbol(),MODE_SPREAD)<12)
{
  // Trade
}
 
Marco vd Heijden:
if(MarketInfo(Symbol(),MODE_SPREAD)<12)
{
  // Trade
}
Hi , thank you... i should place this inside start function right ?
 
Abhinand Bajikumar Sreekala:
Hi , thank you... i should place this inside start function right ?
Replace all Ordersend function in your code inside this structure which you have
or simply put this in start function after { :

if(MarketInfo(Symbol(),MODE_SPREAD)>12)
{
  return;
}
if your start function is not return void type:

if(MarketInfo(Symbol(),MODE_SPREAD)>12)
{
  return 0;
}
BTW, it is very bad Idea to stop trading when spread is over than a number
 

Abhinand Bajikumar Sreekala: i want the EA not to trade if the spread goes above 12 . what should i do ? please help.

learn to code it, or pay (Freelance) someone to code it.
We're not going to code it for you.
We are willing to help you when you post your attempt (using SRC) and the nature of your problem.
 
PCRider:
Replace all Ordersend function in your code inside this structure which you have
or simply put this in start function after { :

if(MarketInfo(Symbol(),MODE_SPREAD)>12)
{
  return;
}
if your start function is not return void type:

if(MarketInfo(Symbol(),MODE_SPREAD)>12)
{
  return 0;
}
BTW, it is very bad Idea to stop trading when spread is over than a number
Thank you very much for your information. i will try it .
 
whroeder1:
learn to code it, or pay (Freelance) someone to code it.
We're not going to code it for you.
We are willing to help you when you post your attempt (using SRC) and the nature of your problem.

Hi, I asked for "Help" .... it means make it easier for (someone) to do something by offering one's services or resources...And i never asked anyone to code a full program for me.

I know that there are some good people out there who are willing to help me and they are doing it too...(Because, sharing knowledge is the best thing you can do in your life).

Anyway...thanks for giving me links to study about mt4. i will do it.


 
Abhinand Bajikumar Sreekala:
Thank you very much for your information. i will try it .

Be very careful with this if your EA manages or closes your trades as well as opens them. That code cripples your EA whenever spread > 12

Also be clear about the difference between points and pips