Add GTL price-traffic chart diagnostic
This commit is contained in:
@@ -39,6 +39,7 @@ export function useFetchSymbolData(options: UseFetchSymbolDataOptions = {}) {
|
||||
queryClient.invalidateQueries({ queryKey: ['sentiment', symbol] });
|
||||
queryClient.invalidateQueries({ queryKey: ['fundamentals', symbol] });
|
||||
queryClient.invalidateQueries({ queryKey: ['sr-levels', symbol] });
|
||||
queryClient.invalidateQueries({ queryKey: ['gate-target-ladder', symbol] });
|
||||
queryClient.invalidateQueries({ queryKey: ['scores', symbol] });
|
||||
// Fetch re-runs the scanner → setups/confidence change. Refresh both the
|
||||
// per-ticker trades (['trades', symbol]) and the Overview list (['trades']).
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { getOHLCV } from '../api/ohlcv';
|
||||
import { getScores } from '../api/scores';
|
||||
import { getLevels } from '../api/sr-levels';
|
||||
import { getGateTargetLadder, getLevels } from '../api/sr-levels';
|
||||
import { getSentiment } from '../api/sentiment';
|
||||
import { getFundamentals } from '../api/fundamentals';
|
||||
import * as tradesApi from '../api/trades';
|
||||
|
||||
export function useTickerDetail(symbol: string) {
|
||||
export function useTickerDetail(symbol: string, includeGateTargetLadder = false) {
|
||||
const ohlcv = useQuery({
|
||||
queryKey: ['ohlcv', symbol],
|
||||
queryFn: () => getOHLCV(symbol),
|
||||
@@ -25,6 +25,12 @@ export function useTickerDetail(symbol: string) {
|
||||
enabled: !!symbol,
|
||||
});
|
||||
|
||||
const gateTargetLadder = useQuery({
|
||||
queryKey: ['gate-target-ladder', symbol],
|
||||
queryFn: () => getGateTargetLadder(symbol),
|
||||
enabled: !!symbol && includeGateTargetLadder,
|
||||
});
|
||||
|
||||
const sentiment = useQuery({
|
||||
queryKey: ['sentiment', symbol],
|
||||
queryFn: () => getSentiment(symbol),
|
||||
@@ -43,5 +49,13 @@ export function useTickerDetail(symbol: string) {
|
||||
enabled: !!symbol,
|
||||
});
|
||||
|
||||
return { ohlcv, scores, srLevels, sentiment, fundamentals, trades };
|
||||
return {
|
||||
ohlcv,
|
||||
scores,
|
||||
srLevels,
|
||||
gateTargetLadder,
|
||||
sentiment,
|
||||
fundamentals,
|
||||
trades,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user