feat: Enhance AI analysis and subscription plans
Introduce new fields to the analysis response for richer data, including take profit levels, risk-reward ratio, duration, and risk level. This update also expands the Gemini AI's system instructions to incorporate multi-timeframe and long-term analysis capabilities, aiming for more comprehensive market insights. Additionally, new subscription tiers and plan details are added. A new "Experimental" plan is introduced, and existing plans are updated with more specific features and benefits. The admin dashboard is also modified to support these new plan types and their associated logic.
This commit is contained in:
@@ -132,11 +132,14 @@ export const AdminDashboard: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handlePlanChange = async (user: any, newPlan: 'basic' | 'pro' | 'elite' | 'lifetime') => {
|
||||
const handlePlanChange = async (user: any, newPlan: 'basic' | 'experimental' | 'pro' | 'elite' | 'lifetime') => {
|
||||
let limit = 8;
|
||||
let isPremium = false;
|
||||
|
||||
if (newPlan === 'pro') {
|
||||
if (newPlan === 'experimental') {
|
||||
limit = 3;
|
||||
isPremium = false;
|
||||
} else if (newPlan === 'pro') {
|
||||
limit = 15;
|
||||
isPremium = true;
|
||||
} else if (newPlan === 'elite' || newPlan === 'lifetime') {
|
||||
@@ -153,6 +156,11 @@ export const AdminDashboard: React.FC = () => {
|
||||
// Atualiza a validade se mudar o plano
|
||||
if (newPlan === 'lifetime') {
|
||||
updates.subscriptionEndsAt = null; // Lifetime não expira
|
||||
} else if (newPlan === 'experimental') {
|
||||
// Experimental dura 14 dias
|
||||
if (user.isApproved) {
|
||||
updates.subscriptionEndsAt = Date.now() + 14 * 24 * 60 * 60 * 1000;
|
||||
}
|
||||
} else {
|
||||
// Se não tinha data de fim e já estava aprovado, define 30 dias a partir de agora
|
||||
if (user.isApproved && !user.subscriptionEndsAt) {
|
||||
@@ -390,9 +398,10 @@ export const AdminDashboard: React.FC = () => {
|
||||
<td className="p-4 text-center">
|
||||
<select
|
||||
value={user.plan || 'basic'}
|
||||
onChange={(e) => handlePlanChange(user, e.target.value as 'basic' | 'pro' | 'elite' | 'lifetime')}
|
||||
onChange={(e) => handlePlanChange(user, e.target.value as 'experimental' | 'basic' | 'pro' | 'elite' | 'lifetime')}
|
||||
className="bg-black/40 border border-white/10 rounded-lg px-3 py-1.5 text-xs text-white uppercase font-black tracking-widest focus:outline-none focus:border-brand-red/50 cursor-pointer"
|
||||
>
|
||||
<option value="experimental">Exp (2 Sem)</option>
|
||||
<option value="basic">Básico</option>
|
||||
<option value="pro">Premium (Pro)</option>
|
||||
<option value="elite">Elite</option>
|
||||
|
||||
@@ -151,19 +151,24 @@ export const AnalysisView: React.FC<{ userData?: any, onGoToHistory?: () => void
|
||||
}
|
||||
|
||||
const base64 = preview.split(',')[1];
|
||||
const analysis = await analyzeForexChart(base64, undefined, mode);
|
||||
const analysis = await analyzeForexChart(base64, undefined, mode, userData?.plan);
|
||||
analysis.score = Math.round(analysis.score);
|
||||
setResult(analysis);
|
||||
|
||||
if (auth.currentUser) {
|
||||
const sanitizedAnalysis = { ...analysis };
|
||||
if (sanitizedAnalysis.pair) sanitizedAnalysis.pair = String(sanitizedAnalysis.pair).substring(0, 100);
|
||||
if (sanitizedAnalysis.timeframe) sanitizedAnalysis.timeframe = String(sanitizedAnalysis.timeframe).substring(0, 50);
|
||||
sanitizedAnalysis.score = Math.round(Number(sanitizedAnalysis.score) || 0);
|
||||
|
||||
await addDoc(collection(db, 'signals'), {
|
||||
...analysis,
|
||||
...sanitizedAnalysis,
|
||||
screenshotUrl: downloadUrl,
|
||||
userId: auth.currentUser.uid,
|
||||
createdAt: serverTimestamp(),
|
||||
timestamp: Date.now(),
|
||||
result: SignalResult.PENDING,
|
||||
type: analysis.decision
|
||||
type: sanitizedAnalysis.decision || 'WAIT'
|
||||
}).catch(err => {
|
||||
handleFirestoreError(err, OperationType.CREATE, 'signals');
|
||||
throw err;
|
||||
@@ -456,6 +461,39 @@ export const AnalysisView: React.FC<{ userData?: any, onGoToHistory?: () => void
|
||||
<span className="text-xs font-black">{result.timeframe}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{(result.riskReward || result.riskLevel || result.duration || result.signalType) && (
|
||||
<div className="w-full pt-4 border-t border-white/5 grid grid-cols-2 gap-3">
|
||||
{result.signalType && (
|
||||
<div className="glass-card p-2">
|
||||
<span className="block text-[8px] text-zinc-600 uppercase font-black mb-0.5">ESTILO</span>
|
||||
<span className="text-[10px] font-black tracking-widest">{result.signalType}</span>
|
||||
</div>
|
||||
)}
|
||||
{result.riskLevel && (
|
||||
<div className="glass-card p-2">
|
||||
<span className="block text-[8px] text-zinc-600 uppercase font-black mb-0.5">RISCO</span>
|
||||
<span className={cn(
|
||||
"text-[10px] font-black tracking-widest",
|
||||
result.riskLevel.toUpperCase() === 'LOW' ? "text-green-500" :
|
||||
result.riskLevel.toUpperCase() === 'HIGH' ? "text-brand-red" : "text-orange-500"
|
||||
)}>{result.riskLevel}</span>
|
||||
</div>
|
||||
)}
|
||||
{result.riskReward && (
|
||||
<div className="glass-card p-2">
|
||||
<span className="block text-[8px] text-zinc-600 uppercase font-black mb-0.5">RISCO/RETORNO</span>
|
||||
<span className="text-[10px] font-black font-mono">{result.riskReward}</span>
|
||||
</div>
|
||||
)}
|
||||
{result.duration && (
|
||||
<div className="glass-card p-2">
|
||||
<span className="block text-[8px] text-zinc-600 uppercase font-black mb-0.5">DURAÇÃO</span>
|
||||
<span className="text-[10px] font-black tracking-widest uppercase">{result.duration}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Trading Decision */}
|
||||
@@ -526,21 +564,63 @@ export const AnalysisView: React.FC<{ userData?: any, onGoToHistory?: () => void
|
||||
<div className="flex items-center justify-between p-3 glass-card bg-transparent border-white/5">
|
||||
<div className="flex items-center gap-2">
|
||||
<ShieldCheck size={14} className="text-green-500/50" />
|
||||
<span className="text-[9px] font-black text-zinc-500 uppercase">TAKE PROFIT</span>
|
||||
<span className="text-[9px] font-black text-zinc-500 uppercase">TAKE PROFIT 1</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-mono font-black text-sm text-green-500">{result.takeProfit}</span>
|
||||
<button
|
||||
onClick={() => toggleAlert('Take Profit', result.takeProfit)}
|
||||
onClick={() => toggleAlert('Take Profit 1', result.takeProfit)}
|
||||
className={cn(
|
||||
"p-1.5 rounded transition-colors",
|
||||
alerts.some(a => a.type === 'Take Profit') ? "text-yellow-500 bg-yellow-500/20" : "text-zinc-500 hover:text-yellow-500 hover:bg-white/5"
|
||||
alerts.some(a => a.type === 'Take Profit 1') ? "text-yellow-500 bg-yellow-500/20" : "text-zinc-500 hover:text-yellow-500 hover:bg-white/5"
|
||||
)}
|
||||
>
|
||||
{alerts.some(a => a.type === 'Take Profit') ? <BellRing size={14} /> : <Bell size={14} />}
|
||||
{alerts.some(a => a.type === 'Take Profit 1') ? <BellRing size={14} /> : <Bell size={14} />}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{result.takeProfit2 && (
|
||||
<div className="flex items-center justify-between p-3 glass-card bg-transparent border-white/5">
|
||||
<div className="flex items-center gap-2">
|
||||
<ShieldCheck size={14} className="text-green-500/50" />
|
||||
<span className="text-[9px] font-black text-zinc-500 uppercase">TAKE PROFIT 2</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-mono font-black text-sm text-green-500">{result.takeProfit2}</span>
|
||||
<button
|
||||
onClick={() => toggleAlert('Take Profit 2', result.takeProfit2!)}
|
||||
className={cn(
|
||||
"p-1.5 rounded transition-colors",
|
||||
alerts.some(a => a.type === 'Take Profit 2') ? "text-yellow-500 bg-yellow-500/20" : "text-zinc-500 hover:text-yellow-500 hover:bg-white/5"
|
||||
)}
|
||||
>
|
||||
{alerts.some(a => a.type === 'Take Profit 2') ? <BellRing size={14} /> : <Bell size={14} />}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{result.takeProfit3 && (
|
||||
<div className="flex items-center justify-between p-3 glass-card bg-transparent border-white/5">
|
||||
<div className="flex items-center gap-2">
|
||||
<ShieldCheck size={14} className="text-green-500/50" />
|
||||
<span className="text-[9px] font-black text-zinc-500 uppercase">TAKE PROFIT 3</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-mono font-black text-sm text-green-500">{result.takeProfit3}</span>
|
||||
<button
|
||||
onClick={() => toggleAlert('Take Profit 3', result.takeProfit3!)}
|
||||
className={cn(
|
||||
"p-1.5 rounded transition-colors",
|
||||
alerts.some(a => a.type === 'Take Profit 3') ? "text-yellow-500 bg-yellow-500/20" : "text-zinc-500 hover:text-yellow-500 hover:bg-white/5"
|
||||
)}
|
||||
>
|
||||
{alerts.some(a => a.type === 'Take Profit 3') ? <BellRing size={14} /> : <Bell size={14} />}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -234,7 +234,21 @@ export const PlansView: React.FC<PlansViewProps> = ({ isUnauthenticated, onGetSt
|
||||
)}
|
||||
|
||||
{/* 2. PLANOS */}
|
||||
<section id="planos" className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 items-start">
|
||||
<section id="planos" className="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-5 gap-4 items-stretch">
|
||||
<PlanCard
|
||||
title="Experimental"
|
||||
price="500 MT"
|
||||
description="Plano de 2 semanas para testar as capacidades básicas da IA."
|
||||
buttonText="Testar IA"
|
||||
onClick={handleAction}
|
||||
features={[
|
||||
"3 análises por dia",
|
||||
"Apenas Curto Prazo (Scalping)",
|
||||
"Score Básico de Probabilidade",
|
||||
"Análise SMC (Smart Money)",
|
||||
"Sem histórico completo"
|
||||
]}
|
||||
/>
|
||||
<PlanCard
|
||||
title="Plano Begin"
|
||||
price="1.700 MT"
|
||||
@@ -243,9 +257,9 @@ export const PlansView: React.FC<PlansViewProps> = ({ isUnauthenticated, onGetSt
|
||||
onClick={handleAction}
|
||||
features={[
|
||||
"8 análises por dia",
|
||||
"Score básico de probabilidade",
|
||||
"Suporte a Timeframes maiores",
|
||||
"Sem histórico completo",
|
||||
"Scalping & Intraday",
|
||||
"Score Básico de Probabilidade",
|
||||
"Risco/Retorno e Stop Loss",
|
||||
"Suporte via comunidade"
|
||||
]}
|
||||
/>
|
||||
@@ -259,11 +273,11 @@ export const PlansView: React.FC<PlansViewProps> = ({ isUnauthenticated, onGetSt
|
||||
onClick={handleAction}
|
||||
features={[
|
||||
"15 análises por dia",
|
||||
"Score avançado de alta precisão",
|
||||
"Detecção automática de timeframe",
|
||||
"Histórico completo de sinais",
|
||||
"Sinais com alta probabilidade",
|
||||
"Suporte priorizado"
|
||||
"Análises de Longo Prazo",
|
||||
"Multi Time Frame (MTF) Integrado",
|
||||
"Detecção Extrema de Liquidez",
|
||||
"Filtro Anti-Fake Breakout (IA)",
|
||||
"Histórico completo de sinais"
|
||||
]}
|
||||
/>
|
||||
<PlanCard
|
||||
@@ -274,10 +288,11 @@ export const PlansView: React.FC<PlansViewProps> = ({ isUnauthenticated, onGetSt
|
||||
onClick={handleAction}
|
||||
features={[
|
||||
"30 análises por dia",
|
||||
"Insights institucionais avançados",
|
||||
"Prioridade total de processamento",
|
||||
"Estratégias PRO Logic",
|
||||
"Suporte VIP via WhatsApp"
|
||||
"Tudo do Plano Pro",
|
||||
"SMC Avançado + VWAP & CVD",
|
||||
"Análise Fundamental + Impacto",
|
||||
"Machine Learning Avançado",
|
||||
"Suporte VIP WhatsApp"
|
||||
]}
|
||||
/>
|
||||
<PlanCard
|
||||
@@ -289,13 +304,12 @@ export const PlansView: React.FC<PlansViewProps> = ({ isUnauthenticated, onGetSt
|
||||
badge="VIP VITALÍCIO"
|
||||
onClick={handleAction}
|
||||
features={[
|
||||
"Análises ilimitadas",
|
||||
"Insights institucionais avançados",
|
||||
"Análises Ilimitadas",
|
||||
"Tudo do Plano Elite",
|
||||
"Acesso vitalício (Sem mensalidade)",
|
||||
"Suporte 1-on-1 (WhatsApp/Telegram)",
|
||||
"Prioridade máxima total",
|
||||
"Early access a novas features",
|
||||
"Cursos exclusivos QuantScan"
|
||||
"Cursos exclusivos QuantScan",
|
||||
"Prioridade máxima no servidor"
|
||||
]}
|
||||
/>
|
||||
</section>
|
||||
@@ -330,10 +344,11 @@ export const PlansView: React.FC<PlansViewProps> = ({ isUnauthenticated, onGetSt
|
||||
<section className="space-y-6">
|
||||
<h2 className="text-xl font-black italic uppercase tracking-tighter text-white text-center">Comparativo Técnico</h2>
|
||||
<div className="glass-card overflow-hidden !p-0 overflow-x-auto shadow-2xl">
|
||||
<table className="w-full min-w-[600px] text-left border-collapse">
|
||||
<table className="w-full min-w-[700px] text-left border-collapse">
|
||||
<thead>
|
||||
<tr className="bg-white/5 font-black uppercase italic text-[10px] tracking-widest text-zinc-400">
|
||||
<th className="p-4 border-b border-white/5">Funcionalidade</th>
|
||||
<th className="p-4 border-b border-white/5 whitespace-nowrap">Funcionalidade</th>
|
||||
<th className="p-4 border-b border-white/5 text-center">Experimental (14d)</th>
|
||||
<th className="p-4 border-b border-white/5 text-center">Begin</th>
|
||||
<th className="p-4 border-b border-white/5 text-center text-brand-red">Pro</th>
|
||||
<th className="p-4 border-b border-white/5 text-center">Elite</th>
|
||||
@@ -342,15 +357,17 @@ export const PlansView: React.FC<PlansViewProps> = ({ isUnauthenticated, onGetSt
|
||||
</thead>
|
||||
<tbody className="text-xs font-medium text-zinc-300">
|
||||
{[
|
||||
{ label: "Nº de Análises", free: "8 / dia", pro: "15 / dia", elite: "30 / dia", lifetime: "Ilimitado" },
|
||||
{ label: "Score de Probabilidade", free: "Básico", pro: "Avançado", elite: "Avançado+", lifetime: "Avançado+" },
|
||||
{ label: "IA Adaptativa", free: "Não", pro: "Sim", elite: "Sim", lifetime: "Sim" },
|
||||
{ label: "Histórico de Sinais", free: "Limitado", pro: "Completo", elite: "Completo", lifetime: "Completo" },
|
||||
{ label: "Suporte", free: "Comunidade", pro: "Prioritário", elite: "VIP Individual", lifetime: "Premium 1-on-1" },
|
||||
{ label: "Processamento", free: "Normal", pro: "Rápido", elite: "Ultra Prioridade", lifetime: "Ultra Prioridade" },
|
||||
{ label: "Nº de Análises", exp: "3 / dia", free: "8 / dia", pro: "15 / dia", elite: "30 / dia", lifetime: "Ilimitado" },
|
||||
{ label: "Modo Longo Prazo", exp: "Não", free: "Não", pro: "Sim", elite: "Sim", lifetime: "Sim" },
|
||||
{ label: "Multi Timeframe (MTF)", exp: "Básico", free: "Básico", pro: "Avançado", elite: "Institucional", lifetime: "Institucional" },
|
||||
{ label: "Filtro SMC & Liquidez", exp: "Básico", free: "Básico", pro: "Avançado", elite: "Avançado+", lifetime: "Avançado+" },
|
||||
{ label: "Machine Learning Anti-Fake", exp: "Não", free: "Não", pro: "Sim", elite: "Avançado", lifetime: "Avançado" },
|
||||
{ label: "Análise Fundamental", exp: "Não", free: "Não", pro: "Não", elite: "Sim", lifetime: "Sim" },
|
||||
{ label: "Processamento Prioritário", exp: "Normal", free: "Normal", pro: "Médio", elite: "Alta", lifetime: "Máxima" },
|
||||
].map((row, idx) => (
|
||||
<tr key={idx} className="border-b border-white/5 hover:bg-white/5 transition-colors">
|
||||
<td className="p-4 font-bold text-white">{row.label}</td>
|
||||
<td className="p-4 font-bold text-white whitespace-nowrap">{row.label}</td>
|
||||
<td className="p-4 text-center text-zinc-500">{row.exp}</td>
|
||||
<td className="p-4 text-center text-zinc-500">{row.free}</td>
|
||||
<td className="p-4 text-center font-bold text-white">{row.pro}</td>
|
||||
<td className="p-4 text-center text-zinc-300">{row.elite}</td>
|
||||
|
||||
+105
-40
@@ -3,53 +3,112 @@ import { AnalysisResponse, SignalType } from "../types";
|
||||
|
||||
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY || '' });
|
||||
|
||||
export const analyzeForexChart = async (imageBase64: string, userNotes?: string, preferredMode?: 'Técnico' | 'Fundamental' | 'Híbrido'): Promise<AnalysisResponse> => {
|
||||
export const analyzeForexChart = async (imageBase64: string, userNotes?: string, preferredMode?: 'Técnico' | 'Fundamental' | 'Híbrido', userPlan?: string): Promise<AnalysisResponse> => {
|
||||
const model = 'gemini-3.1-pro-preview';
|
||||
|
||||
const systemInstruction = `
|
||||
Você é o QuantScan IA, um sistema avançado de análise de mercado financeiro com inteligência institucional.
|
||||
|
||||
BASE PRINCIPAL: Smart Money Concepts (SMC).
|
||||
Especializações: SMC, Liquidez, Momentum, Análise Fundamental macro, Aprendizado contínuo.
|
||||
# QUANTSCAN IA — MODO MULTI TIME FRAME + LONG TERM ANALYSIS
|
||||
|
||||
CAMADA DE CONFIRMAÇÃO (APENAS PARA FILTRO, MEDIDOR DE CONTEXTO OU CONFIRMAÇÃO):
|
||||
- Volume Delta, CVD e Volume Profile: Para confirmar se há participação institucional real no movimento.
|
||||
- ATR (Average True Range): Para Stop Loss dinâmico, Take Profit inteligente e detectar volatilidade (ex: se ATR estiver baixo, evitar falso breakout).
|
||||
- EMA (Filtro Macro): Não usar para entrada. Apenas confirmar direção (ex: acima da EMA 200 -> apenas BUY, abaixo -> apenas SELL).
|
||||
- RSI Inteligente (não tradicional): Combinar com Liquidity Sweep, RSI divergência e Order Block para melhorar reversões.
|
||||
- VWAP (Muito Forte): Equilíbrio de preço, reversão e continuação (SMC + VWAP = nível institucional).
|
||||
Você é o QUANTSCAN IA, um sistema profissional avançado de análise Forex, Índices, Commodities e Criptomoedas baseado em Inteligência Artificial institucional.
|
||||
|
||||
CAMADA IA (Machine Learning):
|
||||
- Score probabilístico e Filtro anti-fake breakout.
|
||||
- Detecção Robusta de Liquidez: Considerar onde o mercado costuma manipular, horários de caça de liquidez, fake breakouts e comportamento antes de uma reversão.
|
||||
|
||||
Sua função é gerar decisões de trading com alta precisão, explicação clara e score de probabilidade baseado na análise de imagem do gráfico e no input técnico/fundamental.
|
||||
Plano do Usuário Atual: ${userPlan || 'basic'}
|
||||
|
||||
MODOS DE ANÁLISE:
|
||||
- Técnico: Foco em Timing, Estrutura e Execução.
|
||||
- Fundamental: Foco em Macro, Notícias, Força de moedas.
|
||||
- Híbrido: Combinação de Técnico e Fundamental (Recomendado).
|
||||
Sua função é analisar gráficos enviados pelo usuário através de: screenshot do gráfico, foto da tela, imagem do TradingView, imagem MT4/MT5 ou corretoras.
|
||||
|
||||
DETECÇÃO AUTOMÁTICA: Timeframe (M1-D1), Par de moeda, Estrutura.
|
||||
O sistema deve operar em dois modos:
|
||||
1. SHORT TERM / SCALPING
|
||||
2. LONG TERM / SWING TRADE / POSITION TRADE
|
||||
|
||||
FORMATO DE SAÍDA (Obrigatório em JSON):
|
||||
{
|
||||
"mode": "Técnico" | "Fundamental" | "Híbrido",
|
||||
"analiseGeral": "string",
|
||||
"timeframe": "string",
|
||||
"estrutura": "string",
|
||||
"tecnica": "string", // Detalhada (SMC+Liquidez+Momentum)
|
||||
"fundamental": "string", // Resumo macro
|
||||
"decision": "BUY" | "SELL" | "WAIT",
|
||||
"entry": "string",
|
||||
"stopLoss": "string",
|
||||
"takeProfit": "string",
|
||||
"score": number, // 0-100
|
||||
"justification": "string",
|
||||
"alerta": "string",
|
||||
"pair": "string"
|
||||
}
|
||||
`;
|
||||
==================================================
|
||||
RESTRIÇÕES DE PLANO
|
||||
==================================================
|
||||
Se o plano do usuário for "basic" ou "experimental", você é **PROIBIDO** de realizar análise LONG TERM / SWING / POSITION.
|
||||
Independentemente do timeframe enxergado na imagem (mesmo que seja H4, D1, W1), você deve focar nas estruturas de curto prazo e gerar sinais APENAS para Scalping ou Intraday.
|
||||
Para planos "pro", "elite", e "lifetime", você pode e deve realizar análises MULTI TIME FRAME e gerar decisões LONG TERM.
|
||||
|
||||
==================================================
|
||||
ANÁLISE MULTI TIME FRAME (OBRIGATÓRIO PARA PRO/ELITE/LIFETIME)
|
||||
==================================================
|
||||
A IA deve identificar automaticamente: timeframe principal, secundário e contexto macro do mercado.
|
||||
Exemplo: H4 → tendência principal, H1 → estrutura intermediária, M15 → entrada precisa.
|
||||
|
||||
TIMEFRAMES SUPORTADOS:
|
||||
- Scalping: M1, M5, M15
|
||||
- Intraday: M30, H1
|
||||
- Swing Trade: H4, D1
|
||||
- Longo Prazo: W1, MN
|
||||
|
||||
A IA deve:
|
||||
1. Detectar tendência do timeframe maior.
|
||||
2. Confirmar alinhamento estrutural.
|
||||
3. Procurar entradas no timeframe menor.
|
||||
4. Evitar entradas contra tendência macro.
|
||||
|
||||
==================================================
|
||||
REGRAS DE LONGO PRAZO
|
||||
==================================================
|
||||
Se detectar: H4, D1, W1, Monthly
|
||||
A IA deve ativar automaticamente: "MODO LONG TERM ANALYSIS" e analisar tendência macro, ciclos institucionais, acumulação/distribuição, zonas de interesse, continuação ou reversão, força de tendência e pontos de holding.
|
||||
|
||||
==================================================
|
||||
ESTRATÉGIAS OBRIGATÓRIAS
|
||||
==================================================
|
||||
1. SMART MONEY CONCEPT (SMC): BOS, CHOCH, Order Blocks, Liquidity, Fair Value Gap.
|
||||
2. LIQUIDITY SWEEP + TRAP DETECTION: stop hunts, fake breakouts, manipulation.
|
||||
3. MOMENTUM + ENTRY TIMING: força da tendência, volume, velocidade do preço.
|
||||
4. MARKET STRUCTURE AI: tendência bullish/bearish, ranging, expansão.
|
||||
5. FUNDAMENTAL ANALYSIS AI: notícias, juros, impacto macroeconômico.
|
||||
|
||||
==================================================
|
||||
CAMADA DE CONFIRMAÇÃO E IA (APENAS FILTRO)
|
||||
==================================================
|
||||
- Volume Delta, CVD, Volume Profile.
|
||||
- ATR (Average True Range).
|
||||
- EMA (apenas filtro macro).
|
||||
- RSI (com Liquidity Sweep).
|
||||
- VWAP.
|
||||
- Score probabilístico e Filtro anti-fake breakout.
|
||||
|
||||
==================================================
|
||||
ENTRADAS OBRIGATÓRIAS (Sistema de Probabilidade)
|
||||
==================================================
|
||||
A IA deve fornecer no JSON estrito todas as chaves abaixo:
|
||||
- Direção: BUY, SELL ou WAIT
|
||||
- Tipo: Scalping / Intraday / Swing / Long Term (chave signalType)
|
||||
- Nível de Risco: LOW / MEDIUM / HIGH (chave riskLevel)
|
||||
- Risco/Retorno: (ex: 1:3) (chave riskReward)
|
||||
- Duração Estimada: (ex: 3 a 10 dias) (chave duration)
|
||||
- Entrada, Stop Loss, Take Profit 1, Take Profit 2, e Take Profit 3.
|
||||
|
||||
Exemplo visual de leitura interna:
|
||||
CONFIDENCE SCORE: 91%
|
||||
RISK LEVEL: LOW
|
||||
MULTI TIME FRAME: W1 Bullish, D1 Bullish, H4 Pullback...
|
||||
|
||||
FORMATO DE SAÍDA (Obrigatório em JSON):
|
||||
{
|
||||
"mode": "Técnico" | "Fundamental" | "Híbrido",
|
||||
"analiseGeral": "Análise multi timeframe macro e micro",
|
||||
"timeframe": "Timeframes analisados (ex: H4/M15)",
|
||||
"estrutura": "Detalhes estruturais",
|
||||
"tecnica": "SMC + Confirmações",
|
||||
"fundamental": "Resumo",
|
||||
"decision": "BUY" | "SELL" | "WAIT",
|
||||
"signalType": "Scalping" | "Intraday" | "Swing" | "Long Term",
|
||||
"riskLevel": "LOW" | "MEDIUM" | "HIGH",
|
||||
"entry": "1.08450",
|
||||
"stopLoss": "1.07800",
|
||||
"takeProfit": "1.09200",
|
||||
"takeProfit2": "1.10100",
|
||||
"takeProfit3": "1.11500",
|
||||
"riskReward": "1:3",
|
||||
"duration": "3 a 10 dias",
|
||||
"score": 91,
|
||||
"justification": "Razão principal",
|
||||
"alerta": "Cuidados",
|
||||
"pair": "EUR/USD"
|
||||
}
|
||||
`;
|
||||
|
||||
const prompt = `
|
||||
Analise este gráfico sob a óptica do QuantScan IA.
|
||||
@@ -82,14 +141,20 @@ export const analyzeForexChart = async (imageBase64: string, userNotes?: string,
|
||||
tecnica: { type: Type.STRING },
|
||||
fundamental: { type: Type.STRING },
|
||||
decision: { type: Type.STRING, enum: ["BUY", "SELL", "WAIT"] },
|
||||
signalType: { type: Type.STRING },
|
||||
riskLevel: { type: Type.STRING },
|
||||
entry: { type: Type.STRING },
|
||||
stopLoss: { type: Type.STRING },
|
||||
takeProfit: { type: Type.STRING },
|
||||
takeProfit2: { type: Type.STRING },
|
||||
takeProfit3: { type: Type.STRING },
|
||||
riskReward: { type: Type.STRING },
|
||||
duration: { type: Type.STRING },
|
||||
score: { type: Type.NUMBER },
|
||||
justification: { type: Type.STRING },
|
||||
alerta: { type: Type.STRING }
|
||||
},
|
||||
required: ["mode", "analiseGeral", "pair", "timeframe", "estrutura", "tecnica", "fundamental", "decision", "entry", "stopLoss", "takeProfit", "score", "justification", "alerta"]
|
||||
required: ["mode", "analiseGeral", "pair", "timeframe", "estrutura", "tecnica", "fundamental", "decision", "signalType", "riskLevel", "entry", "stopLoss", "takeProfit", "takeProfit2", "takeProfit3", "riskReward", "duration", "score", "justification", "alerta"]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -62,6 +62,12 @@ export interface AnalysisResponse {
|
||||
entry: string;
|
||||
stopLoss: string;
|
||||
takeProfit: string;
|
||||
takeProfit2?: string;
|
||||
takeProfit3?: string;
|
||||
riskReward?: string;
|
||||
duration?: string;
|
||||
riskLevel?: string;
|
||||
signalType?: string;
|
||||
score: number;
|
||||
justification: string;
|
||||
alerta: string;
|
||||
|
||||
Reference in New Issue
Block a user