Hi,
I would like to trade an asset only during the allowed frame. The asset is US-SPX-500 and, accordingly with my broker Oanda can be traded:
Sun-Thu: 23:00 - 21:14; 21:30 - 21:59
Thu-Fri: 23:00 - 21:14; 21:30 - 21:59
GMT Time
Code:
WeekEnd = 4+8;
AssetFrame = UTC;
StartMarket = 23; (or StartMarket = 0; ?)
EndMarket = 2159;


Now if the barperiod is high the gap between 21:14 and 21:30 is not relevant and
Code:
if(!suspended()) enterLong();


should make the trick.

Questions:
- in a multi-asset TS is the approach correct?
- StartMarket 23 o 0?
- to handle the trading gap between the only way is to check the time with lhour() and minute()?

Thank you in advance

Last edited by MatPed; 03/10/18 10:54.