Jump to content
KyleK29

DAS Utility: Auto Export DAS Trading Logs, Updated: 11/24/2021, v1.0

Recommended Posts

Okay, I think I've got this in a decent enough state for an initial release, so here it goes, hopefully we don't break anything and if we do, I'm not responsible. Might not be the most elegant because it's using AHK's script syntax and I'm not that familiar with it ... in fact, I'm not fond of it.
 

What it is:

It's an AutoHotkey script that will detect if DasTrader.exe is running and then send a sequence of commands to export the Trade Logs (Orders, Tickets, Trades). This can be further automated using Windows Task Scheduler (instructions below). By default, the save-to folder is in your My Documents \ TradeLogs \ YYYY-MM-DD, but this can be changed by editing the top line of the script (see Config section below).

As a note, if DAS is not found to be running it will try to start and login before proceeding. It uses the machines local DATE, so be aware of that as your exports will save to a date relative to the local timezone.
 

Instructions for Configuration:

  • VIDEO Tutorial: This script was covered in the 11/22/2021 Monday Tech Class, which can be found here (when it goes up): https://bearbulltraders.com/course/technology-monday/lesson/kyles-tech-webinars-2/
  • For the script to run,  you'll need to download AutoHotkey from https://www.autohotkey.com 
    • Run the installer and choose "Express" install, unless you know what you're doing.
  • Download the relevant script file here: 
  • Unzip the download to a folder of your choosing, for simplicity sake, let's put it in a folder C:\scripts\   [you may need to create this]
  • Now if you have DAS Trader Pro installed to C:\DAS Trader Pro\ and you don't mind the default save directory of your My Documents\TradeLogs\, you don't need to configure anymore and you can jump to the automation portion.
  • IF you don't have DAS saved in C:\DAS Trader Pro\ or you want to change the save locations, right-click the DASExportTradeLogs.ahk file you unzipped and go to "Open With" -> "Notepad" (unless you have another txt editor of your choice, just don't use WordPad or MS Word).
    • On the top of the file, there are two variables "logoutput" and "dasfolder", you can edit the right-hand side to a value of your choice. By default, these are set to these values:
      ; Default Settings
      logoutput = %A_MyDocuments%\TradeLogs\
      dasfolder := % "C:\DAS Trader Pro\"
      
      ; Uncomment (remove semicolon) to make your own.
      ;logoutput := % "C:\Trade Logs\"
      ;dasfolder := % "C:\DAS Trader DEMO\"

      If you want to change these folders, uncomment the lower variables by removing the semicolon and edit between the parenthesis. Example edits below:

      ; Default Settings
      logoutput = %A_MyDocuments%\TradeLogs\
      dasfolder := % "C:\DAS Trader Pro\"
      
      ; Uncomment (remove semicolon) to make your own.
      logoutput := % "C:\MY TRADELOGS FOLDER\"
      dasfolder := % "D:\MY DAS INSTALL LOCATION\"

       

  • AUTOMATION:

    • To automate this script, you need to use Windows Task Schedule

    • Go to the Start Menu, type: Task Scheduler

    • Once it has launched, on the right hand pane under "Actions" click "Create Task"
      image.png.cd10c449e72e17cdd1e3e39ee3ba2849.png

    • In the dialog box that has popped up, the tab will be "General"

      • Name: Give it a friendly name you may remember, I chose "DASTradeLogsForLoveOfKittens"

      • Leave "Run only when user is logged on" selected

      • Switch to the "Triggers" tab

      • Example screenshot below:
        image.png.41f65302f3e4f08fb01ab4b1d68afe8c.png

    • In "Triggers", select "New..." button towards bottom.

      • Set: Begin the task to "On a schedule"

      • Set to "Weekly" and select Monday, Tuesday, Wednesday, Thursday, Friday

      • Under "Advanced Settings"

        • Check: Stop task if it runs longer than:  5 minutes  [type it in]

        • Check: Enabled

        • Hit OK

      • Example Screenshot below:
        image.png.edbc6389df25d4483d29dd3e2cbfc8c5.png

    • Select the "Actions" tab and hit "New..." alongside bottom.

      • In the "New Action" dialog:

        • Action: Start a program

        • Program/Script box, copy and paste the following:

          "C:\Program Files\AutoHotkey\AutoHotkey.exe"

           

        • In the "Add Arguments" box, type the location of our script and the name .. for this tutorial, we unzipped it to C:\scripts\DASExportTradeLogs.ahk
          image.png.55c471cc2755d29846afbc8c7dc9f654.png
           

        • Hit OK

    • Select the "Conditions" tab and set ..

      • Checkbox on "Start the task only if the computer is idle for:"

        • Set to your choice, 10 minutes is a good number.

      • Checkbox on "Wake the computer to run this task"

      • See screenshot below:
        image.png.7ff2c8ac65884734f9476387b4dde98b.png

    • Switch to the "Settings" tab

      • Leave checked "Allow to be run on demand"

      • Check: "Run task as soon as possible after a scheduled start is missed"

      • Check: "Stop the task if it runs longer than:" and set to 10 minutes

      • Leave the rest as is, see screenshot below:
        image.png.6e13496842bdfcd0b1ae43394db5f99b.png

    • Hit "OK" until you're out of the task creation screen. 

  • All done. You can test to make sure you got the parameters right by finding the task name you assigned it in the "Name" column, right-clicking, and choosing "Run". Hands off as it does it's thing.
    image.png.1e14a4eddbb8bfcc8118c54beedd04a6.png
     

  • For best results, run DAS Trader and navigate to the main menu -> Trade -> Reports, then set your settings to be like the following screenshot, as a note check "Show training orders/trades" if you want to include both SIM and LIVE account (unchecked is just LIVE account).
    686595350_Screenshot2021-11-24163830.png.bc92e5a351ce3f1a3c780d448cbe6375.png

 

I'm sure I forgot something ...

 

ChangeLog:

11/24/2021:

  • Initial Release
Edited by KyleK29
  • Thanks 1

---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.