Hi,
Here is the beginning of my EA :
extern double Lots=0.01;
extern int TP= 500;
extern int SL= 500;
extern int TP_SL_Increment=100;
extern int Difference=60;
extern double Loss_Lots_Multiply_Factor=2.1;
{
if (l==0){
mtr=1;
GlobalVariableSet("mt_Vager1"+Symbol()+Period(),mt r);
TP_SL_Inc=TP_SL_Increment;
GlobalVariableSet("l_Vager1"+Symbol()+Period(),TP_ SL_Increment);
if (OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(As k,Digits),Slippage,NormalizeDouble(Ask-SL*Point,Digits),NormalizeDouble(Ask+TP*Point,Digi ts),com,Magic_Number,0,Blue)==-1){
i=GetLastError();
if (i!=1 && i!=0) Alert("Buy Error :"+error(i)+" at "+Symbol()+" "+Period());
}
}
else if (l>0){
if (OrderSend(Symbol(),OP_BUY,l*Loss_Lots_Multiply_Fa ctor,NormalizeDouble(Ask-SL*Point,Digits),Slippage,NormalizeDouble(Ask-TP_SL_Inc*Point,Digits),NormalizeDouble(Ask+TP*Poi nt+TP_SL_Inc*Point,Digits),com,Magic_Number,0,Ligh tBlue)==-1){
i=GetLastError();
if (i!=1 && i!=0) Alert("Buy 1 Error :"+error(i)+" at "+Symbol()+" "+Period());
}else {
TP_SL_Inc=TP_SL_Inc+TP_SL_Increment;
mtr=mtr+1;
GlobalVariableSet("mt_Vager1"+Symbol()+Period(),mt r);
GlobalVariableSet("l_Vager1"+Symbol()+Period(),TP_ SL_Inc);
}
}
}
and I have always the message : "Buy (or Sell) Error : Invalid Stops".
Where is the error ?
Thanks in advance.
Jo
Here is the beginning of my EA :
extern double Lots=0.01;
extern int TP= 500;
extern int SL= 500;
extern int TP_SL_Increment=100;
extern int Difference=60;
extern double Loss_Lots_Multiply_Factor=2.1;
{
if (l==0){
mtr=1;
GlobalVariableSet("mt_Vager1"+Symbol()+Period(),mt r);
TP_SL_Inc=TP_SL_Increment;
GlobalVariableSet("l_Vager1"+Symbol()+Period(),TP_ SL_Increment);
if (OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(As k,Digits),Slippage,NormalizeDouble(Ask-SL*Point,Digits),NormalizeDouble(Ask+TP*Point,Digi ts),com,Magic_Number,0,Blue)==-1){
i=GetLastError();
if (i!=1 && i!=0) Alert("Buy Error :"+error(i)+" at "+Symbol()+" "+Period());
}
}
else if (l>0){
if (OrderSend(Symbol(),OP_BUY,l*Loss_Lots_Multiply_Fa ctor,NormalizeDouble(Ask-SL*Point,Digits),Slippage,NormalizeDouble(Ask-TP_SL_Inc*Point,Digits),NormalizeDouble(Ask+TP*Poi nt+TP_SL_Inc*Point,Digits),com,Magic_Number,0,Ligh tBlue)==-1){
i=GetLastError();
if (i!=1 && i!=0) Alert("Buy 1 Error :"+error(i)+" at "+Symbol()+" "+Period());
}else {
TP_SL_Inc=TP_SL_Inc+TP_SL_Increment;
mtr=mtr+1;
GlobalVariableSet("mt_Vager1"+Symbol()+Period(),mt r);
GlobalVariableSet("l_Vager1"+Symbol()+Period(),TP_ SL_Inc);
}
}
}
and I have always the message : "Buy (or Sell) Error : Invalid Stops".
Where is the error ?
Thanks in advance.
Jo