[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Window linking in 2ki (sort of)



PureBytes Links

Trading Reference Links

Here's a small script written in AutoIt v3, found in 
http://www.hiddensoft.com/autoit3/ You would need to have this installed 
to run this script.

I use it to run through stock charts - I like to look at daily & weekly 
of all my charts in a symbol list. It's a pain to highlight both charts 
and advance both. Hence, this script. Save this script somewhere and run 
it(remember, autoit v3 should be installed). You would see a small icon 
in the task bar. Setup your charts, with all the charts looking at the 
same symbol list, set to look at the same symbol. One daily, one weekly, 
one whatever.....

Ctrl.	advances all charts
Ctrl,	goes back one chart

You need to setup the following two variables before you run it
$MaxWinInWSpace = 3
$NumChart = 2

Set the first to >= the number of windows in the workspace
Set the second to >= the number of chart windows in the workspace

Avoid pressing Ctrl x anytime. It would exit the script and your Ctrl. 
won't work anymore till you run the script again.

Hopefully it's of use to some of you.

Abhijit



; User Defines***************---------------------------
$TSWinCaption = "Omega Research ProSuite 2000i"
$TSChartCaption = "TradeStation Chart"
$MaxWinInWSpace = 3
$NumChart = 2
; User Defines***************---------------------------

HotKeySet("^x", "Terminate")
HotKeySet("^.", "NextC")
HotKeySet("^,", "PreviousC")

While 1
	Sleep(100)
WEnd

Func NextC()
	WinActivate ($TSWinCaption)
	$ChartToChange = $NumChart
	$LoopCnt = 0
	
	While($ChartToChange > 0 and $LoopCnt < $MaxWinInWSpace)
		$test = WInGetText($TSWinCaption)
		if(StringLeft($test, 18) == $TSChartCaption) then
			Send("^{SPACE}")
			$ChartToChange = $ChartToChange - 1
			Sleep(500)
			Send("^{TAB}")
		else
			Send("^{TAB}")
			Sleep(300)
		EndIf
		$LoopCnt = $LoopCnt + 1
	WEnd
EndFunc

Func PreviousC()
	WinActivate ($TSWinCaption)
	$ChartToChange = $NumChart
	$LoopCnt = 0
	
	While($ChartToChange > 0 and $LoopCnt < $MaxWinInWSpace)
		$test = WInGetText($TSWinCaption)
		if(StringLeft($test, 18) == $TSChartCaption) then
			Send("^+{SPACE}")
			$ChartToChange = $ChartToChange - 1
			Sleep(500)
			Send("^{TAB}")
		else
			Send("^{TAB}")
			Sleep(300)
		EndIf
		$LoopCnt = $LoopCnt + 1
	WEnd
EndFunc

Func Terminate()
    Exit 0
EndFunc