User Tools

Site Tools


pproapi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pproapi [2013/07/08 16:05] shengpproapi [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-**This work is licensed under a [[http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US|Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License]].** 
  
-====== PPro8 PProAPI ====== 
- 
- 
-**Overview** 
- 
-The [[ppro8_trading_platform|PPRo8]] API is a web service that will provide information to communicate with third party applications using a XML file to allow trading, when the API is turned on in the toolbar of PPro 8. 
- 
-Through the PPro8 toolbar, the user will be able to turn the switch to start or stop the web service that will provide information to communicate with third party applications using a XML file. 
- 
-The user will be able to go for Main API Portal using the follow link: http://localhost:8080 where a brief summary of the steps necessary to use the tool is available. 
- 
-{{ :api_001.jpg?nolink |}}\\ 
- 
-====API Request Commands==== 
- 
-The API provides web service to use different syntax and execute the commands giving information to the user. 
- 
-**Register a symbol** 
- 
-  * Request Type: RegisterSymbol 
-  * Parameters:  
-  *   * symbol 
-  *   * feedType[Lv1,Tos]   
- 
-**De-register a symbol** 
- 
-  * Request Type: DeregisterSymbol 
-  * Parameters:  
-  *   * symbol 
-  *   * feedType[Lv1,Tos]   
- 
-**Get Lv1 for a symbol** 
- 
-  * Request Type: GetLv1 
-  * Parameters:  
-  *   * symbol 
-  *   * lv1side[Lv1Bid,Lv1Ask] 
- 
-**Get Tos for a symbol** 
- 
-  * Request Type: GetTos 
-  * Parameters: symbol. 
-  * Returns: XML format  
-                                    
-                                       '<tosData symbol="" price="" size="" />'  
-                                      
- 
-**Execute Single Order** 
- 
-  * Request Type: ExecuteOrder 
-  * Parameters:  
-  *   * symbol 
-  *   * price 
-  *   * ordername 
-  *   * shares 
-  * Returns: RequestId    
- 
-**Cancel Single Order** 
- 
-  * Request Type: CancelOrder 
-  * Parameters: ordernumber   
- 
-**Get Order Number for requestId** 
- 
-  * Request Type: GetOrderNumber 
-  * Parameters: requestid 
-  * Returns: orderNumber   
- 
-**Execute Basket Order** 
- 
-  * Request Type: ExecuteListOrder 
-  * Parameters:  
-  *   * symbol 
-  *   * orderlistname 
-  *   * shares   
- 
-**Flatten** 
- 
-  * Request Type: Flatten 
-  * Parameters: symbol 
-  * Comments:  
-  *   * If symbol is empty all positions for the trader will be flatten 
-  *   * If symbol contains a symbol, only that symbol will be flatten 
-  *   * If symbol contains a list of symbols separated by commas all those symbols will be flatten 
- 
-**Get Orders** 
- 
-  * Request Type: GetOpenOrders 
-  * Parameters: none 
-  * Returns: XML format  
-                  { 
- <Orders> 
- <Order id="" state="" /> 
- <Order id="" state="" /> 
-   (....) 
- </Orders>   
-                   } 
-  * Unordered List ItemComments: Order State table below: 
-  *   * ID = 0 --> Accepted 
-  *   * ID = 1 --> Part Filled 
-  *   * ID = 2 --> Filled 
-  *   * ID = 4 --> Cancelled 
-  *   * ID = 8 --> Rejected 
- 
-====API Formats==== 
- 
- 
-The user simply inputs a valid format with the command and parameters that wants to track. 
-**Url Format:** 
- <RequestType>? <parameter=value & parameter=value & parameter=value ... >    
- 
-**Rules** 
- 
-  - Ordered List ItemThe Format of the link is created on first position the “localhost:8080/” follow by “RequestType” and the “parameter=value”. 
-  - It’s necessary use the character “?” between the “RequestType” and the first “parameter=value” to separate both commands. 
-  - To pass by reference more of one parameter will need use the character “&” between one parameter and another. 
-  - The symbol name need to be typed in Uppercase only. 
-  - To type the value of the parameter is necessary keep the format of Uppercase and lowercase. 
-  - If the command will returns some information, it will be shown on XML format. 
-  - Please note the user must first name and configure the orders in keyboard setup and then open API portal in PPro8. Otherwise API port won’t be able to execute order/order list. The API portal must be turned off before the user modify any order in the keyboard setup. Once the setup is saved, user can turn on the API portal and all changes will take effect. 
- 
-**Examples** 
- 
-**Register a symbol** 
- 
-Url: localhost:8080/RegisterSymbol?symbol=ZVZZT.NQ&feedtype=Lv1 
- 
-**GetLv1 for symbol** 
- 
-  * Unordered List ItemUrl: localhost:8080/GetLv1?symbol=ZVZZT.NQ&lv1side=Lv1Bid 
- 
-**GetTos for symbol** 
- 
-  * Url: localhost:8080/GetTos?symbol=MSFT.NQ 
- 
-**Execute order** 
- 
-  * Unordered List ItemUrl: localhost:8080/ExecuteOrder?symbol=ZVZZT.NQ&price=0.01&ordername=buy&shares=100 
- 
-**Cancel order** 
- 
-  * Unordered List ItemUrl: localhost:8080/CancelOrder?ordernumber=DV105___00000002M16F4B2000000 
- 
-**Get orderNumber for request Id** 
- 
-  * Unordered List ItemUrl: localhost:8080/GetOrderNumber?requestid=1 
- 
-**Execute Basket Order** 
- 
-  * Unordered List ItemUrl: localhost:8080/ExecuteListOrder?symbol=ZVZZT.NQ&orderlistname=list&shares=100 
- 
- 
-**Flatten** 
-  * Url: localhost:8080/Flatten 
-  * Url: localhost:8080/Flatten?symbol=ZVZZT.NQ 
-  * Url: localhost:8080/Flatten?symbol=ZVZZT.NQ,ZWZZT.NQ, ..... 
- 
-GetOpenOrders 
- 
-  * Unordered List ItemUrl: localhost:8080/GetOpenOrders 
- 
-====Implementations==== 
- 
-**Excel Web Queries** 
- 
-The first step is “register” the symbol that the user will use to retrieve the data, using the following URL: localhost:8080/RegisterSymbol?symbol=ZVZZT.NQ&feedtype=Lv1 
- 
-Once the user have the URL that contains the XML format for the data he wants to retrieve like the current example to “Get Level 1 Bid side” with the follow URL: 
- localhost:8080/GetLv1?symbol=ZVZZT.NQ&lv1side=Lv1Bid 
- 
-Then go to Excel to use the Web Queries function to download it and format it as a nice, clean table inside the spreadsheet.  
- 
-{{ :api_002.jpg?nolink |}}\\ 
- 
-If the user click the “Data” tab on the Excel ribbon bar, then click “From Web,” a new window appears where he can paste the URL address from the financial data website.  
- 
-{{ :api_003.jpg?nolink |}}\\ 
- 
-Click the “Import” button in the New Web Query window and a table containing the current live data from the site appears in the spreadsheet in the cell range you select.  
- 
-{{ :api_007.jpg?nolink |}}\\ 
- 
-The user can then use his mouse to resize the table or even move it to another part of the worksheet.  
- 
-{{ :api_005.jpg?nolink |}}\\ 
- 
-Additionally, the user can change the font, font size or font and table color by right-clicking the table, then selecting “Format Table” or “Format Cells” on the pop-up list. 
- 
-**Keeping the Data Fresh** 
- 
-An Excel Web Query allows the user to retrieve the latest real-time data and insert it in the spreadsheet.  
- 
-However, Web Query does not refresh data in the table automatically. To refresh the data, the user must click the “Refresh All” icon in the Connections sections of the Data tab.  
- 
-{{ :api_006.jpg?nolink |}}\\ 
- 
-The user can also record a macro so that he can simply use the hot key combination to refresh the real-time data any time.  
- 
-If the user click the button control icon in the “Insert” section of the Developer tab, he can create control buttons on the spreadsheet and use it to run the macros quickly with a single mouse click.  
- 
-Click one button to retrieve the data and create the table in your spreadsheet, then later click the other to refresh the displayed data. 
- 
-**C# Web Request** 
- 
-Go to Microsoft Visual Studio to use the **WebRequest** function to download it and format it as a nice, clean fields inside the user's program.  
- 
-Please create a new project based on the following parts: 
- 
-  * Create a New Form  
-  * Add 2 textbox with the follow names: Symbol, Price 
-  * Add 4 buttons with the follow names: Register Symbol, Priview XML file, From XML to TextBox, Clear. 
-  * Add a RichTextBox with the name: XML Preview. 
- 
-**Example:** 
- 
-{{ :api_007.jpg?nolink |}}\\ 
- 
-After create all the User Interface, the user need to create the code for the following steps: 
- 
-  * Step #1: Type the symbol on the Symbol field what the user want to request information. 
- 
-  * Step #2: “Register” the symbol that the user will use to retrieve the data, using the following URL: localhost:8080/RegisterSymbol?symbol=ZVZZT.NQ&feedtype=Lv1 
- 
-  * Step #3: Preview the data the user wants to retrieve like the current example to “Get Level 1 Bid side” with the follow URL: localhost:8080/GetLv1?symbol=ZVZZT.NQ&lv1side=Lv1Bid 
- 
-  * Step #4: Convert XML data to the Price field to be able to manage the information from the server. 
- 
-**Here the user will found the code example for each button used on the Form:** 
- 
-**Register Symbol** 
- 
-{{ :api_008.jpg?nolink |}}\\ 
- 
-Preview XML 
- 
-{{ :api_009.jpg?nolink |}}\\ 
- 
-**From XML to Textbox** 
- 
-{{ :api_010.jpg?nolink |}}\\ 
- 
-**The Libraries necessary are** 
- 
-{{ :api_011.jpg?nolink |}}\\ 
- 
-**Declare the following variables on the “public partial class Form1 : Form”** 
- 
-{{ :api_012.jpg?nolink |}}\\ 
- 
-**The Result of the example** 
- 
-{{ :api_013.jpg?nolink |}}\\ 
- 
-=====Additional Notes===== 
- 
-=====See Also===== 
- 
-=====References===== 
pproapi.1373313906.txt.gz · Last modified: 2017/03/14 12:35 (external edit)