Hi everyone, 

for the last few days, I tried to implement the inside bar momentum strategy (Babypips). However, I cannot make this strategy profitable. Since this is also my first time with Quantconnect, I am probably doing something wrong. 

The inside bar momentum strategy works as follows (and I am quoting the article here): 

“Long position

The first candlestick must be bullish (green or white) and if the second candlestick is completely contained by the first, set a buy stop order at the first candle’s high plus 10% of its range (high minus low).

Place the stop loss at the first candle’s high minus 20% of its range and set the target at the first candle’s high plus 80% of its range.

Short position

The first candlestick must be bearish (red or black) and if the second candlestick is completely contained by the first, set a sell stop order at the first candle’s low minus 10% of its range (high minus low).

Place the stop loss at the first candle’s low plus 20% of its range and set the target at the first candle’s low minus 80% of its range.

Additional rules

If another inside bar pattern forms, the current position should be closed or the pending buy/sell order must be canceled and entry orders must be updated to the latest candles. “

https://www.babypips.com/trading/forex-inside-bar-20170113

Attached you find my version. I would love to improve and make this strategy work. There is also an implementation on tradingview that is actually profitable, so I guess there is an error in my code. Would be cool if someone could help me out, thanks in advance! :) 

https://www.tradingview.com/script/Y2e6lEXw-Babypips-Inside-Bar-Momentum-Strategy/