디버그: cloud fill 좌표 및 색상 로그 추가
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -71,11 +71,18 @@ class CloudRenderer implements IPrimitivePaneRenderer {
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
target.useBitmapCoordinateSpace(({ context: ctx, horizontalPixelRatio: hpr, verticalPixelRatio: vpr }: any) => {
|
target.useBitmapCoordinateSpace(({ context: ctx, horizontalPixelRatio: hpr, verticalPixelRatio: vpr }: any) => {
|
||||||
// Z-ORDER TEST: 밝은 빨간 직사각형 - 보이면 z-order가 맞고, 안보이면 캔버스가 뒤에 있는것
|
// 첫 번째 데이터 포인트 좌표 확인
|
||||||
ctx.save();
|
const d0 = this._data[0];
|
||||||
ctx.fillStyle = 'rgba(255, 0, 0, 0.8)';
|
const d1 = this._data[1];
|
||||||
ctx.fillRect(100 * hpr, 50 * vpr, 300 * hpr, 80 * vpr);
|
const tx0 = timeScale.timeToCoordinate(d0.time as Time);
|
||||||
ctx.restore();
|
const tx1 = timeScale.timeToCoordinate(d1.time as Time);
|
||||||
|
const ay0 = this._series.priceToCoordinate(d0.spanA);
|
||||||
|
const by0 = this._series.priceToCoordinate(d0.spanB);
|
||||||
|
console.log('[IchimokuCloud] coords: x0=', tx0, 'x1=', tx1,
|
||||||
|
'spanA_price=', d0.spanA, 'spanA_y=', ay0,
|
||||||
|
'spanB_price=', d0.spanB, 'spanB_y=', by0,
|
||||||
|
'hpr=', hpr, 'vpr=', vpr,
|
||||||
|
'canvas_w=', ctx.canvas?.width, 'canvas_h=', ctx.canvas?.height);
|
||||||
|
|
||||||
let drawn = 0, skippedTime = 0, skippedPrice = 0;
|
let drawn = 0, skippedTime = 0, skippedPrice = 0;
|
||||||
for (let i = 0; i < this._data.length - 1; i++) {
|
for (let i = 0; i < this._data.length - 1; i++) {
|
||||||
@@ -92,7 +99,6 @@ class CloudRenderer implements IPrimitivePaneRenderer {
|
|||||||
const bBy = this._series.priceToCoordinate(b.spanB);
|
const bBy = this._series.priceToCoordinate(b.spanB);
|
||||||
if (aAy == null || aBy == null || bAy == null || bBy == null) { skippedPrice++; continue; }
|
if (aAy == null || aBy == null || bAy == null || bBy == null) { skippedPrice++; continue; }
|
||||||
|
|
||||||
// 한국 관례: SpanA > SpanB → 양운(빨강), SpanA <= SpanB → 음운(청록)
|
|
||||||
const bullish = (a.spanA + b.spanA) > (a.spanB + b.spanB);
|
const bullish = (a.spanA + b.spanA) > (a.spanB + b.spanB);
|
||||||
if (bullish && !this._bullishVisible) continue;
|
if (bullish && !this._bullishVisible) continue;
|
||||||
if (!bullish && !this._bearishVisible) continue;
|
if (!bullish && !this._bearishVisible) continue;
|
||||||
@@ -109,11 +115,8 @@ class CloudRenderer implements IPrimitivePaneRenderer {
|
|||||||
ctx.fill();
|
ctx.fill();
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
}
|
}
|
||||||
if (skippedTime > 0 || skippedPrice > 0 || drawn === 0) {
|
console.log('[IchimokuCloud] drawn=', drawn, 'skippedTime=', skippedTime, 'skippedPrice=', skippedPrice,
|
||||||
console.warn('[IchimokuCloud] draw result: drawn=', drawn, 'skippedTime=', skippedTime, 'skippedPrice=', skippedPrice,
|
'bullishColor=', this._bullishColor, 'bearishColor=', this._bearishColor);
|
||||||
'sample time0=', this._data[0]?.time, 'x1_0=', timeScale.timeToCoordinate(this._data[0]?.time as Time),
|
|
||||||
'spanA0=', this._data[0]?.spanA, 'priceCoord=', this._series.priceToCoordinate(this._data[0]?.spanA));
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user