Support Board
Date/Time: Fri, 05 Dec 2025 07:33:20 +0000
Post From: How to Set Up Visual Studio 2022 Community to Develop Custom Studies for Sierra Chart
| [2025-12-04 22:26:40] |
| stiasny - Posts: 18 |
|
Hey everyone, i went a step further and created the project template. ill just correct the steps. the template is the attached zip file sierra_study.zip How to Create a Custom Study Project that will Generate a DLL • Download and install Visual Studio 2022 Community (install it anywhere you want) • Download Link: https://visualstudio.microsoft.com/vs/community/ • Put the sierra_study.zip into "C:\Users\pogac\Documents\Visual Studio 2022\My Exported Templates" folder - change according to your VS Community Version, mine is 2022 atm • Open Visual Studio • Click “Create a New Project” • In search for templates search for sierra_study • Click “Next” • Enter a name for your project (name your project the same name as your DLL, you can explore other options later) • Select a location for your project • Check “Place solution and project in the same directory” - if you plan to have only 1 study per trading problem you are trying to solve with Sierra study • Dont check the “Place solution and project in the same directory” - you always need 1 project for 1 study, so if you will have many studies for 1 trading problem, this is the way to go • Click “Create” IMPORTANT When you create study project from the template, you create a new, basic Sierra study template (.cpp) that resides in the project folder. If you are moving a previous custom study over to VS, you need to COPY the contents of the original source file (.cpp that is usually located in the ACS_Source folder) and PASTE it into this new, empty source file (.cpp) that resides in your project folder. Once you do that, you should never work with -- or reference -- that original source file ever again while working in VS. What You will Need and How to Get It • Windows Powershell Version 6 (or higher) • Powershell Tools for Visual Studio 2022 As I understand, all versions of Windows, including Windows 11, only have Version 5.1 (or earlier) installed. To check your version, open Powershell and, at the prompt, type: $PSVersionTable :and press Enter. If you need to download and install the most recent version of Windows Powershell. The following download link was good as of 2025-02-21. Install it wherever you want. https://github.com/PowerShell/PowerShell/releases/download/v7.4.4/PowerShell-7.4.4-win-x64.zip To install the “Powershell Tools for Visual Studio 2022” extension. At the top of Visual Studio: • Click “Extensions” • Click “Manage Extensions” • When the Extension Manager opens, search for “Powershell Tools” • You should see “Powershell Tools for Visual Studio 2022” in the results • Click on that extension, and, at the top of the adjacent pane, click "Install" Make certain you set your Sierra Chart UDP port to the port 22904 (bacause this port is set in the imbedded Powershell files - you can change the port in the files if you wish): • Global Settings > Sierra Chart Server Settings > General > UDP Port The UDP port doesn't have to be the same port I used, just make certain the port you use is the same in all three places. One last note: SC creates a DLL with a "_64" appended to the DLL name, VS does not, and "_64" in the DLL name is not required. For any existing custom studies you are currently using, where you plan to move further editing to VS, it would be wise to first remove that existing study from the chart, and delete the "_64.dll" file and all its associated files (_64.exp _64.lib _64.pdb) for that study from the SC data folder. Then build/deploy the new version of that study and re-add it to the chart. ************* !! WARNING !! ************* Based on the above configuration, other than the one exception (above), when you build/deploy from within VS, your changes will take effect IMMEDIATELY!! So if you are coding a study that actually places trade orders, make sure you leave SC in SIM mode until you are ABSOLUTELY CERTAIN you have all the bugs worked out -- because it would be very traumatic if something were to glitch out and you suddenly find yourself short 1,000 contracts in your real-money account! That would definitely ruin your day... maybe even your life!! :) |
| Attachment Deleted. |
