Endless requotes

 

New to this so bear with me. 

When I run this, the EA makes trades as you would expect

      //sell
      if (signal =="sell" && PositionsTotal()<1)
         trade.Sell(0.10,NULL,Bid,0,(Bid-150*_Point),NULL);
      
      //buy
      if (signal =="buy" && PositionsTotal()<1)
         trade.Buy(0.10,NULL,Ask,0,(Ask=150*_Point),NULL);


When I run this EA it doesn't make a single trade and I just get requotes.

      //buy
      if (signal =="sell" && PositionsTotal()<1)
         trade.Buy(0.10,NULL,Bid,0,(Bid+150*_Point),NULL);
      
      //sell
      if (signal =="buy" && PositionsTotal()<1)
         trade.Sell(0.10,NULL,Ask,0,(Ask-150*_Point),NULL);

The output for when it won't make a trade is:

2020.10.15 10:32:58.251 Core 01 2020.02.21 15:01:51   CTrade::OrderSend: instant buy 0.10 GBPUSD at 1.29293 tp: 1.29443 [requote (1.29293/1.29298)]
2020.10.15 10:32:58.251 Core 01 2020.02.21 15:01:53   requote 1.29294 / 1.29299 / 1.29294 (instant buy 0.1 GBPUSD at 1.29294 tp: 1.29444)
2020.10.15 10:32:58.251 Core 01 2020.02.21 15:01:53   requote 1.29294 / 1.29299 (instant buy 0.1 GBPUSD at 1.29294 tp: 1.29444)

I've had a read online but I can't see anything that would be causing this issue that is obvious to me. I've tried setting the deviation as below: 

#include <Trade\Trade.mqh>
CTrade trade;
//ctrade parameters
void  SetDeviationInPoints(
   ulong=10
   );
 
Andrew Longstaff:

New to this so bear with me. 

When I run this, the EA makes trades as you would expect


When I run this EA it doesn't make a single trade and I just get requotes.

The output for when it won't make a trade is:

I've had a read online but I can't see anything that would be causing this issue that is obvious to me. I've tried setting the deviation as below: 

buy at the Ask  sell at the Bid

 
Paul Anscombe:

buy at the Ask  sell at the Bid

I'm an Idiot. I spent way too long yesterday trying to fix that. 

Thanks Paul. 
 
Andrew Longstaff:
I'm an Idiot. I spent way too long yesterday trying to fix that. 

Thanks Paul. 

you're welcome, it is easily done