ShriAlgoEdge 1.0 {{RELEASE_VERSION}} | {{PACKAGE_DATE}}

VERSION 138.4 - ZEBU NATIVE STREAM PROTOCOL AND SUBSCRIPTION FIX
Uses the verified XTS Engine.IO 3 protocol, server-established default
namespace, and client ping/server pong with the broker's advertised timers.
Missing pongs close the failed transport and use bounded automatic reconnect.
Owned subscription removal uses PUT. Shared duplicate subscriptions retain
ownership protection. Current depth can keep the connection healthy while
an older last trade remains ineligible for execution; the five-second
execution freshness and existing order/UNKNOWN controls are unchanged.

See README-V138.4.md and the delivery RELEASE-NOTES.md for exact verification
results and live-test limits. This separate release does not install itself.
138.3 is preserved. Close only the intended instance before using Update;
retain normal position/pending-order handling and installer backup checks.
No live broker order was submitted for this release verification.

RETAINED PREVIOUS FEATURES / HISTORICAL NOTES

VERSION 138.2 - XTS MODIFY ID + APP TRAILING FALLBACK
SISL modification order IDs use exact decimal JSON strings.
ZebuAP retains its existing wire format and routing.
New deployments monitor desired trailing levels even when a price-only
broker modification is rejected or still unconfirmed.
On hit: save intent -> cancel old SL -> confirm terminal status/fills ->
exit confirmed residual only. Full SL fills cause no extra exit.
Existing freshness, identity, persistence, quantity and RMS checks remain.
A trailing rejection alone does not hold the strategy. Cancel failures or
uncertain outcomes retain existing recovery/confirmation requirements.
No duplicate/competing exit is permitted by the new trailing fallback.
Old saved deployments retain their previous versioned behavior.

Close the selected app and finish positions/pending orders before updating.
The installer retains its update backup, running-instance and data checks.
Live Share India broker acceptance awaits the user's manual test.
See README-V138.2.md in the full source and the delivery release notes.

RETAINED V138 UI AND HISTORICAL NOTES
VERSION 138 - UI MODERNIZATION (BASE v0137 CARRY RECONCILIATION)
Modern shared grids/tabs, workspace navigation, Ctrl+F / Find Next,
focus mode, compact/comfortable rows and application/execution log tabs.
Hidden display-only views refresh on activation; portfolio/strategy P&L,
risk, broker confirmation, persistence and timer ownership retain v137 logic.
The runtime remains WinForms / .NET Framework 4.8.
See README-V138.md and docs-v138 in the full source package for audit,
measured grid timings, exact tests and remaining live validation scope.
Presentation fallback: SAE_UI_REFRESH_LEGACY=1 before starting the app.
This switch is read once at startup and does not downgrade trading data.

RETAINED BASELINE FEATURES / HISTORICAL NOTES
VERSION 137 - KOTAK CARRY RECONCILIATION (BASE v0136)
Broker-native opening carry is kept separate when today's manual close and
today's APP fills share a contract. Confirmed gross day fills must reconcile.
Today's APP SL/exit quantities stay its own. Retained prior-day APP carry is
not added twice; missing/uncertain evidence and existing recovery guards remain.
Manual completion also rolls back its Completed label if the DISARM save fails.
See RELEASE-NOTES-v0137.txt in the source and RELEASE-NOTES.txt in the delivery.

NEW OPTIONAL STRIKE FILTERS
Leg builder > Strike selection: interval Default / 50 / 100, and premium
scope All / ATM-OTM only / ATM-OTM + 1 ITM. Both default to previous behaviour.
ATM and first ITM use the original listed chain before the interval filter.
Both enabled filters must match. Existing premium caps and execution remain.

VERSION 127 - 125.2 BASE + v126 WARM-UP FALLBACK

Warm-up / pre-selection order:
Selected Primary -> strategy account's Own feed -> Backup 1 -> Backup 2.
Unconfigured sources are skipped and duplicate feed identities are used once.
Warm-up begins 2 minutes before entry. Preview checkpoints remain at
30 / 20 / 10 / 5 / 1.5 seconds before entry. Saved OFF preference is preserved.
Each preview uses one source with valid quotes for all configured legs. A missing,
stale or incomplete source falls through to the next source; all unavailable = WAIT.
Each checkpoint tries Primary first. Final selection runs again at entry.

125.2 ZebuAP/SISL login, funds and nonempty position-book fixes are retained.
Version 125 strategy execution, ORB, quantity, exits and RMS are retained.
See RELEASE-NOTES-v0127.txt and verification-v0127 for this merged build.

SAE 1.0 / StraddleLab {{RELEASE_VERSION}}
Package date: {{PACKAGE_DATE}}

