HotKey to Start / Stop Indicator: Vote for my request

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

HotKey to Start / Stop Indicator: Vote for my request

Postby arjfca » 14 Oct 2012

Hello

I did post a request to MC for new coding option that would allow to start / Stop an indicator directly from the keyboard hotkey combination instead of a menu driven like it is actually

My idea is to have the possibility to code a key combination that will set "on" or "Off" an indicator

Actually, we need to right click on a chart, Select Format Indicator, Select the appropriate one then set the Status.

Lets have all these done using the keyboard only

To vote, follow this link; https://www.multicharts.com/pm/viewissu ... no=MC-1136

Martin

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby bowlesj3 » 14 Oct 2012

I use to use a macro in my database program to turn an indicator on and off. it sent key strokes to do all the keys. You could do this in MacroExpress and it gives you a list of all the available key combinations (analysing all programs and what they have already used). I think it is better to go this way since once you learn ME (not hard to do actually) you can set up all sorts of shortcut keys for all your programs and their functions. I stopped using the function to turn off the indicator once I realized that the recalculate command existed which could replot the bollinger bands after I changed the settings via GV inputs rather than the standard inputs. With Macro express you can turn on any indicator on any chart or any combination of them as you wish (not to mention you can automate all sorts of other functions such as setting bar spacing etc). I figure you would get what you want a lot faster by learning ME instead of waiting for the MC staff to program this which may be never. The problem is most traders want their indicators left on so I figure the idea will not fly. The only negative is if you add a new indicator in and it shoves the one you want to turn off and on down the list of indicators on the chart. The solution is easy. You just put a coding structure on the front of the name to move the new ones lower down so they are at the bottom and this saves you having to change your macro. To create the macro is fast if you use the "record keystrokes" process. All you have to do is put in delay statements where ever there is a command that opens a window in MC (just after the open command because it takes Windows a while to do this). Setting the amount of delay is the hardest part but you can set a variable in MacroExpress to pick up the value and use it in all the delay statements if you have more than one of them. I think you could have an input box ask for the value and once you get it set correctly you just hard code it. I have been meaning to set up a ME thread in the FAQs area but I have been distracted a lot lately. I figure it would be very good for MC if such a thread existed. It is almost something the MS-Staff could set up and they could include the ME macros and give tips on how to adjust them.

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby arjfca » 14 Oct 2012

I use to use a macro in my database program to turn an indicator on and off. it sent key strokes to do all the keys. You could do this in MacroExpress and it gives you a list of all the available key combinations (analysing all programs and what they have already used). I think it is better to go this way since once you learn ME (not hard to do actually) you can set up all sorts of shortcut keys for all your programs and their functions. I stopped using the function to turn off the indicator once I realized that the recalculate command existed which could replot the bollinger bands after I changed the settings via GV inputs rather than the standard inputs. With Macro express you can turn on any indicator on any chart or any combination of them as you wish (not to mention you can automate all sorts of other functions such as setting bar spacing etc). I figure you would get what you want a lot faster by learning ME instead of waiting for the MC staff to program this which may be never. The problem is most traders want their indicators left on so I figure the idea will not fly. The only negative is if you add a new indicator in and it shoves the one you want to turn off and on down the list of indicators on the chart. The solution is easy. You just put a coding structure on the front of the name to move the new ones lower down so they are at the bottom and this saves you having to change your macro. To create the macro is fast if you use the "record keystrokes" process. All you have to do is put in delay statements where ever there is a command that opens a window in MC (just after the open command because it takes Windows a while to do this). Setting the amount of delay is the hardest part but you can set a variable in MacroExpress to pick up the value and use it in all the delay statements if you have more than one of them. I think you could have an input box ask for the value and once you get it set correctly you just hard code it. I have been meaning to set up a ME thread in the FAQs area but I have been distracted a lot lately. I figure it would be very good for MC if such a thread existed. It is almost something the MS-Staff could set up and they could include the ME macros and give tips on how to adjust them.
Good morning John

I understand the it could be done via Macro Express or AutoHotKey ( I have used it before) but my idea is to be able to see via the keyboard on the fly an indicator like a daily / Monthly Pivot

- Where is the price in relation to a Monthly pivot. I don't need to have it on the screen all the time, but only a fraction of second to determine a point of view

- Once there,,,,, Once out of the screen and go for another indicator on your list

Also, these key sequence could be coded in special keyboard like a "Enterpad" from Cedeq Industries. Wow, I'm day dreaming....

Martin :)

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby bowlesj3 » 14 Oct 2012

Hi Martin,

