My questions is related to back-testing for gaps, in both stocks of a Pairs Trading Strategy?
The code below I believe functions properly but I suspect a more elegant or simple method may exist? Here i am filtering all gaps over 3% in either the Pair "Mate symbol" or the "External symbol" on the entry bar and the prior bar.
Any help is appreciated;
CODE:
Please log in to see this code.
Many thanks to Eugene and "superticker" contributor on this forum for all the help to date!!
Size:
Color:
Bill, you could create a simple
method that returns a boolean, passing it a Bars object to operate on (e.g.
external or the primary
Bars) depending on context.
Size:
Color:
Eugene, could you give me a little more of an example please?
Size:
Color:
Something like this (on-the-fly coding, untested) - place on top of (or after) your
protected override void Execute():
CODE:
Please log in to see this code.
Consequently, you call it like this:
CODE:
Please log in to see this code.
For the external symbol, substitute "Bars" with your "external":
CODE:
Please log in to see this code.
I hope this is very much clear now.
P.S. If not for the gap percent you could check for
isGap on a given bar (found in C.Components):
Bar Patterns. Its another limitation is lack of support for external symbol.
Size:
Color:
Thanks Eugene, got it!
Size:
Color:
Any time.
Size:
Color: