Command Line Printing - Overview
Overview
One of the advanced features supported by Optuma with Enterprise Services is command line printing. This allows you to automatically perform a number of functions, such as publishing charts, running scans, or creating .csv output files of watchlists with custom columns. These commands can be combined with the Windows Task Scheduler to automatically run whenever you need them.
For example, you can schedule to run a scan of new 52 week highs and lows at 7am each day with the results printed as either a watchlist or each chart as an image file using your preferred Page Layout.
Here’s Mathew explaining how these can be set up, but note that since the video was recorded we have made creating the command text easier with the Command Line Builder button that you can add to your toolbar.
Supported Commands
Command | Function | Comment |
---|---|---|
-Print |
Print to PDF File(s) | |
-PNG |
Create PNG File(s) | |
-JPG |
Create JPG File(s) | |
-GIF |
Create GIF File(s) | |
-EMF |
Create EMF Image File(s) | |
-CSV "csv file" |
Create CSV File | Depending on the Output folder you may need to run CMD in Admin Mode |
-PPP |
PDF per Page | |
-WB "workbook" |
Use Supplied Workbook | Supports Multiples |
-SL "symbol list" |
Use Supplied Symbol List | |
-PORTRAIT |
Overrides the default setting and forces the output to Portrait | |
-LANDSCAPE |
Overrides the default setting and forces the output to Landscape | |
-LO "chart layout" |
Use Supplied Chart Layout | |
-PL "page layout" |
Use Supplied Page Layout | |
-OUT "output folder" |
Use Supplied Output Folder | The Default Location is sDocuments\Optuma\Printed Files however, other paths can be specified. If the folder you specify does not exist, Optuma will create it. Tokens such as DESKTOP and MY DOCUMENTS can also be used when designating an output path |
-CLEAN |
Remove Footer from PDFs | |
-INDEX |
Create an Index Page with links to each page in the PDF | |
-INDEXFONTSIZE |
Set the size of the font used for the Index Page text | Only applicable if including an Index Page on your print |
-INDEXCOLUMNS |
Set the number of Text Columns the Index Page has | Only applicable if including an Index Page on your print |
-INDEXCODENAME |
Set the Information displayed on the Index Page | Only applicable if including an Index Page on your print |
-INDEXSORTTYPE |
Set the Sort Order for the Index Page | Only applicable if including an Index Page on your print |
-SCAN "scan file" |
Run a Scan | An existing scan file needs to be selected |
-SN "scan name" |
Use the Supplied Scan Name | This function will Run the selected Scan and save to a Symbol List (using -SL) |
-NEWPROCESS |
Opens another instance of Optuma | Creates a new process with a new instance of Optuma from the command line rather than using an existing instance of Optuma |
-NOTITLE |
Hides the charts title bar | If Print Settings have the Show Chart Title enabled, this option will allow you to hide the title bar from the outputted file |
-PAGESIZE |
Allows you to set the page size of the output | Eg: A4, A3, A5 |
-PAGEWIDTH |
Allows you to manually set the page width | Eg: A value of 280 would equal 280mm |
-PAGEHEIGHT |
Allows you to manually set the page height | Eg: A value of 120 would equal 120mm |
-LIMIT "number of symbols" |
Limits number of symbols used when testing new command line print | |
-STITCH |
Concatenates multiple PDF outputs | Contact support for further documentation |
-WORD |
Creates a Word Doc | |
-PPT |
Creates a PowerPoint Presentation | |
-EMAIL "email address" |
Sends out an email of the chart/workbook/etc | Only works with Outlook. |
-WEB |
Publishes to publish.optuma.com | |
-2UP |
Puts 2 pages together | Puts 2 landscape charts on a portrait page, or vice versa. |
-BREADTH |
Build / Rebuild existing Breadth Codes | Add parameters to allow running multiple breadth scans from command line. e.g. -breadth “breadthname|breadthname 2|breadth name 3” |
-PRIVATE |
Sets a web publish to be private | Private web publishes can’t be searched, they can only be accessed by those with the URL. |
-PUBLIC |
Sets a web publish to be public | Public web publishes can be searched on the Optuma publishing site, and by search engines such as Google. |
-PASSWORD |
Sets a password on a web publish (requires the publish to be set as Private). | When publishing to web you can restrict access to the material by adding a password. -password followed by the “password” |
-WLO |
Use Supplied Watchlist Layout | |
-ALERTS |
Generates a list of triggered alerts | Added in Optuma v1.5 |
-run batchfile |
Allows you to reference a txt file, which is setup to publish multiple items in a row (without restarting). | Added in Optuma v2.0 |
-getdata |
When using Optuma EOD data (or FRED data) this command will force the data to update with the latest available information before the published material is produced. | Added in Optuma v2.0 |
Accessing the Command Prompt
To access the Windows command prompt, click the Start button, type ‘CMD’ and press Enter.
In the window that opens, navigate to your Optuma folder. If using the default installation path this would be done using the following command:
cd C:\Program Files\Optuma
Once you have selected the Optuma folder, you can begin inputting print commands.
Examples
optuma.exe -print -index -wb "My Charts.owb"
This will create a single PDF file for all charts contained within the My Charts workbook. The PDF file will include an index page at the start, with links to each page.
optuma.exe -print -ppp -wb "My Charts.owb"
This will create multiple PDF files (one per page) of the My Charts workbook.
optuma.exe -print -sl "ASX Top 200" -lo "Volatility" -out "C:\Printed Files"
This will create a single PDF in the folder called Printed Files. The PDF will contain all the codes found in the ASX Top 200 Symbol List. Each chart will display using the layout called Volatility.
optuma.exe -png -wb "My Charts.owb" -out "G:\My Image Files"
This will create a set of PNG files for each page in the My Chart workbook. The files will be saved to the My Image Files folder, located on G drive.
optuma.exe -csv -wb "My Watchlist.owb" -out DESKTOP/OptumaOutput
This will create a .csv file containing the custom columns of a watchlist, saved to the OptumaOutput folder on your Desktop.
optuma.exe -SCAN -SN "Trend Reversals.osn" -SL "Review Today"
This will run the scan called Trend Reversals and will save the results in a Symbol List called Review Today.
Windows Task Scheduler
Windows Task Scheduler is a great way of setting up multiple commands to run while the PC / Laptop is unattended.
If setting up Command Line Print tasks in the Windows Task Scheduler, you may need to enter your Windows user password. Note that if you change your password you will need to update the details in the tasks as well for them to work.
Batch Publishing
From Optuma 2.0 and later the command line printing module supports batch printing. The following is an example of the format used in a text file:
-csv -SL "ETFs" -WLO "C:\Users\tester\Documents\Optuma\Local\Layouts\Watchlists\RANK_W" -out "C:\Reports\USA-CSV" -filename "Test1" -overwrite
-csv -SL "Stocks" -WLO "C:\Users\tester\Documents\Optuma\Local\Layouts\Watchlists\RANK_D" -out "C:\Reports\USA-CSV" -filename "Test2" -overwrite
-csv -SL "Funds" -WLO "C:\Users\tester\Documents\Optuma\Local\Layouts\Watchlists\RANK_M" -out "C:\Reports\USA-CSV" -filename "Test3" -overwrite
The above would be saved in a file such as PrintBatch.txt. The command to run the file process would be:
"C:\Program Files\Optuma\Optuma.exe" -run "C:\Reports\printbatch.txt" -newprocess