For that idea, if you want to show something that is large to be visible for a short period of time then have it hidden when not in use you could consider modifying the script below which would only show a text box all the other time. Once you get it modified, to bring your indicator into sight just highlight the text box and when you remove the text box highlight the indicator gets hidden from sight. This idea is for anyone not using an external program to control things as I am doing. In my case I would click a button on my external program and it would set a GV which would be used to signal to move the item into view.

Base Logic for Interactive Text Script: Likely of use to all
viewtopic.php?f=5&t=7764

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby arjfca » 03 Nov 2012

John, I did implement your idea global variable to control an indicator

I had a problem with a function that send data to Excel. When the same indicators with the same function was use in multiple workspaces under the same instance, I had an error and the indicator did stop

I had a condition to look for a global variable

- Excel set a global string variable with a scale value like ( "1 Hour", "15 Minutes" etc)

- Indicator, read global variable and compare it with it actual scale. If match, then the function to talk with Excel is enable

Thanks for the hint

Martin

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby bowlesj3 » 04 Nov 2012

Hi Martin,

Yes, I have some GVs and studies that are used in all charts and I check the bar sizes to know which chart the study is running on so I can limit some of the code to one chart only. I only use one work-space however at present. I was using 2 work-spaces but the 2nd work-space was for a different futures symbol so I would use the GetSymbol command so the EL code would know. I am not sure if there is a way for the EL code to know what the work-space is. However that would be a good feature for sure. I never had the need for such a command so I never went looking for a solution.

John

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby arjfca » 04 Nov 2012

John, to determine witch worspace is in use I did:

- Read the barinterval
- Send the Numeric Value to a function that return a string
- Compare this string with String value stored in GV ( from Excel)

Martin

Code: Select all

ScaleValue = ScaleValue_Calc(Barinterval);
scale = scaleString; //ScaleString... afunction that return a string value of the BarInterval used
StringValue Code

Code: Select all

Var:
Scale("");

Scale = NumtoStr(Barinterval,0) + spaces(1);

Switch (bartype_ex) begin
Case = 1:
Scale = Scale + "Ticks";
Case = 2:
Scale = Scale +"Minutes";
Case = 3:
Scale = Scale + "Hours";
Case = 4:
Scale = Scale + "Days";
Case = 5:
Scale = Scale + "Weeks";
Case = 6:
Scale = Scale + "Months";
Case = 7:
Scale = Scale + "Years";
Case = 8:
Scale = Scale + "Volume";
Case = 9:
Scale = Scale + "Seconds";
Case = 10:
Scale = Scale + "Quarters";
Case = 11:
Scale = Scale + "Points";
Case = 12:
Scale = Scale + "Change";
Case = 13:
Scale = Scale + "Points";
default:
scale = scale + "Scale";
end; //Switch (bartype_ex) begin
ScaleString= scale;

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby bowlesj3 » 04 Nov 2012

Yes, but that is because each of your work-spaces has something unique about it so you have a way of knowing. In my case my two work-spaces can only be told apart by the fact that the symbol is different. I think having a command to know the actual name would be a good idea. Maybe it is there already and I just have not gone looking for it. I am curious.

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby arjfca » 04 Nov 2012

John, here is the command:

Code: Select all

NameInstrument = GetSymbolName; //Getsymbole name is the code to use to get the instrument in use
Actually, I send the symbol name to Excel. With my sheet,I display data for either Eur.Usd or Gbp.Usd. I use it as a verification. So in your case, the validation could be the market name.

I trade out of a click one market or the other. One string sent data for both market. Excel separate them

Martin

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

Re: HotKey to Start / Stop Indicator: Vote for my request

Postby bowlesj3 » 04 Nov 2012

Yes, it has been a while since I created my code below.
Actually over 5 years since I put this in.
My memory is only good for 4 years - LOL. Cheap Walmart memory :-)
I just cut and paste it in if I need it again.
I gather cut and paste memory is infinite :-)
Must be! It still works.

Code: Select all

MySym = leftstr(getsymbolname,2);
if MySym = "ES" then
begin
SmallestUnit = .25;
Multiplier = 50;
end
else
begin {SFX futures}
SmallestUnit = .10;
Multiplier = 200;
end;
I am not doing much programming these days since my system is basically done and I am focusing on increasing my trading output. I have loosened my rules a bit to try to increase trades. After 4 to 5 years of programming I figure a break is in order too. My programming to-do list of speed-ups and clean-ups is a bit lonely at the moment. Some day I may try to finish off the list but at the moment I am happy to just ignore it.


Return to “MultiCharts”