Opening workspaces from outside MC.  [SOLVED]

Questions about MultiCharts and user contributed studies.
bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Opening workspaces from outside MC.

Postby bowlesj3 » 22 Jun 2017

Hi,

I am going to be opening another Interactive Brokers account as I had before but instead of trading only the E-mini I will be trading stocks which requires I have several workspaces open at one time. I have one question.

I have a workaround if this can't be done but I thought I would ask anyway. Is there any way to click on a workspace file from windows 7 such that (if MC is already running with another workspace open) the current running MC simply opens a new workspace rather than starting another MC session in windows?

Thanks,
John

P.S. If you are curious as to why I want to do this here is the reason.
All my stocks will be in an MS-Access database program. My trading system is far to complex to be fully automated so I do a visual review of the charts. There is a calendar built in to the MS-Access program so I can post date the next visual review of a stock (potentially up to 1 month away). So when it is time to take a look at the chart again the I will initiate the opening of the workspace for this stock in MS-Access using a command that goes to the windows directory where the workspaces are to get the path (see VBA code below).

Code: Select all

Dim strSymDesc As String
strSymDesc = Replace(Me.fldCF_Subject, " ", "_")
Dim MyAppID, ReturnValue
MyAppID = Shell("C:\Program Files (x86)\TS Support\MultiCharts\MultiCharts.exe " & "C:\Access\Workspaces\FreeQuotes_" & Me.fldCF_Symbol & "_" & strSymDesc & ".wsp", vbMaximizedFocus)


Thanks,
John

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: Opening workspaces from outside MC.  [SOLVED]

Postby Angelina MultiСharts » 23 Jun 2017

Hello bowlesj3,

I can't think of a way to do it. Maybe other users can offer a solution.

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: Opening workspaces from outside MC.

Postby bowlesj3 » 23 Jun 2017

Thanks Angelina. I will go ahead with my workaround. It is pretty easy. John

Jad
Posts: 92
Joined: 15 Jun 2014
Has thanked: 13 times
Been thanked: 21 times

Re: Opening workspaces from outside MC.

Postby Jad » 23 Jun 2017

If you're always going to drive this from within MS Access then it should be possible to use 'IsAppRunning' to first check if Multicharts is running.

If it isn't, then proceed with the 'Shell' cmd that you currently use.

If it is running, then a rough outline of the steps needed in VBA (or macro) is:

1. Use the 'PutInClipboard' command to store the desired Workspace into the clipboard. Note: The path will probably have to be the MC default location for Workspaces.
2. Use 'AppActivate' to move focus to Multicharts.
3. Use 'SendKeys' and send "^O" to Open a Workspace.
WAIT
4. Use SendKeys to send "^V~" which pastes the contents of the clipboard saved in step 1 and submits [ENTER]

I haven't tried it and it might need some tweaking but you get the idea.
Last edited by Jad on 23 Jun 2017, edited 1 time in total.

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: Opening workspaces from outside MC.

Postby bowlesj3 » 23 Jun 2017

Hi Jad,

thanks for the IsAppRunning tip. I hadn't thought of that. The rest I have done many times with MC in the past. It works fairly well if you pause between the send keys in the proper locations and get the amount of pause correct.

John


Return to “MultiCharts”