refactor(oi): improve data extraction and consolidate documentation

- Fix MQL5 API usage in EA to use correct CopyRates and POSITION_TYPE enums
- Refactor scraper data extraction to use drop_duplicates for unique strikes
- Consolidate Windows setup guide into main README
- Add virtual environment batch files for easier setup and execution
- Simplify run_scraper.bat to focus on core execution
- Normalize lot calculation to use SymbolInfo.LotsStep()
This commit is contained in:
Kunthawat Greethong
2026-01-06 20:18:12 +07:00
parent 2e8e07ed17
commit b7c0e68fa8
8 changed files with 386 additions and 895 deletions

View File

@@ -1,47 +1,21 @@
@echo off
REM ==========================================
REM CME OI Scraper - Automatic Daily Runner
REM CME OI Scraper - Run with Virtual Environment
REM ==========================================
REM Change to script directory
cd /d C:\Users\YourUsername\Gitea\MeanRevisionEA\oi_scraper
REM Navigate to script directory
cd /d %~dp0
echo ==========================================
echo CME OI Scraper - Daily Update
echo CME OI Scraper
echo ==========================================
echo Started at: %date% %time%
echo ========================================== >> scraper.log
REM Activate virtual environment
call venv\Scripts\activate.bat
REM Run Python scraper
python main.py >> scraper.log 2>&1
python main.py
REM Check if scraper succeeded
if %ERRORLEVEL% EQU 0 (
echo [%date% %time%] Scraper completed successfully >> scraper.log
REM Check if CSV file was created
if exist oi_data.csv (
echo [%date% %time%] CSV file created successfully >> scraper.log
REM Copy to MetaTrader 5 Files directory
REM Update this path to your actual MT5 directory
copy oi_data.csv "C:\Users\YourUsername\AppData\Roaming\MetaQuotes\Terminal\[Your_Terminal_ID]\MQL5\Files\oi_data.csv"
if %ERRORLEVEL% EQU 0 (
echo [%date% %time%] CSV copied to MT5 Files directory >> scraper.log
) else (
echo [%date% %time%] ERROR: Failed to copy CSV to MT5 directory >> scraper.log
)
) else (
echo [%date% %time%] WARNING: oi_data.csv not found >> scraper.log
)
) else (
echo [%date% %time%] ERROR: Scraper failed with error code %ERRORLEVEL% >> scraper.log
)
echo ==========================================
echo Completed at: %date% %time%
echo ==========================================
REM Keep window open for 5 seconds to see any errors
REM Pause for 5 seconds if running manually (not scheduled)
if "%1"=="--scheduled" goto :eof
timeout /t 5