My current backtest includes:
Buy when the price of an ETF crosses above its moving average.
And sell when the price of an ETF crosses below its moving average.
I want to change it to:
Buy a specific ETF when the price on an Index crosses above the EMA for the Index.
And sell a specific ETF when the price of an Index crosses below the EMA for the Index.
What do I need to do to accomplish this?
Thank you,
Matt
Size:
Color:
Matt,
Are you working with rules or in code?
Size:
Color:
Rules
Size:
Color:
Current code looks like this...
CODE:
Please log in to see this code.
Size:
Color:
Unless Cone agrees to add these rules to
Community.Rules, I guess you're out of luck with using rules.
QUOTE:
Buy a specific ETF when the price on an Index crosses above the EMA for the Index.
And sell a specific ETF when the price of an Index crosses below the EMA for the Index.
Assuming that you want to change the primary Bars object to the ETF, below is an example...
CODE:
Please log in to see this code.
...to be run on any symbol. Things get really simple if the ETF exists in current DataSet:
CODE:
Please log in to see this code.
Size:
Color: