question

Upvotes
Accepted
6 0 0 2

REDI API error field not returning any value in C#

We are trying to implement order submission in C#.

We were able to get limit order working in C#. Everything else equal, if we change PriceType to "Market" and remove price, it retuns false but it doesn't hydrate the error object that gets passed in to the submit method.

(as a side note, if I have the montage opened using the code, it shows me that it's defaulting to limit without price filled in. Simialrly, we are not able to use vwap because it defaults to nightowl without any error msg)

Why is the error var not getting hydrated?

errorc#redi-apierror-message
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
30.3k 34 11 17

Hello @9ca049af-b0cc-45cb-82ef-c9ea8e1b3095,

To see the error on submit, please try

bool good = true;
object objErr = null;
good = hOrder.Submit(ref objErr);
Console.WriteLine("Submitted");
if (!good) Console.WriteLine(objErr);

To test "Market", to see it submitted, please try:

.Exchange = "*ticket"

or

populate .Price

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
30.3k 34 11 17

Hello @9ca049af-b0cc-45cb-82ef-c9ea8e1b3095,

Are you running C# example "SendOrder"? if yes, please try Destination="*ticket" with no price. Ticket should be seen on Message Monitor.

I believe DEMO destinations require Price to be populated. So if you like to test DEMO destimation, please enter a price.

After submit, SendOrder example writes out objErr, which contains the possible error message?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the reply. Cannot find order or Destination method for the Order object (REDI)

I'm using the example below from the documentation. Making hOrder.PriceType to 'Limit' and specifying hOrder.Price works. But the example as is doesn't submit() returns false and err is still null.

 ORDER hOrder = new ORDER();
 Object err = null;
 Object result;
 hOrder.Side = “Buy”;
 hOrder.Symbol = “ZVZZT”;
 hOrder.Quantity = “1”;
 hOrder.PriceType = “Market”;
 hOrder.Exchange = “DEMO DMA”;
 hOrder.TIF = “Day”;
 hOrder.Ticket = “Bypass”;
 hOrder.Account = “TESTACCT”;
 result = hOrder.Submit(err);

to be clear, we are not planning to use market, but rather trying to see the error msg because we cannot troubleshoot why vwap isn't working but that might involve our broker and would like to get the err msg working first.