Reproducing signals from any symbol on all other symbols
Author: dansmo
Creation Date: 8/23/2010 4:33 AM
profile picture

dansmo

#1
Hi,

I want to trade the signals from one symbol on all other symbols in the DataSource, too.
What would be the easiest way to adapt the code to accomplish this?

Only way that comes to my mind is to have the symbol that generates the trading decisions to get by GetExternalSymbol.
However, this would mean that I would have to re-write the whole script. Maybe there is a more elegant solution?
profile picture

Eugene

#2
Global memory?
profile picture

dansmo

#3
Can you elaborate a bit more on the idea?
Lets take the following simple MA crossover code:
CODE:
Please log in to see this code.


I have a DataSource with three symbols. All the entry signals of symbol1 should generate entry signals on the other symbols in the DataSource. I dont have a clue how to do this with Global Memory.
profile picture

Eugene

#4
Right now just before the release of WL6 we have limited time for custom programming, so please check out the QuickRef on SetGlobal, GetGlobal etc.
profile picture

dansmo

#5
What do you think that I should save to Global memory? I dont get the idea behind it, the concept.
profile picture

Eugene

#6
For instance, the bar which triggered the signal. If the one retrieved from global memory is equal to the current bar, there's a trading signal fired by one of the other stocks, so you unconditionally buy/short the current symbol (even if a e.g. CrossOver buy signal isn't triggered).

Note that Wealth-Lab loops by symbols in alphabetical order, so if your trading signal comes from "MSFT", you obviously won't buy "AAPL" because it has already been processed. I leave coding a workaround for this puzzle up to you.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).