TP & SL Parameters

 

Hi,

I am building and developing a new bot and it tried to enter buy and sell trades based on set parameters however when it tried to place a trade the debugger keeps saying "buy failed deviation 10 invalid stops"

Any help or advice would be much appreciated or if someone can review the code to highlight what i am missing 

 
joshtrader:

That error usually means your SL or TP is too close to the current price or placed incorrectly (e.g. SL above the price on a buy).

Check SYMBOL_TRADE_STOPS_LEVEL and make sure you're respecting the broker's minimum stop distance.

SYMBOL_TRADE_STOPS_LEVEL

Minimal indention in points from the current close price to place Stop orders

int