A float from the feed onto the tick grid, as an exact Decimal; None when the venue states no tick. Do arithmetic on the snapped figure, never the float.
Local pre-check mirroring the engine’s: None passes, else the reason. Only a rule the venue stated is judged; notice() names the gaps. The engine re-checks every order.
Sizing on the grid
inst = while25.data.instrument("CRYPTO:GLOBAL:BTC-USD")
stop = inst.snap(ltp * 0.995, mode="down") # a SELL stop, on the tick
if stop is None:
while25.log("no tick on file: not entering", level="error")
elif (why := inst.check(quantity=qty, price=stop)):
while25.log(f"skipping: {why}")
else:
while25.buy("CRYPTO:GLOBAL:BTC-USD", qty, stop_loss=stop)
The SDK itself has no dependencies, so you can write and unit-test a module on a plain Python install before it ever touches the platform. numpy and pandas are available in the runtime. Get the desktop app to run it — Python runs beside the engine, which a browser cannot host.