Modifying Adaptive Price Channel for index
Author: innertrader
Creation Date: 9/29/2011 12:49 PM
profile picture

innertrader

#1
WL 6.2

RE:
Strategy Name: ActiveTrader 2009-06 | Adaptive price channels by Riccardo Ronco
Author: Eugene
Created: 11/9/2009 5:38 AM

I would like to test this strategy against an index, and buy/sell an ETF or reverse ETF to simulate buy/sell and short/cover of the index. I have tried to modify the code using GetExternalSymbol and SetContext / RestoreContext, but I haven't found the right approach. I have the index and the ETF derivatives in the same Dataset folder.

Fundamentally, I don't understand how to keep the index trade triggers intact, while buying the ETF and not actually buying the index, and how the ETF positions are treated by the IsPositionActive logic in the original code. Finally, since this strategy uses Stops, if I try to change shorts into purchases of a reverse ETF using the stop price of the index channel, that's not going to work, since it's on the wrong side of the channel.

Am I approaching this the correct way? Do you think what I want to do can be accomplished by making some surgical changes to the posted code, or it a logic rewrite of the code flow? I would appreciate any guidance you can provide.
profile picture

Eugene

#2
For a design pattern you might want to take a look at this strategy:

ActiveTrader 2011-05 | Inverse ETF switching system
profile picture

innertrader

#3
Thank you Eugene. This is helpful in terms of a design pattern for long/short ETF pairs. However, the example uses the ETF data to determine trading signals, not the underlying index. I want to use the index. Do I have to build a relationship between the index and the pair members?
profile picture

Eugene

#4
QUOTE:
I would like to test this strategy against an index,

Please express your trading idea as simply and clearly as possible.
profile picture

innertrader

#5
As an example, I would like to run the strategy on an index such as SPX and purchase and sell IVV (SPX tracking ETF) and SH (SPX inverse tracking ETF) when buy/sell or short/cover signals are generated by the strategy using the SPX index. Does this help clarify?
profile picture

Eugene

#6