Determines the behavior during weekend bars (by default, Friday 20:00 UTC until Sunday 23:00 UTC) and at international business holidays.


0 - trade even during the weekend. For special purposes only.
1 - don't enter trades during the weekend, but generate bars, observe exit limits (stop / takeprofit / trail), and run TMFs when price quotes arrive
2 - don't begin or end bars during the weekend, but observe exit limits and run TMFs when price quotes arrive (default - see remarks).
3 - don't begin or end bars, don't observe exit limits, and don't run TMFs during the weekend.
7 - automatically log off at weekend; recommended if the broker API tends to crash when the broker server goes offline.





function run()
  StartWeek = 10400; // start Monday 4 am
  EndWeek = 51900; // end Friday 7 pm
  Weekend = 7; // log off during the weekend

See also:

bar, BarPeriod, Stop, StartWeek/EndWeek


► latest version online