Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 17:27:21 +0000



[User Discussion] - AutoHotkey Chart select

View Count: 27531

[2020-06-29 06:46:22]
like2trade - Posts: 112
I am trying to select/highlight a chart in a chartbook using AutoHotkey as part of a longer script. Without AutoHotkey, this would be done by left clicking on the chart. Does anyone know how to do this with AutoHotkey? Any help is much appreciated.
[2020-06-30 13:33:32]
like2trade - Posts: 112
bump
[2020-06-30 15:06:03]
JohnR - User831573 - Posts: 300
I am not a pro AHK user, but I have a few things working for SierraChart.

1 - if your chart window is always in the same place, in your script, move the cursur to position x,y and then execute click left

or 2 - if you load your charts in the same sequence all the time, you can use the Window Spy capability to find the location of the window in the taskbar if they are detached windows and then send a click command. (I have 7 detached chart windows that I have a AHK script that brings them all to the foreground in a specific sequence. Then after that I move the cursor to a location on the desired window click to activate that window and then simulate a Ctrl-End to scroll the chart to the end of chart and have all other windows synch to the end of charts as well using global cursor.

option 3 - within SC Menu -> Window -> select "GoTo Chart Number" then Send chart # and Enter keys.

Hope that helps.

JohnR
Date Time Of Last Edit: 2020-06-30 17:52:43
[2020-06-30 19:33:03]
like2trade - Posts: 112
Hi JohnR,

Thank you very much for the suggestions. I have managed to figure out the code for option 3. Do you by any chance have any sample code that navigates the menus, and fills in different input fields on dialogue boxes?

Thanks.
[2020-07-01 01:35:22]
JohnR - User831573 - Posts: 300
I do not have any code, but I would think it would be like this - remember ALT key = ! I prefer to put Sleep statements to slow things down. you can adjust as you wish or need. Also, ALT+first letter of menu is usually how to get started, then after that it is usually the first letter again, or you could use/send the down key 'x' number of times to get to the correct one.


Pick your key combo to run this part of the script

Send !w
Sleep 300
Send g
Sleep 300
below line you need to put in the chart window # you want it to go to.

Send your window # here Example - Send 4 {Enter}
Date Time Of Last Edit: 2020-07-01 01:38:09
[2020-07-01 23:39:45]
like2trade - Posts: 112
Thank you very much JohnR.
[2020-07-02 01:35:23]
JohnR - User831573 - Posts: 300
Here is a link to another thread around using AHK. They directed me to AHK WinExist and WinActivate. Pretty slick and very fast.

Solved within AHK--> was Enhance 'Goto Chart Number' within the 'Windows' on SC main menu
Solved within AHK--> was Enhance 'Goto Chart Number' within the 'Windows' on SC main menu

JohnR
[2020-07-02 12:16:24]
like2trade - Posts: 112
Thanks JohnR.

I also found a very helpful free program called Pulover's Macro Creator that enables one to record and create AHK macro's. Here is the website:
https://www.macrocreator.com/

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account