20 lines
766 B
Python
20 lines
766 B
Python
|
|
# -*- coding: utf-8 -*-
|
||
|
|
import csv
|
||
|
|
p = r'D:\TradingTerminal\MetaTrader 5\Tester\Agent-127.0.0.1-3000\MQL5\Files\exp003_setups.csv'
|
||
|
|
n = 0; passn = skipn = 0; longs = shorts = 0
|
||
|
|
dec = {}
|
||
|
|
with open(p, 'r', encoding='ansi', errors='replace', newline='') as f:
|
||
|
|
r = csv.DictReader(f)
|
||
|
|
for row in r:
|
||
|
|
n += 1
|
||
|
|
d = row.get('decision', '')
|
||
|
|
dec[d] = dec.get(d, 0) + 1
|
||
|
|
if row.get('direction') == 'LONG': longs += 1
|
||
|
|
else: shorts += 1
|
||
|
|
print('rows:', n, '| decisions:', dec, '| LONG:', longs, 'SHORT:', shorts)
|
||
|
|
with open(p, 'r', encoding='ansi', errors='replace', newline='') as f:
|
||
|
|
hdr = f.readline().strip()
|
||
|
|
print('HEADER:', hdr[:200])
|
||
|
|
print('SAMPLE:')
|
||
|
|
for _ in range(3):
|
||
|
|
print(' ', f.readline().strip()[:220])
|