ƒ Grid·DCA Intraday
MAY 08 — INTRADAY
# price key gap grid tp
124900.55
114867.0033.552.86
104822.0045.004.00
94775.0047.004.20
84730.0045.004.00
74682.0048.004.30
64635.0047.004.20
54595.0040.003.50
44554.0041.003.60
34513.0041.003.60
24470.0043.003.80
ACTIVE ACCOUNTS · 4
field ● Minh ● VAT 28/04 ● VAT ● Platform Y
account159956839159994119183970898183853975
on/offOnOnOnOn
init lot0.060.150.150.06
grid ratio10.010.010.010.0
dca dist1.01.01.01.0
dca sl15.015.015.015.0
power 14.04.04.04.0
power 28.08.08.08.0
power 316.016.016.016.0
min count3337
anchor key5000.234950.114900.55
GRID & DCA STRATEGY
GRID

Grid Buy/Sell between Keys

When price sits inside a gap (lo, hi), open both BUY and SELL with a small TP equal to (hi−lo)/scalpRangeRatio − 0.5. No SL. Skips if a same-direction order already lives within the same distance.

→ STEP 01 · INSIDE THE GAP
// for each adjacent pair range = hi − lo distance = range / scalpRangeRatio tp = distance − 0.5 // open both sides if no nearby fill Buy(initLot, ask, ask + tp) Sell(initLot, bid, bid − tp)

Both directions fill simultaneously. HasPositionNearby blocks duplicates within the same distance window.

DCA

DCA Higher Lots at Keys

When price is within dcaEntryDistance of a key, fire a counter-trend order sized as positionCount × initLot × power. Each key may only be DCA’d once per side. Requires minCountDca existing positions to arm.

→ STEP 02 · TOUCH THE KEY
// price approaches from above → SELL // price approaches from below → BUY power = [dcaPower, dcaPower2, dcaPower3][tier] dcaLot = cnt × initLot × power SL = dcaSl // no TP, BE handles exit

Gates: must have cnt ≥ minCountDca open, key not in dcaHistory, and no DCA already being tracked.

BREAK-EVEN

Close On Breakeven and Trail

Once a DCA leg exists and aggregate profit covers any prior SL losses (slLoss1 + slLoss2), a peak trail of cnt dollars closes all same-side positions when price pulls back from the high-water mark.

→ STEP 03 · TRAIL TO EXIT
needed = |slLoss1| + |slLoss2| // only if totalProfit ≥ needed peak = max(peak, totalProfit) trail = cnt // dollars // drop below peak − trail → close all

On close, ClearDcaState wipes history, slLoss1, slLoss2, and the peak. Cycle restarts clean.

DCA LOSS RECOVERY
TIER · 0 → 1 1
First DCA stops out
  • Loss saved as slLoss1 (negative)
  • dcaHistory kept — key still locked
  • Next DCA uses dcaPower2
  • Break-even target: |slLoss1|
TIER · 1 → 2 2
Second DCA stops out
  • Loss saved as slLoss2
  • Next DCA uses dcaPower3
  • Break-even target: |slLoss1| + |slLoss2|
  • One last shot at recovery
TIER · 2 → RESET 3
Third DCA stops out
  • Full reset via ClearDcaState
  • History, slLoss1, slLoss2 all cleared
  • Cycle restarts at tier 0
  • Loss is realized — no more recovery