what time it is?
I have a study running on a 5 min chart. I issue a stoplimit buy order and wait for a fill. As soon as I get filled, I want to enter my stoplimit orders to close the position.
If I use getCurrentBar=-1, the fill is not detected til the bar closes, maybe some 5 minutes later. I want to enter the stop order sooner than that.
So I decided to use Date.getMinutes(), which apparently is a cpu hog.
I was watching the minutes and check for a fill if the minutes increased. ie once per minute.
Any one have any other ideas on how to monitor for an intra bar fill and then issue the stop limit orders mid bar with some other strategy?
I have a study running on a 5 min chart. I issue a stoplimit buy order and wait for a fill. As soon as I get filled, I want to enter my stoplimit orders to close the position.
If I use getCurrentBar=-1, the fill is not detected til the bar closes, maybe some 5 minutes later. I want to enter the stop order sooner than that.
So I decided to use Date.getMinutes(), which apparently is a cpu hog.
I was watching the minutes and check for a fill if the minutes increased. ie once per minute.
Any one have any other ideas on how to monitor for an intra bar fill and then issue the stop limit orders mid bar with some other strategy?
Comment