Каталог файлов форума

Список вложений в сообщениях, оставленных на этой конференции.

Все файлы форума: 1270

Добавлено: evge » 10 апр 2021, 12:43

Тема: Re: Несколько входных рядов в стратегиях

Текст сообщения:

Задал 3 ряда для теста: H1, M30, M1. Один инструмент.

H1 - Торговый!

Inputs-01.png
Inputs-01.png (11.64 КБ) 23180 просмотров


Тест за 09.04.2021

в лог пишу 3 строки подряд за итерацию

Input1: BarDate:08.04.2021 0:00:00 BarTime:18:00:00
Input2: BarDate:08.04.2021 0:00:00 BarTime:18:30:00
Input3: BarDate:09.04.2021 0:00:00 BarTime:10:00:00

Input1: BarDate:08.04.2021 0:00:00 BarTime:18:00:00
Input2: BarDate:08.04.2021 0:00:00 BarTime:18:30:00
Input3: BarDate:09.04.2021 0:00:00 BarTime:10:01:00

Input1: BarDate:08.04.2021 0:00:00 BarTime:18:00:00
Input2: BarDate:08.04.2021 0:00:00 BarTime:18:30:00
Input3: BarDate:09.04.2021 0:00:00 BarTime:10:02:00

Код: Выделить всё

function Initialize()
{
   StrategyName = "Inputs";
   AddInput("Input1", Inputs.Candle, 60, true, "GAZP=МБ ЦК");
   AddInput("Input2", Inputs.Candle, 30, false, "GAZP=МБ ЦК");
   AddInput("Input3", Inputs.Candle, 1, false, "GAZP=МБ ЦК");
}

function OnUpdate()
{

   WriteLine("c:\\temp\\inputs.txt", String.Format("Input1: BarDate:{0} BarTime:{1}",  Input1.BarDate(), Input1.BarTime()));

   WriteLine("c:\\temp\\inputs.txt", String.Format("Input2: BarDate:{0} BarTime:{1}",  Input2.BarDate(), Input2.BarTime()));

   WriteLine("c:\\temp\\inputs.txt", String.Format("Input3: BarDate:{0} BarTime:{1}",  Input3.BarDate(), Input3.BarTime()));

}