Today, we will introduce you to the QuantShare Grid Tool and give you some examples to help you get started with this powerful tool. One important thing to know is that this tool is available only in the Premium version (real-time version). What is the Grid Tool? The grid tool allows you to create tables or sheets like excel. The main advantage of this tool is its full integration with QuantShare. As with excel, you can create formulas, calculate the sum of multiple cells, edit cells format, create conditions... In addition, you can easily add QuantShare language formulas, C# scripts, cells that updates with real time data... A First Example Select "Tools -> Grid -> Grid Editor". The grid editor will open with a default and empty sheet. - Click on the B3 cell then type something like GOOG. Press "Enter". - Click on the B4 cell then type AAPL. - Click on the C3 cell and enter 10 - Click on the C4 cell and enter 11 To calculate the sum of the last two cell values: - Click on the C5 cell then type "=sum(" then move your mouse and select both C3 and C4 cells. Type the closing parenthesis ")" then Enter. Now, let us get the real close price for each of the GOOG and AAPL stocks. - In the C3 cell, remove the value you previously added then click on the "FX" button at the top (next to the formula editor) - Select the "Historical" category and the "GetCloseHisto" function - Click on the button next at the end of the "Symbol Name" line, select the B3 cell then click on "OK" in the newly opened "Select Cells" control. You can also directly type the cell name in the formula editor. - In the "Time Frame" field, type 1 then click on "Add" (1 for daily, 7 for weekly, 31 for monthly and so on) To perform the same operation for AAPL, we can just copy and paste the previous cell. For this, select C3 then click on the bottom/right corner, move your mouse to the C4 cell then release it. Notice how the C3 cell now gets the last close price of AAPL and how the C5 cell was updated and now reflects the sum of GOOG and AAPL close prices. To change the cells format, select the three cells (C3, C4 and C5), then right click and select "Cell Format". Select "Number" under "Cell Type" then click on "OK". Add Real-time data to your sheet In the previous example, we saw how we can set up a cell to receive the last daily close price for a particular stock. Now, let us show you how to make that cell receive real time data. - Click on the C3 cell then remove the existing formula - Click on the "FX" button at the top - Select "Intraday" category then "GetClose" function - Enter "B3" next to "Symbol Name", "0" as time frame then click on "Add" - Right click on the "C3" cell, select "DataFeed" then select a data feed Notice how the sum calculated in the C5 cell changes each time the last price of GOOG changes Conditions To highlight the real time cell and update its background each time a new tick is received, right click on the C3 cell then select "Conditions". Right click on the table in the new control then select "Add Condition" - Under "Operator" column, select "Always". We want this condition to be applied on each cell change. - Under "Result", pick a highlight color. - Under "Valid For", type a number (Example: 5) to specify for how long you want the cell to be highlighted. To open this sheet in the QuantShare workspace, you need to save it first. To save your sheet, select "File -> Save". In QuantShare, select "Tools -> Grid -> Open Grid" then select the previously saved sheet/grid. Before saving the sheet, you may want to change the output look by using these two options: - "View -> Show/Update Output" - "Set Grid Size" in the tool bar under the Grid menu. In a next post, we will show more advanced features of the Grid tool. We will show you how to create controls (buttons, combo-boxes...), how to create QS/C# formulas, how to apply them to a cell, how to create graphs, how to sort cells...
|