question

Upvotes
Accepted
1 0 0 2

PriceType Invalid - Order submission in VBScript REDI API

Submitted the order exactly like in the sample code and API spec, however PriceType upon assignment to the Order object is getting assigned 'invalid' as the value ? Order Submission is failed with the message "Failed. Price type is required". Msg line in the below code does return "PriceType invalid" as the error message. What am I doign wrong here ?


Dim hOrder As New Order

hOrder.Side = Side

hOrder.Symbol = Symbol

hOrder.Exchange = Exchange

hOrder.PriceType = "Limit"

hOrder.TIF = "OPG"

hOrder.Account = Account

hOrder.Warning = False

hOrder.Ticket = "Bypass"

MsgBox ("PriceType " & hOrder.PriceType)

If L1Qty > 0 & Side = "Buy" & L1Select = "Yes" Then

hOrder.Price = Bid - ((L1Perc * Bid) / 100)

hOrder.Quantity = L1Qty

rtnVal1 = hOrder.Submit(errMsg)

eikon-com-api
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.

Hello @4strading2020

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvotes
Accepted
32.2k 40 11 20

Hello @4strading2020,

I find that in REDI new Order population, every value populated has to be valid, and the order in which you populate/set the fields, matters.

Otherwise I have also seen this error before.

Try this order of population, please make sure every field is set with a valid value, does this help?

Dim hOrder As New Order
    
      hOrder.Side = Side
      hOrder.Quantity = Quantity
      hOrder.Symbol = Symbol
      hOrder.Exchange = Exchange
      hOrder.PriceType = PriceType
      hOrder.Price = Price
      hOrder.TIF = TIF
      hOrder.Account = Account
      hOrder.Warning = False
      hOrder.Ticket = "Bypass"


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
1 0 0 2

Unfortunately, it didn't work. I made sure valid values are passed and in the order specified as below. Still getting PriceType invalid error.


hOrder1.Side = "Buy"

hOrder1.Quantity = "10"

hOrder1.Symbol = "F"

hOrder1.Exchange = "DEMO DMA"

hOrder1.PriceType = "Limit"

hOrder1.Price = 10

hOrder1.TIF = "Day"

hOrder1.Account = "XXXXXXX"

hOrder1.Warning = False

hOrder1.Ticket = "Bypass"

MsgBox ("PriceType " & hOrder1.PriceType)

rtnVal1 = hOrder1.Submit(errMsg)


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
32.2k 40 11 20

Hello @4strading2020,

I have taken your code, as is, changing only account, replaced it in the example, and have submitted the order successfully, there is no issue with this code at this time.

Let us verify together something else. After you have made the most current changes, have you had a chance to save the VBA code and to reset the sheet by pressing the small blue square reset button?

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
1 0 0 2

Looks like the exchange is causing the issue. I switched the exchange to GSDE NYSE and the orders are flowing through now. However I would like to use a test exchange for further testing, is there one ? Attached are the list of exchanges in my montage screen that I see. ( screenshot below)



1581532106291.png (26.8 KiB)
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.

Hi @4strading2020,

As you have registered on dev portal with a private email address, we are not able to tell who you are at the moment.

If you let us know your org email, or your REDI id, we can help by conveying to product your request to permission for DEMO exchange?

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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