To use scripts from our GitHub project you have two options:
- Manual download the source files to your local directories
- Clone the GitHub project and link the scripts to your AgenaTrader directory (our recommendation)
Manual download to your local AgenaTrader directory
Of course this is easy to do and pretty straight forward if you just want to test AgenaScript for your stock trading.
The main disadvantage is that your local files will not update, if we modify scripts on our GitHub project!
Clone GitHub project and link to your AgenaTrader
This is our recommendation because if you clone a GitHub repository to your local computer you will automatically get the latest updates from the GitHub repository straight into your AgenaTrader. This is easy and you will receive AgenaScript updates immediately after you click on the sync button in your GitHub Desktop client.
Install GitHub client
If you want to stay up to date and always get the latest updates you need to download the GitHub desktop client (of course you can use any other Git client). Afterwards you are able to clone our GitHub project to your local AgenaTrader workspace using the GitHub client.
Follow this guide to download the GitHub Desktop application for your operating system. After the installation you are ready to clone your first GitHub repository.
The following checklist will help you do to this:
- Sign in to GitHub and GitHub Desktop before you start to clone an AgenaScript repository.
- On GitHub, navigate to the main page of the AgenaScript repository.
- Under the repository name click clone or download.
- Click Open in Desktop to clone the repository and open it in GitHub Desktop.
- In GitHub Desktop please verifying the name and location on your local drive where you would like to clone the repository. In the end click on the clone button.
Linking scripts directly into AgenaTrader
Now we need to link the files from our local GitHub workspace into the local AgenaTrader directories. In Linux this would be pretty easy using symbolic linking command, but also on Windows there is a solution for this! We can use mklink to work for us.
The stock trading scripts in AgenaScript language must be placed inside the following three AgenaTrader directories:
- indicator => ‘[… path to your AgenaTrader User directory …]\AgenaTrader\UserCode\Indicators\’
- condition => ‘[… path to your AgenaTrader User directory …]\AgenaTrader\UserCode\ScriptedConditions\’
- strategy => ‘[… path to your AgenaTrader User directory …]\AgenaTrader\UserCode\Strategies\’
The following examples will show you how to link files into AgenaTrader using mklink on command line:
[pastacode lang=”bash” manual=”mklink%20%2Fd%20%22C%3A%5CAgenaTrader%5CUserCode%5CIndicators%5Cgithub_indicator%22%20%22C%3A%5CGithub%5CAgenaTrader%5CIndicator%22%0Amklink%20%2Fd%20%22C%3A%5CAgenaTrader%5CUserCode%5CScriptedConditions%5Cgithub_condition%22%20%22C%3A%5CGithub%5CAgenaTrader%5CCondition%22%0Amklink%20%2Fd%20%22C%3A%5CAgenaTrader%5CUserCode%5CStrategies%5Cgithub_strategy%22%20%22C%3A%5CGithub%5CAgenaTrader%5CStrategy%22″ message=”” highlight=”” provider=”manual”/]
Many of our AgenaScript indicators do need our global utility class. Your need also to link this folder, into the AgenaTrader indicator directory:
[pastacode lang=”bash” manual=”mklink%20%2Fd%20%22C%3A%5CAgenaTrader%5CUserCode%5CIndicators%5Cgithub_utility%22%20%22C%3A%5CGithub%5CAgenaTrader%5CUtility%22″ message=”” highlight=”” provider=”manual”/]
Please pay attention you MUST run mklink in ADMINISTRATOR mode!