|
|
|
|
@ -126,6 +126,11 @@ export const generateFutureData = (code, name) => {
|
|
|
|
|
const entry = currentPrice;
|
|
|
|
|
const stopLoss = entry * (1 - 0.02 * (Math.random() + 0.5));
|
|
|
|
|
const target = entry * (1 + 0.03 * (Math.random() + 0.5));
|
|
|
|
|
const resistance = entry * (1 + 0.05 * (Math.random() + 0.5));
|
|
|
|
|
const support = entry * (1 - 0.05 * (Math.random() + 0.5));
|
|
|
|
|
|
|
|
|
|
const overallViews = ['观望', '中线', '多头排列', '空头排列', '震荡'];
|
|
|
|
|
const overallView = overallViews[Math.floor(Math.random() * overallViews.length)];
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
code,
|
|
|
|
|
@ -142,10 +147,14 @@ export const generateFutureData = (code, name) => {
|
|
|
|
|
tradingAdvice: {
|
|
|
|
|
entry: +entry.toFixed(2),
|
|
|
|
|
stopLoss: +stopLoss.toFixed(2),
|
|
|
|
|
target: +target.toFixed(2)
|
|
|
|
|
target: +target.toFixed(2),
|
|
|
|
|
resistance: +resistance.toFixed(2),
|
|
|
|
|
support: +support.toFixed(2)
|
|
|
|
|
},
|
|
|
|
|
riskLevel: ['低', '中等', '高'][Math.floor(Math.random() * 3)],
|
|
|
|
|
volatility: ['低', '中等', '高'][Math.floor(Math.random() * 3)]
|
|
|
|
|
volatility: ['低', '中等', '高'][Math.floor(Math.random() * 3)],
|
|
|
|
|
overallView,
|
|
|
|
|
aiAnalysis: `MACD:${indicators.macd} | RSI:${indicators.rsi} | 布林带:${indicators.bollinger}`
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -162,7 +171,10 @@ export const generateFuturesOverview = () => {
|
|
|
|
|
atr: data.atr,
|
|
|
|
|
adx: data.adx,
|
|
|
|
|
adxStatus: data.adxStatus,
|
|
|
|
|
trends: data.trends
|
|
|
|
|
trends: data.trends,
|
|
|
|
|
tradingAdvice: data.tradingAdvice,
|
|
|
|
|
overallView: data.overallView,
|
|
|
|
|
aiAnalysis: data.aiAnalysis
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|