This commit is contained in:
wvr committed 2026-11-22 02:31:07 -06:00
1 parent 88ff433023
commit f6af0f8ff2
2 files changed
+4 -3

No files matched your search

+4 -3
View File
@@ -62,6 +62,7 @@ stopUsd = input.float(2000, "Stop $", step = 50, group = grpS, tooltip = "Fres
targetUsd = input.float(3000, "Target $", step = 50, group = grpS, display = display.none)
atrFrac = input.float(0.20, "Stop as share of daily ATR", step = 0.01, group = grpS, display = display.none)
maxC = input.int(4, "Max contracts (full-size)", minval = 1, group = grpS, display = display.none)
nqFull = input.bool(true, "NQ: always full contracts (no MNQ)", group = grpS, tooltip = "Fleet test 2016-26: always at least 1 NQ beat the micro switch by about $0.4-0.8k a year, and it is simpler to enter. Other markets keep the micro switch.", display = display.none)
costUsd = input.float(20, "Stop: cost allowance per contract, round trip ($)", step = 1, group = grpS, tooltip = "Commission plus slippage. Taken off the stop, which can slip.", display = display.none)
costUsdM = input.float(3, "Stop: cost allowance per micro, round trip ($)", step = 0.5, group = grpS, display = display.none)
grpE = "Evaluation endgame (one account at a time)"
@@ -213,8 +214,8 @@ endOn = needUsd > 0
stopEff = endOn and needUsd <= endThr ? needUsd : stopUsd
tgtEff = endOn ? needUsd : targetUsd
sizeFor(atrD, pv, mt, comm, commM, ratio, mtM) =>
micro = stopEff < 0.75 * pv * atrFrac * atrD // stop too small for one full contract at the ATR stop distance
sizeFor(atrD, pv, mt, comm, commM, ratio, mtM, bool forceFull = false) =>
micro = not forceFull and stopEff < 0.75 * pv * atrFrac * atrD // stop too small for one full contract at the ATR stop distance
p = micro ? pv / ratio : pv
cap = micro ? maxC * ratio : maxC
tk = micro ? mtM : mt // QG ticks 0.005, NG 0.001
@@ -338,7 +339,7 @@ nqEntry = pending ? (useNews ? "8:31 / 8:33 / 9:31 / 9:33" : "9:31 / 9:33") :
// ---------- sizing ----------
[gcN, gcSp, gcTp, gcRiskUsd, gcRewUsd, gcMicro] = sizeFor(gcAtr, gcPv, gcMt, gcComm, gcCommM, 10, gcMt)
[clN, clSp, clTp, clRiskUsd, clRewUsd, clMicro] = sizeFor(clAtr, clPv, clMt, clComm, clCommM, 10, clMt)
[nqN, nqSp, nqTp, nqRiskUsd, nqRewUsd, nqMicro] = sizeFor(nqAtr, nqPv, nqMt, nqComm, nqCommM, 10, nqMt)
[nqN, nqSp, nqTp, nqRiskUsd, nqRewUsd, nqMicro] = sizeFor(nqAtr, nqPv, nqMt, nqComm, nqCommM, 10, nqMt, nqFull)
[ngN, ngSp, ngTp, ngRiskUsd, ngRewUsd, ngMicro] = sizeFor(ngAtr, ngPv, ngMt, ngComm, ngCommM, 4, 0.005)
// ---------- display ----------