For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Is there an easy way to debug live trading?

  • I've tried putting in print statements in

    def request(self, endpoint, method='GET', params=None):

    but not seeing it in console.. (and orders not hitting oanda servers).. which makes me wonder if the oandapy module is being called at all. But if I use command line using curl (with same acctid/apikey), it seems to work fine.

    The constructor (def init) seems to be getting hit... the request method, on the other hand, does not seem to be.`

    Is there a smarter way to debug?

  • Never mind.

    Solved it. It turns out buy_bracket() with float(size) doesn't work.. it accepts int(size)

  • administrators

    buy_bracket itself doesn't look at anything. It simply generates orders and delegates to the rest of the platform. But if the size doesn't make sense (float) things will probably break somewhere.

    There is no specific provision to forbid passing a float, but there is also no effort made to check that it isn't passed.

Log in to reply