Hi @backtrader Thanks for the response.
I should have been more careful with the code snippet I included. Limit order should have been in there, yes.
The point I wanted to make with it was that I can see what I am doing with respect to code order is not correct.
I can see that I am waiting for the initial IF statemant to True before submitting the buy order. I just don't know how else to set it up.
To try and explain what I'm trying to do more clearly:
The data I am using is 30 minute intervals. I am only interested in the closing prices. Again just focussing on the buy order.
Running through the data, say the current self.data.close is 12, and the self.bband.lines.bot is 10.
For the next 30 minutes (i.e. until the next price update), I wish to work a limit buy order at a price of 10.
Once we have the next() update, if the close is now 9 (or lower), I can be 100% sure that I have a fill at a price of 10 (it had to have traded through my 10 bid for the 9's to have printed). And for any close of >= 10, I will assume I have no fill.
so for each half hour, the self.bband.lines.top and self.bband.lines.bot levels are updated to work limit orders for the subsequent 30 minutes.
Does that clear it up? Is that possible to implement?