CNI Research Note SEBI Reg. RA: INH000019512

CNI Finsight Institutional Research Archive

Proprietary equity analysis, valuation models & macro commentary by CNI InfoXchange Research Desk.

Equity Analysis Institutional Insights Market Trends 4 Min Read

Parameter-Perturbation में एक-Genuine-Methodological-Concern असली-Design-Issue: हमारा-established-simulate_s2_pullback_entry()-genuinely-Phase-0-के-fixed-k=0.5-pullback-occurrence/timing-को-reuse-करता-है, चाहे-हम-perturbation-में-k_atr-genuinely-कुछ-भी-s

CNI InfoXchange Research Desk
INH000019512 · Published 05 Sep 2026 (3 months ago)
Share
Executive Research Takeaway

आपका suspicion बिल्कुल सही है – यह एक real methodological bug है, और Sharpe का बढ़ना लगभग निश्चित रूप से उसी artifact से आ रहा है, न कि genuinely बेहतर k_atr से।

आपका suspicion बिल्कुल सही है – यह एक real methodological bug है, और Sharpe का बढ़ना लगभग निश्चित रूप से उसी artifact से आ रहा है, न कि genuinely बेहतर k_atr से।


1. अभी वाला design कहाँ पर गलत है?

आपका current flow (सार में):

  • Phase‑0 discovery:
  • fixed k=0.5 से pullback occurrence/timing detect करते हैं → आपको एक t_entry_base (या bar index) मिलता है।
  • Parameter perturbation:
  • k_atr को बदलते हैं, लेकिन उसी t_entry_base पर नया entry price = ref – k_atr * ATR मान लेते हैं,
  • यह verify नहीं करते कि उस bar (या allowed window) में price वास्तव में उस deeper level तक गया भी था या नहीं।

इसका मतलब:

  • आप trade को “fill हुआ मान” रहे हैं, जबकि:
  • real history में वो pullback उस गहरे level तक पहुँचा ही न हो सकता था।
  • जैसे‑जैसे k_atr बढ़ाते हैं, entry artificial रूप से सस्ती होती जाती है (deep pullback), लेकिन:
  • reality में अक्सर वो price कभी आया ही नहीं होगा।

यही कारण है कि:

  • P&L path artificially improve होगी,
  • volatility अक्सर कम दिखेगी (क्योंकि आप बहुत deep hypothetical entries ले रहे हैं),
  • और Sharpe ratio monotonically ऊपर जाता दिखता है (0.30 → 0.44 जैसा आपने observe किया)।

यह classic example है “phantom fills” / “unreachable prices” का – backtest में मान लिया कि trade इन prices पर हुआ, जबकि market में ऐसा कभी नहीं हुआ। Methodologically यह गलत है।


2. Conceptual rule: कौन‑सा parameter कैसे treat करना चाहिए?

आपने दो parameters की perturbation की:

  1. k_atr – जो entry level define करता है → यह signal‑defining / entry‑defining parameter है।
  2. stop_mult – जो सिर्फ़ exit stop distance बदलता है → यह execution‑only / payoff‑mapping parameter है।

Robust practice:

  • Entry‑defining parameters (जैसे k_atr)
  • हर parameter value के लिए यह check करना अनिवार्य है कि:
  • उस level तक price वाकई पहुँचा था या नहीं,
  • और कब first time पहुँचा था (fill timing)।
  • यानी trades की existence और timing दोनों parameter‑dependent हैं।
  • इन्हें fixed discovery पर “reuse” नहीं कर सकते; वरना selection bias और phantom fills बनते हैं।
  • Execution‑only parameters (जैसे stop_mult)
  • Trade तो उसी actual entry bar/price से शुरू होता है जो historically आया था,
  • Stop distance बदलने से सिर्फ़ exit timing/price बदलता है,
  • Price path आपके पास पूरी है, और हर stop_mult के लिए आप objectively देख सकते हैं कि कब कौन‑सा stop hit होता।
  • यहाँ पर existing trades पर payoff re‑map करना methodologically acceptable है।

