suspended(): int

Returns 0 when trading is allowed, otherwise the current status of suspended trading. 


0 Trades can be entered.
1 Before the first valid bar (plus lookback period) of the current asset, or after the last valid bar
2 Before the WFO data horizon or inside a SKIP period.
4 Inside a time frame.
8 Outside market hours.
16 [Stop] button was clicked.

The numbers can be combined, f.i. 12 = 4+8 = inside a time frame and outside market hours.



// don't shift series outside market hours
if(suspended()&8) set(NOSHIFT); else set(NOSHIFT|OFF);

See also:

Bar, frame, wait, BUSY, market, TimeFrame, BarZone, BarMode

► latest version online