Hey Quants, I am new to Quantconnect community and I am thrilled with the potential of this platform as a learning tool. I am new to Python and currently trying to implement a basic test algorithm that covers different aspects of the way I traded manually. The steps of the testing algorithm are:

1. If the current Bar's high(5 minute timeframe) is the highest high within last 15 bars and it is within upper and lower bollinger bands, then place  a stop order to buy at the high of the current bar 5 seconds before the current bar finishes.

2. If and when that stop order is filled, I want to implement a dynamic bracket order where:

  •  As of the end of every bar after trade entry, the algo edits the live profit taking limit order to upper band of bollinger band.
  • As of the end of every bar after trade entry, the algo edits the live stop loss order to the lower band of bollinger band
3. If a trade is on for a symbol, dont enter additional positions for that symbol I have included comments in the backtest that alludes to what I am trying to achieve in that portion of the code. I would love to use pandas to perform step 1 as I am more comfortable with it and it will allow me to build more advanced rules.   

Author