इस lens से देखें, तो:

  • k_atr को reuse किए गए Phase‑0 events पर बदलना ग़लत है।
  • stop_mult perturbation वैसे किए जाने पर ठीक है, बशर्ते आप entry fills सही निकाल चुके हों।

3. “सही” तरीका क्या होगा k_atr perturbation के लिए?

सख़्त और theoretically clean तरीका:

हर k_atr value के लिए full Phase‑0 discovery दोबारा चलानी चाहिए, ताकि pullback occurrence/timing खुद उसी rule से निकले जो उस k_atr को use कर रहा है।

मतलब:

  • जब rule कहता है “entry तभी जब price ref – k_atr * ATR को touch करे”,
  • तो हर k_atr के लिए:
  • उस threshold की crossing real OHLC data पर check करनी होगी,
  • और first touch का exact bar/time record करना होगा,
  • अगर कभी touch ही न हो, trade simply “no fill” हो जाएगा उस parameter के लिए।

हाँ, ये computationally महँगा है, लेकिन यही ground truth है।


4. क्या कोई cheaper लेकिन methodologically सही approximation possible है?

हाँ, आमतौर पर industry में दो‑स्टेप वाला design use होता है जो काफ़ी cheaper और फिर भी सही रहता है, बशर्ते आपकी strategy structure match करे:

4.1 Setup vs Execution का clean अलगाव

अगर आपकी strategy roughly ऐसी है:

  • Setup (Phase‑0):
  • Trend filter, pattern detection, swing‑high/low, regime आदि detect करना
  • इसमें k_atr नहीं आता, सिर्फ़ बताता है “यहाँ एक potential pullback setup शुरू होता है / trigger होता है”।
  • Execution:
  • उसी setup के context में:
  • Entry level = ref – k_atr * ATR
  • Exit logic (stop_mult, targets आदि)

तो आप ये कर सकते हैं:

  1. Phase‑0 में सिर्फ़ “setup points” detect करें, बिना k_atr के:
  • e.g. bar index जहाँ से आप pullback observe करना शुरू करते हैं,
  • या वो swing point जिसके बाद pullback आना है,
  • trend filter satisfied है या नहीं, आदि।
  1. हर setup के लिए:
  • historical price path (high/low) पहले से store रखें,
  • ATR series भी पहले से precompute कर लें।
  1. अब किसी भी grid of k_atr values के लिए:
  • हर setup पर:
  • k_atr के हिसाब से entry level निकालें,
  • फिर bar‑by‑bar देखें कि:
  • Long case: low ≤ entry_level आता है या नहीं,
  • Short case: high ≥ entry_level आता है या नहीं,
  • अगर आता है तो first touch का bar/timestamp note करें,
  • अगर नहीं आता, तो उस setup पर उस k_atr के लिए “no trade / no fill”।
  • यह सब आप vectorized तरीके से कर सकते हैं; full pattern detection दुबारा चलाने की ज़रूरत नहीं।

यह approach:

  • Full “rerun everything per k_atr” से काफी सस्ता है,
  • लेकिन logically सही है, क्योंकि:
  • हर parameter के लिए actual price crossing check हो रहा है,
  • phantom deeper entries assume नहीं हो रहीं,
  • trades disappear भी कर सकते हैं (जिन पर deeper pullback आया ही नहीं) – जो real behaviour है।

4.2 जो आप अभी कर रहे हैं, वह क्यों unacceptable है

आपकी current method:

  • Setup + entry दोनों ही effectively k0=0.5 पर lock कर देती है,
  • k_atr बदलने पर न crossing check, न timing recalc,
  • बस उसी t पर hypothetical cheaper fill assume हो रहा है।

यह सीधे‑सीधे:

  • Pathwise constraints तोड़ता है (price कभी उस level पर आया ही नहीं),
  • Trade universe incorrectly inflate/deflate नहीं कर रहा, लेकिन P&L को गलत बना रहा है,
  • Sharpe का बढ़ना pure artifact बन जाता है।

इसलिए इसे methodological sense में valid approximation नहीं कहा जा सकता।


5. अभी practically क्या करना चाहिए?

आपके specific सवालों पर direct answers:

1 “क्या यह genuinely bug है और Sharpe बढ़ना सिर्फ़ इसी artifact का result है?”

  • हाँ, design‑level bug है।
  • Parameter‑driven deeper entries बिना price‑touch verify किए लगभग हमेशा Sharpe artificially सुधार सकती हैं।
  • आपके n=87 sample पर 0.30 → 0.44 Sharpe increase इसी गलत assumption का symptom दिखता है।

2 “Parameter‑Perturbation का सही तरीका क्या – हर k_atr के लिए Phase‑0 दोबारा चलाएँ, या कोई cheaper सही approximation है?”

  • Theoretically clean तरीका:
  • हर k_atr के लिए full discovery (setup + entry) rule apply करें।
  • Practically efficient और सही तरीका (अगर structure allow करता है):
  • Phase‑0 में k_atr‑independent “setup points” detect करें,
  • फिर हर k_atr के लिए इन्हीं setups पर entry level और actual crossing को recompute करें,
  • जहाँ crossing ही न हो, वहाँ trade drop कर दें।
  • यह industry‑standard approximation है और methodologically acceptable है।

3 “क्या अभी k_atr perturbation रोक देना चाहिए और सिर्फ़ stop_mult perturbation पर भरोसा करना चाहिए?”

  • हाँ, current implementation के साथ:
  • k_atr perturbation से निकला कोई भी Sharpe या performance conclusion reliable नहीं है,
  • उसे तुरंत “invalid / exploratory only” mark कर देना चाहिए।
  • stop_mult perturbation, अगर:
  • आप entry fills already सही निकाल चुके हैं (real price‑touch के साथ),
  • और सिर्फ़ वही trades पर अलग‑अलग stop distances simulate कर रहे हैं,
  • तो यह design bug से प्रभावित नहीं है और उस पर भरोसा किया जा सकता है।

6. संक्षिप्त actionable निष्कर्ष

  1. Current k_atr perturbation logic को अभी के लिए invalid मानें और उससे निकले Sharpe improvements को discard करें।
  2. Code में यह fix लगाएँ:
  • या तो हर k_atr के लिए full re‑discovery,
  • या ऊपर बताया गया setup‑vs‑execution separation + level‑crossing check per k_atr।
  1. जब तक यह ठीक न हो, सिर्फ़ उन parameters की perturbation पर भरोसा करें:
  • जो entry existence/timing को नहीं बदलते (जैसे stop_mult, profit targets, slippage assumptions),
  • और जिनके लिए आप underlying price path पर deterministic re‑valuation कर रहे हैं।

अगर आप चाहें तो अगली बार अपने pseudo‑code / function skeleton (simulate_s2_pullback_entry) share करें, तो उसी पर directly सही loop structure और checks suggest किए जा सकते हैं (purely methodological, बिना किसी live data के)।

If you have any further queries, please connect with us on 022-6290-10141 (Timings : 09.00 AM to 05.00 PM) or you can email us on info@cniinfoxchange.com

Discussion Thread (1 Consultations)

Follow-up Questions & Contextual Consultations

+ Start New Chat / Ask Another Stock
Ask a Follow-up Question on this Thread: The AI remembers the entire discussion above

Need Deeper Clarity on this Research?

Connect with our senior research analysts (Mon-Fri 09:00 AM - 05:00 PM IST)

Call 02269010141
SEBI Statutory Research Analyst Disclosure

CNI INFOXCHANGE PRIVATE LIMITED is a SEBI registered Research Analyst (Registration No. INH000019512, valid till January 2030). This research analysis and market insight is compiled for educational and informational purposes only and does not constitute personalized investment advice or an offer to buy/sell securities. Securities markets are subject to market risks. Read all scheme and offer related documents carefully before investing.