Weekend

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

Range:

0 - trade even during the weekend. For test purposes or for 24/7 traded assets, such as cryptocurrencies.
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).
3 - don't begin or end bars, don't observe exit limits, and don't run TMFs during the weekend.
+4 - log off at weekend when there are no weekend bars. Only recommended if the broker API tends to crash when the broker server goes offline.
+8 - don't enter trades outside the StartMarket and EndMarket time in the selected asset's time zone (AssetMarket).
+16 - don't begin or end bars outside the StartMarket and EndMarket time in the first asset's time zone (AssetMarket). 

Type:

int

Remarks:

Example:

function run()
{
  ...
  StartWeek = 10400; // start Monday 4 am
  EndWeek = 51900; // end Friday 7 pm
  Weekend = 1+4+8; // log off during the weekend and don't enter trades outside market hours
  ...
}

See also:

bar, BarPeriod, Stop, StartWeek/EndWeek

 

► latest version online