I use these tools,
1) Autohotkey to run script as an exe
https://www.autohotkey.com/download/
2) Greenshot freeware to take screenshot for MC support (if need)
http://getgreenshot.org/
this first script allow auto-trading (first MC popup Windows when auto-trading workspaces are loading)
Code: Select all
;#NoTrayIcon
DetectHiddenWindows, On
DetectHiddenText, On
SetTitleMatchMode, 1
While 1
{
; Allow autotrading first popup
IfWinExist, Do You want to enable Auto-Trading for next strategies:
{
Sleep 2
WinActivate, Do You want to enable Auto-Trading for next strategies:
;MsgBox, Windows trouvee
Send,{enter} ; Yes BUTTON default Button only Yes / No
Break
}
}
Exit
Code: Select all
;#NoTrayIcon
DetectHiddenWindows, On
DetectHiddenText, On
SetTitleMatchMode, 1
;comment start with ; this script allow autotrading without any user in front of screen
;great in full autotrading on VPS
While 1
{
IfWinExist, Warning
{
Sleep 5
WinActivate, Warning
;Popupwindows to confirm autotrading account on screen
;Sleep 5
;Send,{PrintScreen} ; make PrintScreen with Greenshot freeware for futur use
Sleep 5
Send,{enter} ; send Enter on Yes button (default button) only two buttons Yes / No
}
}
Exit
then Quotemanager start again and our stategy have quotes to run again. (You loose only few dataquotes)
Code: Select all
;#NoTrayIcon
DetectHiddenWindows, On
DetectHiddenText, On
SetTitleMatchMode, 1
While 1
{
IfWinExist, Application Error
{
Sleep 5
WinActivate, Application Error
;windows popup "Application Error"
Sleep 5
Send,{PrintScreen} ; screenshoot for MC support use
Sleep 5
Send,{tab} ; go to skip button with Tab Key
Sleep 5
Send,{enter} ; Keypress on Skip BUTTON to restart QM
}
}
Exit
;every time an error occur a screenshoot with name,date,heure
;will be archived by GreenShot freeware
add other popup, change defaut button or add button on popup, they will stop to work.
You can also make a big script to manage all since Server startup.
Next step will be to make another script to "Flush Cached Data to Database" (with MC 12)
after a trading day without closing QuoteManager and all will be ready for next trading day.
MC is ready to wait first tick of the next day to run again...
(Reboot Server only on week end LoL)
nota: Sleep value can change from Server to another Server with faster CPU
my new script to flush QM
Code: Select all
WinGet, active_id, ID, MultiCharts64 QuoteManager
WinActivate, ahk_id %active_id%
SendInput {Ctrl Down}{b Down}
Sleep 50
SendInput {b Up}{Ctrl Up}
Sleep 1000
WinMinimize, ahk_id %active_id%
Code: Select all
#Persistent
SetTimer, TimeCheck, 3600000 ; check every hour
return
TimeCheck:
If (A_Hour=23)
WinGet, active_id, ID, MultiCharts64 QuoteManager
WinActivate, ahk_id %active_id%
SendInput {Ctrl Down}{b Down}
Sleep 50
SendInput {b Up}{Ctrl Up}
Sleep 1000
WinMinimize, ahk_id %active_id%
return