Hello, I am trying to code a bot based on Bollinger Bands.
The stop loss I want to use is set correctly when a trade is opened yet every trade is closed at random prices (sometimes more than double the pips I set).
The take profit is instead set to trigger when a candle crosses the upper band and this works fine if I use it to open a trade, but it seems it doesn't work when used as a take profit somehow since every trade is closed not at the first close over the band but is closed in a (random) following close.
The code for these are both onBar, but I tried to open the position onTick and the stop loss is still executed wrong.