Hey guys,
I am trying to code an EA for a specific plan but I am getting error codes. Such as OrderSend mistake and error 130 138 and such.
Therefore I'm wondering if any of you guys would be willing to help me out here.

I also get things like this where it isn't completely true:

and


The plan is as follows:
Engulfing candle had to breach the Bollinger band.
Entry: 5 pips above/below close of Engulfing candle.
Stop: 5 pips above/below high/low of Engulfing candle.
Target: 2-1 Reward to Risk.

Conditions:
Engulfing candle has to shut above/below the high/low of previous candle.
If we don't get entered through the subsequent 4 candles the trade becomes invalidated.
If candle wick of Engulfing candle is big, use a preceding candle to base the Stop reduction off of.

This is the code I'm currently using:
https://pastebin.com/jUWGDqdV

below are some results I got with this code:



So if anybody would like to check it out and determine exactly what the issues would be that would valued.

Thanks!