I am attempting to break up over time the executions for a pairs strategy. I am currently running daily bars, with the signal generated at the Open. For each signal, I reverse the positions, meaning if short I cover and then go long the same stock and do the opposite for the existing long position. Currently, existing positions are closed out at the Open and new positions are initiated at the Close. I would like to change this to close out positions over 10 or 20 ten-minute bars after 930am and initiate new positions over 10 to 19 of the remaining ten-minute bars while still getting the signal at the Open. (I may try other bar lengths as well.) I believe I need to use SplitPosition and SetScaleDaily with ten-minute bars, but haven't been able to figure it out, especially with two existing positions. Can you point me to any example code that has done something similar? Any help is greatly appreciated. Thanks very much.
CODE:
Please log in to see this code.
Size:
Color:
Size:
Color:
I will try that. Thank you.
Size:
Color: