- Removed v10 TradingView indicator (moneyline_v10_momentum_dots.pinescript) - Removed v10 penalty system from signal-quality.ts (-30/-25 point penalties) - Removed backtest result files (sweep_*.csv) - Updated copilot-instructions.md to remove v10 references - Simplified direction-specific quality thresholds (LONG 90+, SHORT 80+) Rationale: - 1,944 parameter combinations tested in backtest - All top results IDENTICAL (568 trades, $498 P&L, 61.09% WR) - Momentum parameters had ZERO impact on trade selection - Profit factor 1.027 too low (barely profitable after fees) - Max drawdown -$1,270 vs +$498 profit = terrible risk-reward - v10 penalties were blocking good trades (bug: applied to wrong positions) Keeping v9 as production system - simpler, proven, effective.
56 lines
1.2 KiB
Python
56 lines
1.2 KiB
Python
import dis
|
|
import array
|
|
import collections
|
|
|
|
try:
|
|
import html
|
|
except ImportError:
|
|
html = None
|
|
|
|
from setuptools.extern import six
|
|
from setuptools.extern.six.moves import html_parser
|
|
|
|
__metaclass__ = type
|
|
|
|
OpArg = collections.namedtuple('OpArg', 'opcode arg')
|
|
|
|
|
|
class Bytecode_compat:
|
|
def __init__(self, code):
|
|
self.code = code
|
|
|
|
def __iter__(self):
|
|
"""Yield '(op,arg)' pair for each operation in code object 'code'"""
|
|
|
|
bytes = array.array('b', self.code.co_code)
|
|
eof = len(self.code.co_code)
|
|
|
|
ptr = 0
|
|
extended_arg = 0
|
|
|
|
while ptr < eof:
|
|
|
|
op = bytes[ptr]
|
|
|
|
if op >= dis.HAVE_ARGUMENT:
|
|
|
|
arg = bytes[ptr + 1] + bytes[ptr + 2] * 256 + extended_arg
|
|
ptr += 3
|
|
|
|
if op == dis.EXTENDED_ARG:
|
|
long_type = six.integer_types[-1]
|
|
extended_arg = arg * long_type(65536)
|
|
continue
|
|
|
|
else:
|
|
arg = None
|
|
ptr += 1
|
|
|
|
yield OpArg(op, arg)
|
|
|
|
|
|
Bytecode = getattr(dis, 'Bytecode', Bytecode_compat)
|
|
|
|
|
|
unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape)
|