background

Tradematic Support Center

Guides, articles, videos and links for Tradematic users and developers.

Как реализовать ограничение количества входов в позицию в день?

25226РЕДАКТОР КОДА КОЛИЧЕСТВО ВХОДОВ

Вам нужно добавить в код стратегии следующий кусок кода:

int counter = 0;
foreach(Position p in Positions) 
{
   if(p.EntryDate.Date == Date[bar].Date) 
      counter++;
}


А в условие на вход - следующую проверку:

Код: Выделить всё
if(counter <= 3)
{
   // вход в позицию
}
This website uses cookies. By continuing to use this website, you consent to our Privacy Policy. OK