# ****************************************************************************************************************** # # # # DISCLAIMER # # # # REDI Global Technologies LLC (member FINRA), REDI Technologies Limited (FCA #612490) and their affiliates # # (collectively, .REDI.) may make available application programming interface (.API.) specifications, including # # sample code, for use solely in connection with a user.s internal non-commercial development purposes, in # # accordance with a user.s agreement with REDI and this REDI API Specification document. No right, title or # # interest is granted in or to the API specifications and user agrees at all times to treat these materials in # # a confidential and secure manner. By utilizing API specifications provided by REDI, the user of the API # # specifications understands that use of such specifications may affect live trading. The user of the API # # specifications assumes all responsibility for any action, or lack thereof, taken in a live trading environment # # including but not limited to execution of orders, cancellation of orders, modification of orders, analysis of # # market data, or the calculation of any position, order, complex order, or spread. The API specifications are # # provided on an .as is. basis and without warranty of any kind. REDI specifically disclaims all warranties for # # use of API specifications, express or implied, including implied warranties of merchant ability, fitness for a # # particular purpose, title, infringement, and operation of the API specifications with the REDIPlus System. REDI # # does not warrant that use of the API specifications will be uninterrupted, error-free, timely, complete, accurate # # or that defects in the foregoing can or will be corrected. REDI does not make any warranties as to the results # # to be obtained from use of the API specifications and use of the API specifications and any reliance thereon is # # at the user.s sole risk. No oral or written information or advice given by REDI shall create any warranties or # # in any way increase the scope of REDI.s obligations. This document has been prepared for informational p purposes # # only. Except as otherwise expressly permitted herein, the modification, reformatting, copying, downloading, # # storing, reproduction, or retransmission of API specifications is prohibited. All materials and services provided # # to you by REDI are governed by the terms of any applicable agreements with REDI. IN NO EVENT WILL REDI OR ITS # # THIRD PARTY PROVIDERS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION DIRECT OR INDIRECT, SPECIAL, # # INCIDENTAL, OR CONSEQUENTIAL DAMAGES, LOSSES OR EXPENSES ARISING IN CONNECTION WITH API SPECICATIONS. # # # # ****************************************************************************************************************** # import win32com.client import time from win32com.client import pythoncom, VARIANT from time import gmtime, strftime # Equity Order Entry Example q = win32com.client.Dispatch("REDI.CacheControl") # Prepare a variable which can handle returned values from submit method of the order object. msg1 = VARIANT(pythoncom.VT_BYREF | pythoncom.VT_VARIANT, 0) msg2 = VARIANT(pythoncom.VT_BYREF | pythoncom.VT_VARIANT, 0) msg3 = VARIANT(pythoncom.VT_BYREF | pythoncom.VT_VARIANT, 0) msg4 = VARIANT(pythoncom.VT_BYREF | pythoncom.VT_VARIANT, 0) vTable = "L1" vWhere = "true" tmpVal = q.Submit(vTable, vWhere, msg1) msg2.value = "IBM" msg3.value = "Adv30" tmpVal = q.GetL1Value(msg2, msg3, msg4) # print(strftime("%Y-%m-%d %H:%M:%S", gmtime()) + " " + msg3.value + " " + msg4.value + " " + msg2.value)