Command line: Time scale interpreted as a New instrument

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Command line: Time scale interpreted as a New instrument

Postby arjfca » 16 Dec 2014

Hello

Intermittent problem:

Once in a while, the typed scale in the command line is interpreted as a new instruments. When this occur, MC will look for a new instrument like "1 Min" instead to modify the scale for Eur.Usd to 1 minute

The typed text is done in the command line box via AutoHotKey ex:
"ALT F4" will type "4 Hours"
"Win F4" will type "5 min"

and it is OK for let say 95% of the time.

Is there something to be done to ensure that there is no mistake between a time scale string and an instrument string

Martin

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Command line: Time scale interpreted as a New instrument

Postby Henry MultiСharts » 16 Dec 2014

Hello Martin,

Does it work ok with manual input (without using AutoHotKey) 100% of the time?

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

Re: Command line: Time scale interpreted as a New instrument

Postby arjfca » 16 Dec 2014

Hello Martin,

Does it work ok with manual input (without using AutoHotKey) 100% of the time?
I do not use it as much by typing manually directly in the box

Since the problem is occurring one or twice in a day and I do use a lot my 20 hotkeys to play with the scale so difficult to say more

Autohotkey code

I added a 100 ms sleep delay after the enter command. Will see if it help

Code: Select all

#SingleInstance ignore



#F1::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 1 minute {Enter}
sleep, 100
}
return



#F2::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 2 minute {Enter}
sleep, 100
}
return


#F3::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 3 minute {Enter}
sleep, 100
}
return


#F4::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 5 minute {Enter}
sleep, 100
}
return


#F5::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 6 minute {Enter}
sleep, 100
}
return


#F6::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 10 minute {Enter}
sleep, 100
}
return

#F7::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 12 minute {Enter}
sleep, 100
}
return


#F8::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 15 minute {Enter}
sleep, 100
}
return


#F9::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 20 minute {Enter}
sleep, 100
}
return



#F10::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
send 30 minute {Enter}
sleep, 100
}
return


!F1::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 1 Hour {Enter}
sleep, 100
}
return



!F2::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 2 Hour {Enter}
sleep, 100
}
return



!F3::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 3 Hour {Enter}
sleep, 100
}
return


!F4::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 4 Hour {Enter}
sleep, 100
}
return


!F5::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 6 Hour {Enter}
sleep, 100
}
return



!F8::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 8 Hour {Enter}
sleep, 100
}
return


!F9::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 1 day {Enter}
sleep, 100
}
return



!F10::
If WinActive("ahk_class ATL_MCMDIMainFrame")
{
ControlClick, Edit5 ; Click on Scale box
sleep, 100
Send 1 Week {Enter}
sleep, 100
}
return

F11::
FormatTime, xx,, dddd dd MMMMM yyyy ; This is one type of the date format
SendInput, %xx%
sleep, 100
return


F12::
FormatTime, xx,, dddd dd MMMMM yyyy ; This is one type of the date format
FormatTime, zz,, hh:mm:ss tt ; This is one type of the time format
SendInput, %xx% %ZZ%{Enter}
sleep, 100
return

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Command line: Time scale interpreted as a New instrument

Postby Henry MultiСharts » 18 Dec 2014

Martin, we were unable to replicate this behavior on our end. What we can tell is that command line was designed for manual input, not automated. There are multiple factors that should be taken into attention. That is possible that the window will not have enough time to become active. Therefore we recommend increasing the sleeps and adding sleep before hitting Enter.

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

Re: Command line: Time scale interpreted as a New instrument

Postby arjfca » 18 Dec 2014

Martin, we were unable to replicate this behavior on our end. What we can tell is that command line was designed for manual input, not automated. There are multiple factors that should be taken into attention. That is possible that the window will not have enough time to become active. Therefore we recommend increasing the sleeps and adding sleep before hitting Enter.
Hello Henry

All the best for this Holiday season

I had added a 100 ms after the carriage return. So far, I have not seen the problem

Martin


Return to “MultiCharts”