@backtrader14 said in A day buy and close trade with cheat on open and stop loss:
Is there any way to put my custom stop loss with the logic I mentioned in post. Will this work?
You want to make 3 decisions per day: go long at
open, issue stop order at
open and, if this order was not executed, sell on
close. Use of intraday time frames is the best and correct way to achieve this.
If you still want to make it with daily bars, than I can see 2 options:
make an indicator which calculates your exit price for each bar (stop order price or close price). Then at each
open issue stop or limit (maybe stop-limit) order along with the entry order.
DaySplitter_Close filter to split bar in two bars. Then during first bar you issue stop order and entry order. And during second bar you cancel stop order if it was not executed and issue sell order. Link to docs - link
I've used approach similar to my first option, but second approach looks better, but I didn't check if it works or not.