feat: Add persistent settings and multiple layouts support
- Add settings manager to persist symbol, timeframe, and layouts - Support multiple layouts for comprehensive chart analysis - Remove debug screenshots for cleaner logs - Update AI analysis with professional trading prompt - Add multi-screenshot analysis for better trading insights - Update analyze API to use saved settings and multiple layouts
This commit is contained in:
35
components/AutoTradingPanel.tsx
Normal file
35
components/AutoTradingPanel.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
"use client"
|
||||
import React, { useState } from 'react'
|
||||
|
||||
export default function AutoTradingPanel() {
|
||||
const [status, setStatus] = useState<'idle'|'running'|'stopped'>('idle')
|
||||
const [message, setMessage] = useState<string>('')
|
||||
|
||||
async function handleAction(action: 'start'|'stop') {
|
||||
setMessage('')
|
||||
setStatus('idle')
|
||||
const res = await fetch('/api/auto-trading', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ action })
|
||||
})
|
||||
if (res.ok) {
|
||||
setStatus(action === 'start' ? 'running' : 'stopped')
|
||||
setMessage(`Auto-trading ${action}ed`)
|
||||
} else {
|
||||
setMessage('Error: ' + (await res.text()))
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="p-4 border rounded bg-gray-900">
|
||||
<h2 className="text-lg font-bold mb-2">Auto-Trading Control</h2>
|
||||
<div className="flex gap-2 mb-2">
|
||||
<button className="btn btn-primary" onClick={() => handleAction('start')}>Start</button>
|
||||
<button className="btn btn-secondary" onClick={() => handleAction('stop')}>Stop</button>
|
||||
</div>
|
||||
<div className="text-sm text-gray-400">Status: {status}</div>
|
||||
{message && <div className="mt-2 text-yellow-400">{message}</div>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user