Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Imhotep), 567 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Oanda instruments [Re: kalmar] #480397
06/04/20 06:24
06/04/20 06:24
Joined: May 2018
Posts: 21
Y
YG8 Offline
Newbie
YG8  Offline
Newbie
Y

Joined: May 2018
Posts: 21
I am a total novice when it comes to this so my apologies for the stupid question

First of all I installed python version 3.6.8 32-bit since that is what the Zorro manual says.

When I try to run the code in jupyter notebook I get an error message

---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-8f5335d6a9a7> in <module>
2 import pandas as pd
3
----> 4 import oandapyV20
5 import oandapyV20.endpoints.accounts as accounts
6 import oandapyV20.endpoints.pricing as pricing

ModuleNotFoundError: No module named 'oandapyV20'


When I try to run the code in IDLE python shell i gett the following error message

SyntaxError: multiple statements found while compiling a single statement

I did use the pip option and installed both the oandapyV20 module and pandas

Where could I successfully run the code? (I have an Oanda account and did enter the account details)

Last edited by YG8; 06/04/20 06:24.
Re: Oanda instruments [Re: kalmar] #480413
06/05/20 10:24
06/05/20 10:24
Joined: May 2020
Posts: 27
Germany
M
Morris Offline
Newbie
Morris  Offline
Newbie
M

Joined: May 2020
Posts: 27
Germany
Hi YG8,

I'm not sure this will run in Jupyter or in the shell (depending on how it is set up).

> I did use the pip option and installed both the oandapyV20 module and pandas

Good, that's an important step!

> SyntaxError: multiple statements found while compiling a single statement

That is probably because the shell usually just takes one statement at a time. It is not meant to execute scripts.

=> I would suggest to just run the script locally: python <scriptname>. Or, if your python is installed accordingly, just run the <script.py>, and it will be interpreted by python.

Good luck!

Re: Oanda instruments [Re: kalmar] #480486
06/09/20 10:17
06/09/20 10:17
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
If anybody have time. This is script for reading information in MT4.

symbols.raw ( located in ".\history\default" )
fce return pandas dataset:


Code
def read_symbol(filepath):
    with open(filepath, 'rb') as f:
        
        dtype = [('symbol', 'S12'),   #OK
                 ('desc', 'S64'),     # 12:76 OK
                 ('alt', 'S12'),      # 76:88 OK
                 ('base', 'S12'),     # 88:100 OK
                 ('group', 'i4'),     # 100:104 OK
                 ('digits', 'i4'),    # 104:108
                 ('trademode', 'i4'), # 108:112
                 ('bcolor', 'i4'),    # 112:116 OK
                 ('id', 'i4'),        # 116:120
                 ('u1', 'a1508'),     # 120:1628 OK
                 ('u2', 'u4'),        # 1628:1632
                 ('u3', 'a8'),        # 1632:1640
                 ('u4', 'f8'),        # 1640:1648
                 ('u5', 'a12'),       # 1648:1660
                 ('spread', 'i4'),    # 1660:1664
                 ('u6', 'a16'),       # 1664:1680
                 ('swLong', 'f8'),    # 1680:1688
                 ('swShort', 'f8'),   # 1688:1696
                 ('swap3', 'u4'),     # 1696:1700
                 ('u8', 'i4'),        # 1700:1704
                 ('conSize', 'f8'),   # 1704:1712
                 ('u9', 'a16'),       # 1712:1728
                 ('stopLevel', 'u4'), # 1728:1732
                 ('u10', 'a12'),      # 1732:1744
                 ('marginInit', 'f8'),# 1744:1752
                 ('marginMant', 'f8'),  # 1752:1760
                 ('marginHedg', 'f8'),  # 1760:1768 
                 ('marginDiv', 'f8'),   # 1768:1776
                 ('pointPerUnit', 'f8'), # 1776:1784
                 ('u11', 'a24'),         # 1784:1808
                 ('marginCurr', 'S12'),  # 1808:1820
                 ('u12', 'S104'),        # 1820:1924 
                 ('u13', 'i4'),          # 1924:1928
                 ('u14', 'f8')]          # 1928:1936
                
        df = pd.DataFrame(np.frombuffer(f.read(), dtype=dtype).astype(dtype))
        dropnames=[]
        for x in range(1,15):
            dropnames.append('u'+str(x))   
        del dropnames[6:7]
        dropnames.append("desc")
        dropnames.append("alt")
        dropnames.append("marginCurr")        
        df=df.drop(dropnames, axis=1)
        return df
 


P.S. can be also in Zorro, but python I know better

Attached Files Snímek obrazovky 2020-06-09 v 15.16.28.png
Last edited by Grat; 06/09/20 10:18.
Re: Oanda instruments [Re: Grat] #485873
05/01/22 23:40
05/01/22 23:40
Joined: Dec 2021
Posts: 3
S
seerwright Offline
Guest
seerwright  Offline
Guest
S

Joined: Dec 2021
Posts: 3
Thanks, Grat!

Page 2 of 2 1 2

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1