FX31337 / FX-BT-Scripts

:page_facing_up: Useful scripts for backtesting.
MIT License
34 stars 39 forks source link

Write script to read symgroups.raw file. [$30 awarded] #42

Closed kenorb closed 8 years ago

kenorb commented 8 years ago

Write a new script in Python 3 which will print the values from symgroups.raw file to the output (similar to other read_symbols_x scripts).

Can be in any output format, but format of fields should match its type (ask/bid should print float, time should print time, etc).

Related: #33, #41

Format reference: symgroups.raw.h

Check samples files symgroups.raw-samples.zip or they can be generated by installing MT4 platform.

--- The **[$30 bounty](https://www.bountysource.com/issues/32284438-write-script-to-read-symgroups-raw-file?utm_campaign=plugin&utm_content=tracker%2F20487492&utm_medium=issues&utm_source=github)** on this issue has been claimed at [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F20487492&utm_medium=issues&utm_source=github).
kenorb commented 8 years ago

I've this:

name =
description = ^@utures
backgroundColor = 0

name =
description = ^@ICEX
backgroundColor = 0

name =
description = ^@TS
backgroundColor = 0

name =
description = ^@PBEX
backgroundColor = 0

name =
description = ^@ong Kong Stock Exchange
backgroundColor = 0

So looks like it's cut off and name is most of the time empty (if that's correct, that's fine).

Also it's possible that when using with head the Exception message won't show?

$ python3 read_symbols.py -t symgroups -i symgroups.raw | head
...

name = CFD
description = Contract For Difference
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe

File: symgroups.raw

LemonBoy commented 8 years ago

Can't do much wrt the leading NULs, the entry's encoded that way into the file... And I have no problem with less, can't say what's wrong there

kenorb commented 8 years ago

Fixed in #46