SShortSingh.
Back to feed

Grid bot backtests often overstate returns by ignoring fees, funding and liquidation

0
·12 views

Many grid bot backtests simply count how often price crosses a grid line and multiply by profit per grid, which tends to produce overly optimistic results. The author notes that taker fees consume a growing share of each step as grids get tighter. Outside the grid's price range, the bot holds a one-sided inventory whose open loss can far exceed the profit collected inside the range. Funding payments on held positions and liquidation risk, which shifts as the grid fills, also need to be modeled, and the author checks liquidation on every price update. The author's simulator walks through the price path within each candle, filling crossed lines in order with slippage, and is offered as a tool running on live public data without requiring exchange keys.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Node.js webhook design: durable inbox, rate-limited consumer, and dead-letter handling for payments

The article argues that a payment or ledger webhook receiver should write incoming events to a durable queue and acknowledge only after that write commits, leaving business retries and dead-letter decisions to a rate-limited consumer. It says an HTTP acknowledgment should signal that a delivery was authenticated and recorded, not that a financial transaction has completed. Duplicate deliveries are to be caught with a unique constraint on subscription and delivery key, so the side effect runs only once. The piece also covers signature verification over the raw body, replay windows, and keeping sensitive data out of logs, and it compares several consumer designs such as inline processing, database polling with row locking, and scheduled batches.

0
ProgrammingDEV Community ·

Developer Builds Flat-Rate Before/After Photo Gallery for Field Crews on Cloudflare

A developer describes how small field service crews often pay $29 to $39 per user monthly for job-photo apps, making costs expensive for larger teams. Because helpers use the software briefly and seasonal staff rotate, per-seat pricing is poorly matched to real usage. The developer built a flat-rate alternative on Cloudflare Pages, D1, and KV to minimize infrastructure costs and replace per-seat fees with team-based billing. The system compresses photos on the device before upload and offers a mobile web app with simple Before/After tagging and shareable client gallery links.

0
ProgrammingDEV Community ·

AI May Let Anyone Build Software, But Many Will Still Prefer Ready-Made Products

An essay argues that as AI makes building software from clear descriptions far easier, the key divide will be between building and using rather than coding ability. It contends that building carries responsibility for correctness, security, and maintenance, which many users will prefer to hand off to product vendors. The author expects a surge in bespoke, short-lived, highly specific tools that were previously uneconomic as commercial products. Commercial software is therefore not expected to disappear, with accountability and judgment becoming the scarce skills.

0
ProgrammingDEV Community ·

Why Stuffing Huge Context Windows Hurts LLM Output, and How to Fix It

Developers often assume that packing entire codebases, logs, and histories into a large-context prompt will improve answers. The article argues that this approach frequently increases latency and API costs while lowering output quality. Transformer attention favors content at the start and end of a prompt, so critical details buried mid-prompt get missed, which can cause instruction drift and hallucinations. To address this, it recommends re-ranking retrieved documents with a cross-encoder and passing only the top few chunks to the model. It also suggests repeating core instructions at both ends of the prompt, using delimiter tags, and summarizing older conversation turns in long-running agents.