My Auto-trading scripts

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
User avatar
Smoky
Posts: 401
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 66 times
Been thanked: 104 times

My Auto-trading scripts

Postby Smoky » 27 Jun 2018

we are some auto-trader here and i want to share my scripts and tools to make some automation.

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
this second script allow account validation (for each account / strategy ) infinite Loop for all charts / all workspaces

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
this script allow Quotemanager to restart when an error occur and run as an auto-skip button,
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
Today all scripts are running good but with no guarantee for the futur, if new version of MC change name of popup windows,
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

Return to “User Contributed Studies and Indicator Library”