Compare commits

..

No commits in common. "f39b362bc46ca54eec0891a105e50c0d535b71f1" and "ff502b62bf406b993afc73c2adbf4f8981fda269" have entirely different histories.

5 changed files with 16 additions and 57 deletions

View File

@ -262,29 +262,7 @@ async def open_history_client(
vlm = bars_array['volume']
vlm[vlm < 0] = 0
# XXX, if a start-limit was passed ensure we only
# return history that far back!
if (
start_dt
and
last_dt < start_dt
):
bars_array = bars_array[
bars_array['time'] >= start_dt.timestamp()
]
# TODO! rm this once we're more confident it never hits!
breakpoint()
raise RuntimeError(
f'OHLC-bars array start is gt `start_dt` limit !!\n'
f'start_dt: {start_dt}\n'
f'last_dt: {last_dt}\n'
)
return (
bars_array,
first_dt,
last_dt,
)
return bars_array, first_dt, last_dt
# TODO: it seems like we can do async queries for ohlc
# but getting the order right still isn't working and I'm not
@ -473,8 +451,6 @@ async def get_bars(
dt_duration,
) = await proxy.bars(
fqme=fqme,
# XXX TODO! lol we're not using this..
# start_dt=start_dt,
end_dt=end_dt,
sample_period_s=timeframe,

View File

@ -275,10 +275,6 @@ def get_null_segs(
# diff of abs index steps between each zeroed row
absi_zdiff: np.ndarray = np.diff(absi_zeros)
if zero_t.size < 2:
breakpoint()
return None
# scan for all frame-indices where the
# zeroed-row-abs-index-step-diff is greater then the
# expected increment of 1.
@ -491,8 +487,7 @@ def iter_null_segs(
start_dt = None
if (
absi_start is not None
and
start_t != 0
and start_t != 0
):
fi_start: int = absi_start - absi_first
start_row: Seq = frame[fi_start]
@ -506,8 +501,8 @@ def iter_null_segs(
yield (
absi_start, absi_end, # abs indices
fi_start, fi_end, # relative "frame" indices
start_t, end_t, # epoch times
start_dt, end_dt, # dts
start_t, end_t,
start_dt, end_dt,
)

View File

@ -121,24 +121,21 @@ async def markup_gaps(
# iend += margin
# istart -= margin
rect_gap: float = BGM*3/8
opn: float = row['open'][0]
cls: float = prev_r['close'][0]
# BGM=0.16 is the normal diff from overlap between bars, SO
# just go slightly "in" from that "between them".
from_idx: int = BGM - .06 # = .10
lc: tuple[float, float] = (
istart + 1 - from_idx,
cls,
)
ro: tuple[float, float] = (
iend + from_idx,
iend + rect_gap + 1,
opn,
)
lc: tuple[float, float] = (
istart - rect_gap, # + 1 ,
cls,
)
diff: float = cls - opn
sgn: float = copysign(1, diff)
color: str = 'dad_blue'
# TODO? mks more sense to have up/down coloring?
# color: str = {

View File

@ -242,13 +242,6 @@ async def maybe_fill_null_segments(
end_dt=end_dt,
)
if (
from_timestamp(
array['time'][0]
) < backfill_until_dt
):
await tractor.pause()
# XXX TODO: pretty sure if i plot tsla, btcusdt.binance
# and mnq.cme.ib this causes a Qt crash XXDDD

View File

@ -308,7 +308,6 @@ def hcolor(name: str) -> str:
'cool_green': '#33b864',
'dull_green': '#74a662',
'hedge_green': '#518360',
'lilypad_green': '#839c84',
# orders and alerts
'alert_yellow': '#e2d083',
@ -336,7 +335,6 @@ def hcolor(name: str) -> str:
'sell_red': '#b6003f',
# 'sell_red': '#d00048',
'sell_red_light': '#f85462',
'wine': '#69212d',
# 'sell_red': '#f85462',
# 'sell_red_light': '#ff4d5c',