Schedule (Scheduled buy)¶
Scheduled buy is due is an entry condition. Due is 1 on the candle whose close is the first close at or after a UTC time you set, and 0 on every other candle. On candle close, the buy is decided at that close and fills at the next candle's open (When orders fill). When that time is itself a candle close, the fill is the time you set: a 1d Monday 00:00 buy fills Monday 00:00.
With Buy and Hold, each time the condition turns on buys one more position size, and the position stays open. The exit is still Standard Exit, Indicator-Based Exit, or Buy and Hold. A Time stop is optional on Standard Exit and Indicator-Based Exit.
Trading hours are a separate control. They choose when entries may open. This condition is the buy.
Settings¶
| Setting | Default | What it does |
|---|---|---|
| Every | Every week | How often a buy is due, in UTC. Every day, Every 2 days or Every 3 days count from 1 January 1970. Every week, Every 2 weeks or Every 4 weeks count from the week of Monday 5 January 1970, so the same weeks stay due. |
| Day | Monday | The weekday of a weekly schedule, Monday through Sunday. For every 1, 2 or 3 days the weekday is ignored, and the builder says so. |
| Time | 00:00 UTC | The UTC hour the buy is due, from 00:00 to 23:00. A time that falls inside a candle is decided at the first close at or after it, so the fill can be late by almost one candle. The builder says how late. |
A new condition starts at every week, Monday, 00:00 UTC.
Ready-made conditions¶
| For | Condition | Fires when |
|---|---|---|
| Buy or sell | Scheduled buy is due | the candle whose close is the first close at or after the scheduled UTC time (Due is 1). It is 0 on every other candle. |
Warnings¶
- "… is set for 09:00 UTC, which falls between 1d candles. The buy is decided at the first 1d close at or after that time, up to 15 hours late.": the hour is not a candle close. The buy still happens, at the next close. The hours in the message follow the timeframe (09:00 on 1d is 15 hours late; on 1h every whole hour lines up, so this warning does not appear). Pick an hour the candles close on (00:00 on 1d), or a shorter timeframe. You can still save it.
- "… buys every day at 00:00 UTC. The weekday is only used by a weekly schedule, so it is ignored.": Day does nothing for every 1, 2 or 3 days. The same warning says "every 2 days" or "every 3 days" when that is what Every is set to.
- "… is due on every 1d candle. A Buy and Hold strategy buys when the signal turns on, so it would buy only the first time. Use a schedule further apart than one candle, or a shorter timeframe.": the schedule is due on every candle of this timeframe (every day on 1d candles, for example). Buy and Hold buys when Due turns on. While Due stays on, it buys once and then waits for Due to turn off and on again. Monday 00:00 UTC on 1d with On candle close is further apart than one candle, so this warning does not show.
- "Touch trigger: a scheduled buy can fill at the open of the candle that closes at the scheduled time, up to one candle before it. Use On candle close to buy at the scheduled time.": On candle touch can fill when that candle opens, which is up to one candle early. On candle close fills at the scheduled time when the candles line up. The builder recommends On candle close.
- Blocks Save: Every must be one of Every day, Every 2 days, Every 3 days, Every week, Every 2 weeks, Every 4 weeks. Day must be a weekday name (Monday through Sunday). Time must be a whole UTC hour.
Good to know¶
- Due is 1 or 0. It reads the candle's open time.
- The library's Scheduled weekly buy can be added. It is every Monday at 00:00 UTC on 1d candles with On candle close and Buy and Hold, so it buys at Monday 00:00 and the warnings above do not apply.
- The schedule uses UTC. Time is a whole hour, and Every is one of the six choices in the table.
- Needs 2 candles, to read how long a candle is.