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.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:
• 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?
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
Thank you for the quick response, that's exactly what I am looking for. But unfortunately the examples I downloaded from github
does not include the one you showed here, could you let me know where to find it or share it with me if possible?
I was wondering how I can stop making the Bid, ASK and Last field automatically populate from the REDI API in my order entry tool in excel, it might be coded into the VBA somewhere in the sheet, i am not sure how to fix it