This variable "Slippage_pip" is ignored if you use "Market Execution" type. Some brokers provide "Instant Execution" type ~ this will work. See the picture below (my broker has no "Instant Execution" type ~ which mean I cannot use "Slippage_pip" variable):
This variable "Slippage_pip" is ignored if you use "Market Execution" type. Some brokers provide "Instant Execution" type ~ this will work. See the picture below (my broker has no "Instant Execution" type ~ which mean I cannot use "Slippage_pip" variable):
Hi to all
in my EA slippage and spread filter doesn't work on real account . please guide me
Code lines related to slippage
extern int Slippage_pip=100;
//int Slippage_pip;
double dig;
datetime time_start;
int curr_band=0;
datetime Prevtime;
double PrevSellPrice, PrevBuyPrice;
datetime Indi_Count_Time;
point=Point;
dig=1;
if(Digits==5 || Digits==3)
{
Takeprofit=Takeprofit_pip*10;
Stoploss=Stoploss_pip*10;
// Slippage_pip=Slippage_pip*10;
point=Point*10;
dig=10;
}
ticket = OrderSend(Symbol(),OP_SELL,Lots,NormalizeDouble(entry,Digits),Slippage_pip,st,tp,DoubleToStr(num,Digits),magic,0,Red);
lasterror=GetLastError();
if (ticket<0) Print("2Ticket : ",ticket," Error :",lasterror," ",Symbol()," sell Lots: ",Lots," ask: ",entry," st: ",st," Tp: ",tp," num: ",DoubleToStr(num,0));
Sleep(100);
ticket = OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(entry,Digits),Slippage_pip,st,tp,DoubleToStr(num,Digits),magic,0,Blue);
lasterror=GetLastError();
// Print(num," ",Lots);
if (ticket<0) Print("2Ticket : ",ticket," Error :",lasterror," ",Symbol()," Buy Lots: ",Lots," ask: ",entry," st: ",st," Tp: ",tp," num: ",DoubleToStr(num,0));
Sleep(100);