question

Upvotes
Accepted
1 0 0 0

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 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
23k 22 9 14

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 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 0

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 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea