question

Upvotes
Accepted
1 1 1 1

How to send Stop Market entry order from Excel VBA to REDI Plus

Hello, I am trying to send a Stop Market entry order from excel VBA to REDI Plus, the code is like below,

Dim hOrder As New Order

hOrder.Symbol ='SQQQ

hOrder.Side = "Buy"

hOrder.Quantity = 100

hOrder.Exchange = "GSDE Algo"

hOrder.PriceType = "SOR GSDE"

hOrder.StopPrice = 26.88

hOrder.TIF = TIF

hOrder.Account = AccountID

hOrder.Ticket = "Bypass"


It filled as a market order immediately without waiting for he price breakout the StopPrice. I checked the variable, hOrder.IsStopPriceEnabled which is false in this case. My question is that how can I enable it?

Also I tried some other PriceTypes from the API, like the "Stop", it will pop up "PriceType invalid" error.

By the way, I am able to send the stop market entry order in REDI plus without problem. it just need to set the DESINATION as GSCO NA Eq Algo, the PRICE TYPE as SOR, the ORDER TYPE as Stop, and fill out the price in the "STOP" field instead of "PRICE" field. But in the API, there is only one property to set the "Price Type" and "Order Type", the options are:

• Market

• Limit

• Stop

• Stop Limit

• Peg Ask

• Peg Bid

• Peg Mid

• Market Close

• Limit Close

So how can I set them from VBA code to match the fields in REDI Plus?

redi-apiequitiesorder-entry
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.

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 appropriate 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 @Gerry Z,

If you are running a REDI Order Entry example (?), try:

1. Modifying generic order creation code to set StopPrice similar to:

hOrder.Side = Side
     hOrder.Quantity = Quantity
     hOrder.Symbol = Symbol
     hOrder.Exchange = Exchange
     hOrder.PriceType = PriceType
     hOrder.Price = Price
     hOrder.StopPrice = Price
     hOrder.TIF = TIF
     hOrder.Account = Account
     hOrder.Warning = False
     hOrder.Ticket = "Bypass"

2.Selecting Stop from the Order Type drop-down:

3. Verifying via RediPLus if the order submitted is, in fact, a stop order next:

Hope this helps



redistop.gif (79.7 KiB)
redistop2.gif (70.6 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.

Upvotes
1 1 1 1

Zoya,


Thank you for the quick response, that's exactly what I am looking for. But unfortunately the examples I downloaded from github
https://github.com/TR-API-Samples/Example.REDI.VB.ExcelExamples

does not include the one you showed here, could you let me know where to find it or share it with me if possible?


Best,

Gerry

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 @Gerry Z,

I tested with Order Entry - PT Batch Load (Global Equities & Futures) example on

GitHub: /Example.REDI.VB.ExcelExamples.

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.

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.