Hello,
I'd like to update a variety of my studies to use MouseClickBarNumber to get the starting bar to use for calculations etc.
Is there a way to use this once (or maybe x2 to get startbar endbar) in a study and then turn off processing mouse events for that study?
I'd like to use MouseClickBarNumber with more than one study in a chart to define starting points.
[ProcessMouseEvents = false] appears to be an interpreter directive that disables all mouse input. I guess I'll have to use a flag.
I also presume there is a way to make these 'inputs' persistent without writing files? It might be a nice feature to be able to update an Input: StartBar (1); With a variable under indicator control (got with a mouse click for example).
Thanks.
MouseClickBarNumber
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: MouseClickBarNumber
Mouse events cannot be turned off conditionally; there are either always on or always off. What you can do if you want to use a 'click that registers the start bar' and 'click that registers the end bar' is to use keyboard keys.I'd like to update a variety of my studies to use MouseClickBarNumber to get the starting bar to use for calculations etc.
Is there a way to use this once (or maybe x2 to get startbar endbar) in a study and then turn off processing mouse events for that study?
For instance, a Control + click marks that bar as the begin bar, and a Shift + click a end bar. More on combining clicks and keys is here: combine mouse clicks and keyboard keys.
You can use the IntrabarPersist keyword to make variables retain any values that are assigned to them during intra-bar calculations. In other words, with `IntrabarPersist` a variable will always keep the value that's stored in it when a mouse click happen.I also presume there is a way to make these 'inputs' persistent without writing files? It might be a nice feature to be able to update an Input: StartBar (1); With a variable under indicator control (got with a mouse click for example).
Or do you mean persistent over files with your 'inputs' description? That's unfortunately not possible.
Re: MouseClickBarNumber
Thanks Josh but I don't think that will do what I require.
I am already using shift clicks etc. However the problem is if I have several studies (or multiple instances of the same study) on the same chart. If I shift click it will change all the start points of all I think? Whereas I want (for example) one instance of the study starting on say bar 12 the next one on bar 21 and the final one on bar 50.
As for persistence I should have been clearer I mean persistence between invocation of various studies or even instances of multicharts. For example if I set the start bar for a study from a swing high and have another copy starting from a swing low I'd like those remembered the next time I open that chart. Much like you can change an input parameter on a study and check the 'save as default' check box.
I think the long and the short of it is MC is not really designed for interactive input due to its TS heritage.
I guess I'll leave the studies having start year, month, day, time, inputs though its pretty clunky.
Thanks again for the suggestion, I'm always open to other ideas
I am already using shift clicks etc. However the problem is if I have several studies (or multiple instances of the same study) on the same chart. If I shift click it will change all the start points of all I think? Whereas I want (for example) one instance of the study starting on say bar 12 the next one on bar 21 and the final one on bar 50.
As for persistence I should have been clearer I mean persistence between invocation of various studies or even instances of multicharts. For example if I set the start bar for a study from a swing high and have another copy starting from a swing low I'd like those remembered the next time I open that chart. Much like you can change an input parameter on a study and check the 'save as default' check box.
I think the long and the short of it is MC is not really designed for interactive input due to its TS heritage.
I guess I'll leave the studies having start year, month, day, time, inputs though its pretty clunky.
Thanks again for the suggestion, I'm always open to other ideas
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: MouseClickBarNumber
This is not possible, unfortunately, since there isn't a keyword that can tells us which script triggered the calculation after the mouse click.I am already using shift clicks etc. However the problem is if I have several studies (or multiple instances of the same study) on the same chart. If I shift click it will change all the start points of all I think? Whereas I want (for example) one instance of the study starting on say bar 12 the next one on bar 21 and the final one on bar 50.
What you could also do, but this is a very rough workaround, is to have each script make two specifically coloured arrows. Then you can drag the red arrows to signal the first and last bar for script A, while blue arrows highlight the bars for script B. The script can then retrieve the arrow location and compute with it.
That's unfortunately not possible; not even the 'save as default' checkbox works that nice. MultiCharts is indeed quite focused on 'independent sessions', much like other windows applications.As for persistence I should have been clearer I mean persistence between invocation of various studies or even instances of multicharts. For example if I set the start bar for a study from a swing high and have another copy starting from a swing low I'd like those remembered the next time I open that chart. Much like you can change an input parameter on a study and check the 'save as default' check box.
(If you use arrows or other drawings with the rough workaround mentioned above, then those do keep their location on the chart when MultiCharts closes.)
Re: MouseClickBarNumber
Hello Nick,
-To draw on the chart a text box to be used as a switch-flag to turn on-off.
-You click on text button to turn on the flag.
-Then you make your shift+mouse clicks for starting and ending points.
-Then you reclick on text button to turn off the flag.
to achieve this result you could use this workaround:Is there a way to use this once (or maybe x2 to get startbar endbar) in a study and then turn off processing mouse events for that study?
-To draw on the chart a text box to be used as a switch-flag to turn on-off.
-You click on text button to turn on the flag.
-Then you make your shift+mouse clicks for starting and ending points.
-Then you reclick on text button to turn off the flag.
this means you need to draw a text box for each study, so if you click on box 1 you change start and ending point of study 1, and so on ...However the problem is if I have several studies (or multiple instances of the same study) on the same chart. If I shift click it will change all the start points of all I think? Whereas I want (for example) one instance of the study starting on say bar 12 the next one on bar 21 and the final one on bar 50.
Re: MouseClickBarNumber
Thanks for these cunning suggestions! Perhaps more elegant than what I was thinking
My idea was to have a separate study whose sole purpose is to get a bar number. The study could be turned off simply without effecting anything else.
The clunky bit would be that the bar number would have to be manually entered into the 'actual' indicator as an input:. The big advantage of this method would be that the value of the input: can be saved as a default so will be used even after a MC restart.
This begs the question of the best way of displaying the bar number. Simple text on the chart though I was thinking expert commentary might be better.
Thanks again for the suggestions.
My idea was to have a separate study whose sole purpose is to get a bar number. The study could be turned off simply without effecting anything else.
The clunky bit would be that the bar number would have to be manually entered into the 'actual' indicator as an input:. The big advantage of this method would be that the value of the input: can be saved as a default so will be used even after a MC restart.
This begs the question of the best way of displaying the bar number. Simple text on the chart though I was thinking expert commentary might be better.
Thanks again for the suggestions.