Gamestudio Links
Zorro Links
Newest Posts
A9
by 3run. 07/09/20 19:13
Historical ticks for Lookback backfill
by Zheka. 07/08/20 09:10
Trade Mode without a broker
by jj02520024. 07/08/20 01:20
How to handle algo name in Simulate.c
by happysun. 07/07/20 08:56
Erasing a datapoint in a plot array
by jcl. 07/06/20 09:51
typo
by jcl. 07/06/20 09:44
Video Panel System
by Emre. 07/06/20 09:39
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
4 registered members (jenGs, Quad, kvm, 3run), 398 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
dasanc, DavidFdez, TraderKevin, deus777, carolthesecond
18476 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: 19
Y
YG8 Offline
Newbie
YG8  Offline
Newbie
Y

Joined: May 2018
Posts: 19
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: 9
Germany
M
Morris Offline
Newbie
Morris  Offline
Newbie
M

Joined: May 2020
Posts: 9
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: 267
Czech Republic
G
Grat Offline
Member
Grat  Offline
Member
G

Joined: May 2015
Posts: 267
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
Last edited by Grat; 06/09/20 10:18.
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