Macros with Macro Express / Auto Hot Key driving MC

Questions about MultiCharts and user contributed studies.
mefTrader
Posts: 141
Joined: 23 Jun 2011
Has thanked: 9 times
Been thanked: 7 times

Macros with Macro Express / Auto Hot Key driving MC

Postby mefTrader » 23 Oct 2012

Folks,

Looking for some feedback from those in the community that have used either Macro Express or Auto Hot Key to drive MC?

I am looking to do an auto reload of my workspaces at a certain time of the day i.e

use ".rld glob" @ time = X at a certain time of the day....

Does anyone have a Macro that does this/similar to this?

Thanks

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Macros with Macro Express / Auto Hot Key driving MC

Postby arjfca » 24 Oct 2012

Folks,

Looking for some feedback from those in the community that have used either Macro Express or Auto Hot Key to drive MC?

I am looking to do an auto reload of my workspaces at a certain time of the day i.e

use ".rld glob" @ time = X at a certain time of the day....

Does anyone have a Macro that does this/similar to this?

Thanks
Any reason to reload your workspace?

Look on AutoHotKey forum. It was a great help when i had created some script few years ago

From memory here is the step
You will need to define a timer in HotoHotKey
You will need to find the handle
Once timer as hit the target, you will issus ^CTRL r to reload the chart
Reload the timer

Once your code is working, you will create a EXE by compiling it
Load your EXE file after having loaded MC

A friend of mine as developed a keyboard for autohotkey. You may ask him a question
Google cedeq . com. He is more expert than me. His name, Denis

Can't really help more than that

Good luck

Martin

mefTrader
Posts: 141
Joined: 23 Jun 2011
Has thanked: 9 times
Been thanked: 7 times

Re: Macros with Macro Express / Auto Hot Key driving MC

Postby mefTrader » 24 Oct 2012

Reloading of the workspace because sometimes I am getting the bars closing and an alert is not being generated when the bar closes - it is a data feed issue with IQ

I have to use ".rld glob" because I have a lot of workspaces...

mefTrader
Posts: 141
Joined: 23 Jun 2011
Has thanked: 9 times
Been thanked: 7 times

Re: Macros with Macro Express / Auto Hot Key driving MC

Postby mefTrader » 24 Oct 2012

I figure out how to use the timers and such but at the moment trying to figure out how to reliably enter ".rld glob" in the command line...

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Macros with Macro Express / Auto Hot Key driving MC

Postby arjfca » 24 Oct 2012

I figure out how to use the timers and such but at the moment trying to figure out how to reliably enter ".rld glob" in the command line...
Did you chat with MC technical support about your "not triggerd" alarm?

AutoHotKey solution idea

Solution 1
simulate your click using mouse movement in AutoHotKey. It work,as long as you don't move your workspaces

Solution 2
Other way is in AutoHotKey
- Look in the page for "view" in the title bar
- Simulate a click
- Look for "reload" in the sub menu
- Simulate a click

Solution3... easier to do
- Code autoHotkey to find and select your workspace handle
- Send "^CTRL R "from autohotkey // CTRL R is the hotkey to reload a chart

Not tried nor tested, just using my memory of the possible step to do.

Martin

mefTrader
Posts: 141
Joined: 23 Jun 2011
Has thanked: 9 times
Been thanked: 7 times

Re: Macros with Macro Express / Auto Hot Key driving MC

Postby mefTrader » 24 Oct 2012

This is what I have so far

- Setup the timer to check time every minute (60000)
- Open Command Shell and do some commands there for example, quit command shell
- Select the MultiCharts screen I want
- Maximize it
- Click in the area of the Command Line <- This is not really robust and would like to send a
keyboard shortcut if possible
- enter ".rld glob"
- Select another MultiCharts window and do the same there
- Run command shell again and execute some commands , quit command shell

** - It seems to work but would really like a keyboard shortcut to select the command line to enter ".rld glob" . If I could do that then I would be happy with it

Code: Select all

#Persistent
SetTimer, CheckTime, 60000 ;check time every minute
Return

CheckTime:
if ((A_Hour=14 && A_Min=50) || (A_Hour=17 && A_Min=05) || (A_Hour=17 && A_Min=39))
{
trayTip,, % "Current Minute: " a_min
trayTip,, Script Started!


; Place action here!

;WinMinimizeAll
WinWait, Start,
Run, cmd
Sleep, 100
WinActivate ahk_class ConsoleWindowClass ; cmd window
; Email Server off
Send, dir {Enter}
Send, <send some commmand shell commands here >{Enter}
Sleep, 100
WinKill ahk_class ConsoleWindowClass ;

trayTip,, Email server off
WinWait, MultiCharts - NG_STFA_v2 - [QNG# - 1 Day - IQFeed],
IfWinNotActive, MultiCharts - NG_STFA_v2 - [QNG# - 1 Day - IQFeed], , WinActivate, MultiCharts - NG_STFA_v2 - [QNG# - 1 Day - IQFeed],
WinWaitActive, MultiCharts - NG_STFA_v2 - [QNG# - 1 Day - IQFeed],
MouseClick, left, 99, 14
Sleep, 100
MouseClick, left, 729, 11
Sleep, 100
MouseClick, left, 626, 864
Sleep, 100
Send, .rld{SPACE}glob{ENTER}
MouseClick, left, 1383, 19
Sleep, 10000
trayTip,, That's 1
WinWait, MultiCharts - WHEAT_STFA_v2 - [@W# - 1 Day - IQFeed],
IfWinNotActive, MultiCharts - WHEAT_STFA_v2 - [@W# - 1 Day - IQFeed], , WinActivate, MultiCharts - WHEAT_STFA_v2 - [@W# - 1 Day - IQFeed],
WinWaitActive, MultiCharts - WHEAT_STFA_v2 - [@W# - 1 Day - IQFeed],
MouseClick, left, 1042, 13
Sleep, 100
MouseClick, left, 650, 870
Sleep, 100
Send, .rld{SPACE}glob{ENTER}
MouseClick, left, 1389, 23
Sleep, 10000
trayTip,, That's 2


WinWait, Start,
Run cmd
Sleep, 100
WinActivate ahk_class ConsoleWindowClass ; cmd window
WinWait, ahk_class ConsoleWindowClass , , 10
; Email Server on
Send, dir {Enter}
Send,<send some commmand shell commands here > {Enter}
Sleep, 100
Send, {Enter}
Sleep, 100
Send, <send some commmand shell commands here > {Enter}

WinKill ahk_class ConsoleWindowClass ;

trayTip,, Email server back on!
}
return




Return to “MultiCharts”