Profile Picture

checking multiple symbols for trading signals?

Posted By uaruss 6 Years Ago
Message
Posted Wednesday November 09 2011
I am trying to look at the value of two separate symbols (on the same New Bar) and, if various parameters are met, perform some action. However, I am not certain as to how to look at multiple symbols at the same time.

For example, if symbol A has close > open for the bar, then the system should determine if symbol B has close < open and, if so, sell symbol B. I tried putting some version of this code in the "New Bar" class, but I'm getting an error message that I can't quite figure out. Thus I have the following questions:

1) Is switching symbols in the "New Bar" class appropriate (assuming I am even switching them correctly. (i.e. --> Symbol.Name = "^IXIC" )?
2) Do I need to have another class to call the new bar class for each symbol, return the results, and then do the comparisons/calculations after each New Bar?
3) Something else?

Thanks!
Russell
Posted Wednesday November 09 2011
You definitely shouldn't try to switch symbols by modifying the symbol name. The "Working with Multiple Symbols" section of the Developing Trading Systems in RightEdge help topic shows how to deal with different symbols. The logic you describe could look something like this:

if (Symbol.Name == "B" && Close.Current < Open.Current && OtherSymbols["A"].Close.Current > OtherSymbols["A"].Open.Current)
{
// Sell
}

Thanks,
Daniel
Posted Thursday December 08 2011
Thanks for the help on this. It took some time, but basically i ended up writing out to a text file, processing the various symbols and then reading back in a few parameters for each bar... it's probably the long way around, but it makes it easy to see exactly what is happening in my logic.

Thanks!


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems