Backing Up Source With AutoIt

I have never liked how TradeStation bundles all of “our” source code in a library.  I have always copied my source code into a notepad text file as a back up.  Not only does this back up your source you can actually look at it without launching the EL editor.  The only drawback is having to copy to notepad and then save it.  I recently came across a very powerful window’s automation software called AutoIt.  With this FREE software you can automate a ton of mundane daily tasks.  I have created a script that runs in the background and when you compose a new Analysis Technique and hit the F7 function key it will copy the contents of the current window to a notepad text file and then all  you do is save it.  With this script you should never say I wished I had back up my source outside of the TradeStation realm.

Goto http://www.autoitscript.com and download the program.  Here is the code for the macro/script:



#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <StringConstants.au3>

 

HotKeySet("{F7}", "copyELD")
HotKeySet("{F8}", "terminate")

 

Func copyELD()
$window_title = WinGetTitle("[active]")
WinActivate($window_title)
Send("{CTRLDOWN}a{CTRLUP}{CTRLDOWN}c{CTRLUP}{down}")
$variable_fromclipboard = ClipGet()
Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("//")
Send($window_title)
; Send($variable_fromclipboard)
Send("{CTRLDOWN}v{CTRLUP}{down}")
MsgBox(0, "The text was pasted ok", "Yep can see it")

Local Const $sMessage = "Choose a filename."
; Local $sFileSaveDialog = FileSaveDialog($sMessage, "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "ELD Text (*.txt)", $FD_PATHMUSTEXIST)
; MsgBox($MB_SYSTEMMODAL, "", "You saved the following file:" & @CRLF & $sFileSaveDialog)
Send("{CTRLDOWN}s{CTRLUP}{down}")
Send("{CTRLDOWN}x{CTRLUP}{down}")
endFunc
Func terminate()
Exit
endFunc
While 1
Sleep(10)
Wend 

Welles Wilder’s smoothing = XAVG(PeriodLen*2-1)

I was referred to a very excellent blog http://etfhq.com/ and wanted to confirm that Welles Wilder’s trick (ease of calculating) smoothing algorithm was indeed equivalent to an exponential moving average but twice the length – 1.  This blog by Derry Brown is worth taking a look at.

Here is my TS code for verify the length difference between WellesSmooth and Exp. Smooth:

{Test for equivelance}

if currentBar = 1 then
begin
value1 = average(c,14);
end;

if currentBar > 1 then
begin
value1 = (13*value1+c)/14; //Wells Wilder Smoothing
end;

plot1(value1,"WSMA",red);
plot2(xaverage(c,14),"XMA",blue);
plot3(xaverage(c,27),"2X-1XMA",green);