Hello I make a dataset with 2 US stocks (BAC - AAPL)
And I make this really easy code to find a problem with GetExternalSymbol that I have when I execute it with the Strategy Monitor on this 2 stocks DataSet
The code buys when the last bar close is over 50. Nothing else.
Close[Bars.Count - 1]>50
But I want to use GetExternalSymbol calling diferent references depending on the stock included in the dataset and the problem is really the same.
I know EURNOK (Euro / Norwegian Krone) Daily Close is over 5 now.
I Know EURUSD (Euro/ US dollar) Daily Close is less than 5 now.
So I want buy AAPL which Daily Close >10 and don4t buy BAC which Daily Close<10 and make this code for screener:
CODE:
Please log in to see this code.
If I execute the screener with the Strategy Monitor choosing a single Stocks it works
I select AAPL from the Dataset ----Buy. Perfect!!!!
I select BAC from the Dataset------- Don't Buy. Perfect!!!!
I select the DataSet with the 2 stocks (BAC - AAPL)
And it does not work and I have an error: Object reference not set to an instance of an object
Of course, I have the the historical prices for AAPL, BAC, EURUSD, EURNOK
In fact, if I select a only one stock for the Strategy Monitor it works fine, if I select the DataSet, I have the error.
With the GetExternalSymbol, sometimes I need to choose EURNOK and sometimes I need to choose EURUSD depending on the stock I have included in the dataset , but it doesnt work when I select a multisymbol dataset on the Strategy Monitor