ORB AVAILABLE-QUOTE POLICY (v0125)
New ORB deployments keep each fixed leg's observed High/Low from [window start,
window end). Missing ticks of any duration do not invalidate that range or require
historical candle verification. At window end + 1 second, a fresh current LTP
above the saved SELL Low creates broker SL-limit; at/below Low creates buffered
LIMIT immediately, without waiting to retouch Low. Existing max(5%, Rs 1) buffer
and contract tick rounding are retained.
If the window has at least one valid quote but feed is still unavailable at its
end, wait up to 30 seconds from window end. Fresh feed during this wait uses the
normal LTP decision immediately. With no feed at end + 30 seconds, send only an
initial SELL SL-limit at the saved Low; no live LTP is invented. Broker acceptance
and fills still decide execution. Unknown/rejected requests retain existing
reconciliation; there is no blind duplicate or market fallback.
If the entire window has zero valid quotes, use its first valid post-window quote
as reference. Until that first price exists, no price can be submitted. CE/PE keep
separate levels. Source/contract/session/RMS/exit/arming checks remain applicable.
Already-deployed ORB runs with no selected contract keep waiting for a valid
selection until today's scheduled exit, including after an empty quote window.
Older saved runs retain their original policy. Deploy a new run for this behavior;
installation does not resume trading or migrate a pending order. Entry delays and
underlying/high/other-direction rules retain their configured execution behavior.
Tests are offline with synthetic brokers. Live broker acceptance is not verified.

INSTALL / UPDATE
Run Setup.exe and choose SAE 1.0 1 through SAE 1.0 99. Each number has its
own install folder, Data, broker profiles, strategies, Telegram settings,
Desktop/Start menu shortcuts and uninstall registration.
Default: LocalAppData\Programs\ShriAlgoEdge 1.0\SAE 1.0 <number>.
Fresh install starts empty; it never copies another instance's credentials.

To keep an existing workspace, close only that instance, choose Update and
select its number and existing app folder (containing StraddleLab.exe).
An older unnumbered installation can be assigned an unused number during
Update, or retained through Existing / custom folder (legacy StraddleLab).
Its current Data folder stays in place. Do not move numbered folders.
Other running instances stay untouched. Setup does not start trading apps.
Normal setup provisions a shared 5 GB emergency reserve and needs at least
5 GB additional free disk. .NET Framework 4.8 or later is required.
Prerequisites contains the verified offline runtime installer.

Uninstall through Windows Installed apps using the exact instance name.
Close that instance and handle its broker positions/pending orders first.
Its Data and backups stay. Only its app files, shortcuts, startup tasks and
registration are removed. Other instances remain installed.

TELEGRAM REGISTRATION -> APP CONNECT
1. Create a DIFFERENT bot in @BotFather for EACH app instance. Keep its
   token private. The same Telegram person may manage several bots.
2. In that app's TELEGRAM settings, save its bot token and enable
   Telegram/remote access.
3. Click REGISTER / CONNECT. Wait for Ready. Click REGISTER IN TELEGRAM
   or copy the registration link to your phone, then press Start in that bot.
   COPY PAIR COMMAND is also available as a manual alternative.
4. Confirm the numeric private Telegram user ID displayed in the app.
   Wait for PAIRED AND SAVED, then send /help in the bot chat.
5. Additional people use the SAME instance's bot. Pair their private IDs
   and assign account scope/permissions locally. Never share pairing codes.
6. Enable TELEGRAM OPEN locally if /open or /loginall must open a closed
   app. Each instance has its own launcher. Give each instance a separate
   bot; one bot cannot be polled by two local instances at once.

COMMANDS
/status /help /users /accounts /orders /positions /strategies
/mtm /margins /strategymtm /portfoliomtm /portfolios /alerts
/open - focus/open this instance
/loginall - saved Dhan feed plus broker LOGIN + ARM preview
/apilogin - broker LOGIN + ARM without requiring Dhan configuration
/starttrading - ARM verified broker sessions for saved deployments
/stoptrading - DISARM and pause paper; does not square off broker positions
/executeportfolio <ID> - saved portfolio/account setup for today
/squareoff [ALL | run ID | account/client ID] - app-owned runs only
/squareoffstrategy <source/run ID or unique exact name>
/squareoffportfolio <portfolio ID or unique exact name>
/exitorder <order ID>:<account/client ID> - exit that app leg tree
/completestrategy <run ID> - attest manual closure; estimated local PNL
/resume /baskets /runbasket /dhan /arm /squarebroker remain available.
/exitbroker <ID> regular and /exitallbrokers regular explicitly include
manual broker exposure. Use /help for scope and required permissions.

Trading actions show a scoped preview. /confirm <code> is valid once for
two minutes; /cancel clears it. Reports label cached, stale and estimated
values. A command receipt is not a broker fill receipt.
DEL11 stays data/login-only. Login prerequisites run first, including
DEL11 before VDEL11. Broker readiness, RMS, STOP and UNKNOWN checks remain.
Two-minute default-ON warm-up and saved OFF preference remain. Quantity, exits
and Telegram account scopes retain their existing behavior; ORB changes are above.

VALIDATION
Isolated instances, synthetic Telegram/broker transports and package
checks only. Testing performs no real login, Telegram message, order,
installed-app update or restart. Live pairing and broker acceptance need
the user's check. See RELEASE-VERIFICATION.json for verified scope.

