evge писал(а):Скорее ничего не выйдет.
Для теста попробовал добавить строку Input.VirtualSecurity= "BRZ7=ФОРТС" в стратегию и выдало ошибку в тестировании:
"Входная строка имела неверный формат"
А вот в таком виде
Код: Выделить всё
Input.IdFI = 144950;
ShowMessage(Input.VirtualSecurity);
работает. Будет показывать Сбербанк.
Попробуйте прикрепленный индикатор.
Код: Выделить всё
function Initialize()
{
IndicatorName = "TestTicker";
PriceStudy = true;
AddInput("Input", Inputs.Candle); // Input - входной ряд (Inputs.Price) или свечи (Inputs.Candle)
AddSeries("TestTicker", DrawAs.Custom, Color.Red); // Задаем вид линии индикатора A
}
function Evaluate()
{
string Path = "C:\\Temp\\";
string readfName="Ticker.txt";
string writefName="Log.txt";
var readURL = Path + readfName;
var writeURL = Path + writefName;
if (System.IO.File.Exists(writeURL))
{
System.IO.File.Delete(writeURL);
}
if (System.IO.File.Exists(readURL))
{
System.IO.StreamReader readSecurity = new System.IO.StreamReader(readURL);
while (!readSecurity.EndOfStream)
{
int intSecurityIdFI = Int32.Parse(readSecurity.ReadLine());
Input.IdFI = intSecurityIdFI;
//ShowMessage(Input.VirtualSecurity);
WriteLine(writeURL,String.Format("{0}", Input.VirtualSecurity ));
}
readSecurity.Close();
}
}
По-моему так можно обрабатывать много тикеров.