Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: marketPricePause() and marketPriceResume() #25

Closed
peervm opened this issue Apr 17, 2017 · 8 comments
Closed

Examples: marketPricePause() and marketPriceResume() #25

peervm opened this issue Apr 17, 2017 · 8 comments

Comments

@peervm
Copy link

peervm commented Apr 17, 2017

Hi,

Can you provide working examples of marketPricePause() and marketPriceResume() please.

I am unable to make the call as per the documentation and the stubs below don't help much.

Thanks,
Peer

Boost.Python.ArgumentError: Python argument types in Pyrfa.marketPriceResume(Pyrfa) did not match C++ signature: marketPriceResume(class Pyrfa {lvalue}, class boost::python::api::object)

@ukrit-himakoon
Copy link
Contributor

ukrit-himakoon commented Apr 17, 2017 via email

@wiwat-tharateeraparb
Copy link
Contributor

There is a working example on GitHub https://github.com/devcartel/pyrfa/blob/master/examples/conflate.py

@peervm
Copy link
Author

peervm commented Apr 17, 2017

Thanks guys. The conflate.py example has pauseAll() and resumeAll() which works fine for me.

I'm using 8.1.0 on Python 3.6 win64 but this code doesn't work;
p.marketPricePause("JPY=")
p.marketPriceResume("JPY=")
where p is an instance of the pyrfa.pyrfa.Pyrfa class.

It says method signature error;
did not match C++ signature: marketPriceResume(class Pyrfa {lvalue}, class boost::python::api::object)

@peervm
Copy link
Author

peervm commented Apr 17, 2017

I can see the signature looks the for all methods;

  • def marketPriceRequest(self, Pyrfa, *args, **kwargs):
  • def marketPriceResume(self, Pyrfa, *args, **kwargs):
  • def marketPricePause(self, Pyrfa, *args, **kwargs):

Expected usage:

  • p.marketPriceRequest("JPY=") #Works fine
  • p.marketPriceResume("JPY=") #Fails
  • p.marketPricePause("JPY=") #Fails

@wiwat-tharateeraparb
Copy link
Contributor

wiwat-tharateeraparb commented Apr 17, 2017

@peervm Can you check the PyRFA version on your machine? Looks like you are loading older version of PyRFA. PyRFA supports pause and resume from version 8.0.0.1.

@wiwat-tharateeraparb
Copy link
Contributor

wiwat-tharateeraparb commented Apr 17, 2017

@peervm We just did a test on Python 3.6 windows 64 and it works fine.

Result:

pasted image at 2017_04_17 12_28 pm

Try with below code:

import pyrfa
exec(open('./utils/every.py').read())

p = pyrfa.Pyrfa()
p.createConfigDb("./pyrfa.cfg")
p.acquireSession("Session1")
p.createOMMConsumer()
p.login()
p.directoryRequest()
p.dictionaryRequest()
p.marketPriceRequest("JPY=")
p.dispatchEventQueue(1000)
p.marketPricePause("JPY=")

def getConflatedUpdate():
    p.marketPriceResume("JPY=")
    updates = p.dispatchEventQueue(10)
    p.marketPricePause("JPY=")
    if updates:
        print("")
        for u in updates:
            print(u['SERVICE'] + " - " + u['RIC'])
            for k,v in u.items():
                if type(v) is float:
                    print("%15s %g" % (k,v))
                else:
                    print("%15s %s" % (k,v))
            print("")

loop = every(10, getConflatedUpdate)
end = False
try:
    while not end:
        pass
except KeyboardInterrupt:
    loop.stop()
    end = True

@peervm
Copy link
Author

peervm commented Apr 17, 2017

Installing RFA libraries on win7 machine installs into difference and confusing paths and this caused a conflict.

  • C:\Program Files\Reuters\rfa\8.0.1 #64bit version
  • C:\Program Files (x86)\Reuters\rfa7 #32bit version

I haven't fixed the issue locally yet, but it is almost certainly the root cause.

Thanks for your assistance and amazing response time.

@peervm peervm closed this as completed Apr 17, 2017
@peervm
Copy link
Author

peervm commented Apr 18, 2017

Got everything working now. But just for future reference, another mistake I made was to use snapshot mode. Obviously pause\resume only works for setInteractionType("stream").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants