SShortSingh.
Back to feed

Pine Script Coder Adds Daily Profit Cap to Meet Prop Firm Consistency Rule

0
·5 views

A developer shares a Pine Script method for enforcing a trading consistency rule that limits any single day's profit to a set share of the total profit target. The approach stops each day at a capped profit price, and no new entries are taken once that cap is reached. In back-to-back evaluations on two years of MNQ futures data, the cap raised the number of evaluations meeting the rule from one to 33 of 98. Four evaluations still failed because a trade overshot the cap on its first candle before the limit order could fill. The code tracks closed-trade profits after costs from the evaluation start, resetting each futures day at the 18:00 New York reopen.

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 ·

Un chatbot sobre Couchbase: por qué un campo inexistente no genera error

Un desarrollador describe cómo conectó un modelo de lenguaje a una colección de Couchbase Capella con esquema flexible. El problema identificado es que una consulta sobre un campo inexistente no falla, sino que devuelve un resultado vacío que puede parecer una respuesta válida. Para evitarlo, el sistema inventaría los campos reales por categoría y los inyecta en el prompt del modelo. Además, un guardia de lista blanca contrasta cada ruta de la consulta generada con ese inventario antes de ejecutarla. Las operaciones de escritura pasan por una simulación previa y requieren confirmación del usuario.

0
ProgrammingDEV Community ·

Malicious GGUF Language Models on Hugging Face Reportedly Affected About 2,400 Users

Security reports indicate that some GGUF-format large language models hosted on Hugging Face contained hidden malware. The infected models reportedly reached roughly 2,400 people who downloaded them. The article uses the incident to argue that developers should vet third-party AI models and dependencies before use. It also calls on model hosting platforms to strengthen their screening processes. The piece is largely reflective, drawing on the author's own experience with dependency risks and code review practices.

0
ProgrammingDEV Community ·

Shadow DNS: How Devices Bypass Your DNS Filtering and How to Find Them

DNS filtering only protects devices that actually send their queries to the filtering resolver, which many do not. Smart TVs, IoT gadgets and some phones hard-code external resolvers, while browsers and operating systems increasingly tunnel DNS over HTTPS or DoT, hiding it from network-level blocklists. This creates 'shadow DNS' that leaves SOC teams blind and silently defeats threat-intel blocking and compliance policies. The author open-sourced shell tools, dns-leak-check.sh and arp-dns-watch.sh, to audit which hosts can reach external DNS on networks the user owns. The article also advises redirecting or blocking outbound port 53 at the gateway to close the gap.

0
ProgrammingDEV Community ·

FEFO vs FIFO: Allocating Stock by Expiry Date in Code

A common stock-picking approach selects inventory batches by arrival date, which is problematic for goods with expiry dates. The batch received first may not be the one that expires first, so this method can leave stock to spoil. The article presents a short JavaScript function that sorts batches either by earliest expiry (FEFO) or earliest arrival (FIFO) and allocates the requested quantity accordingly. Using ISO date strings allows direct string comparison without date parsing, and an example shows FEFO picking from a later-arriving batch that expires sooner. The author also outlines extra safeguards such as tie-breaking rules, minimum remaining shelf life per customer, skipping blocked batches, and recording allocations for traceability during recalls.