Hey @williamlowdell2020, I’m so glad to hear that Limit Orders is helping you out!
I went back through the Gist from above and yes, changing instances of “15” to “30” should do the trick ??
If you want a more complete explanation, I’m documenting it here (and will link to this post from the gist):
To create custom intervals using that gist as a starting point, the key lines of code (excluding inline documentation, which should also be updated to match) are:
- Lines 18, 22, 37, and 59 need to be consistent; these can technically be anything you want (e.g. “30min”, “halfHour”, “pizzaTime”, etc.), but they’re used to tell the plugin which interval has been selected.
- Line 43 should have both instances of “15” updated; this line gets the current number of minutes past the hour (0-59), divides it by the interval (in your case, 30), rounds that value down to the nearest integer (using 30, this will always be either a 0 or a 1), then multiplies that integer by the interval (e.g. 0 or 30).
- Line 63 is responsible for determining when the next interval will begin. This uses PHP’s DateInterval class: “PT15M” can be read as “Period Time 15 Minutes”. For a half-hour, the interval would be “PT30M”. Be very careful not to omit the “T”, however, as “P30M” (no “T”) would mean 30 months, which is probably not what you’re looking for ??
-
This reply was modified 4 years, 10 months ago by
Steve Grunwell. Reason: We're talking about the DateInterval class, not an instance of the object