Sending Order Via Python

Options

Hello everyone! I am following the Python example on page 34 of the REDI API Specification (1). Below is my exact code that I cut and pasted into my editor (2).

The results are that:

The variable result is false (Meaning that the order was not submitted?)

msg returns "False Price type is required" (Meaning that the COM interface failed?)

Not sure what to do next because I am just trying the most basic example. Thanks for any feedback.

(1)

image

(2)

image


Tagged:

Best Answer

Answers

  • zoya faberov
    zoya faberov ✭✭✭✭✭

    Hello @MrTrader2019,

    The code works for me, able to submit a test order, but I reproduce the same error if I either omit PriceType or misspell PriceType value.

    Can you try commenting your PriceType line and adding instead

    o.PriceType = "Limit"
    o.Price = "0.01"

    If works, remove these two and replace with:

    o.PriceType = "Market"

    Let us know how it goes for you?

  • Hello Zoya,

    Something is still wrong here. I tried the above changes but same issue. I have attached my python program to this email so you can see if it works on your end.

    I have attached my Python example as api-example-python-test-2-14-2019.zip.

    Thank you.

  • zoya faberov
    zoya faberov ✭✭✭✭✭

    Hello @MrTrader2019,

    We have been able to confirm that you were not entitled for DEMO DMA destination.

    Presently, you have been entitled, the attached code runs on my end with my account, please try again.

  • I ran the exact code I sent you and still the same issue.

  • zoya faberov
    zoya faberov ✭✭✭✭✭

    Hello @MrTrader2019,

    Please try again tomorrow. The entitlement grant may take time to propagate.

    Please let us know tomorrow how it goes.

    Thanks

  • 1.) I noticed that I had the following message in my messages window:

    <..>

    11:57:02 You are not entitled for PT. <OK>
    11:57:05 You are not entitled for PT. <OK>

    <...>

    2.) I closed out and restarted REDI.

    3.) Things work when:

    I changed:

    o.Exchange = "DEMO DMA"

    to

    o.Exchange = "GSDE ARCA"

    and replaced:

    o.Account = "TESTACCT"

    with

    o.Account = "xxxxxxx" (My actual account number here)

    4.) Looks like I am missing access to the DEMO DMA Exchange.

    Thanks for all your help Zoya.