Running, Stopping an indicator using a mouseclickevent

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Running, Stopping an indicator using a mouseclickevent

Postby arjfca » 11 Oct 2012

Hello

By any chance, is there a way to have an indicator be run or stopped using only a mouse click.

That would be great. Actually, I need to right click, select indicator, select the appropriate one, set the status on / off.

Once in a while, I need to reset an indicator because this one is used in communication with Excel.

Martin

User avatar
ABC
Posts: 631
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 356 times
Contact:

Re: Running, Stopping an indicator using a mouseclickevent

Postby ABC » 11 Oct 2012

Hello

By any chance, is there a way to have an indicator be run or stopped using only a mouse click.

That would be great. Actually, I need to right click, select indicator, select the appropriate one, set the status on / off.

Once in a while, I need to reset an indicator because this one is used in communication with Excel.

Martin
Martin,
I guess that this is possible using a mouse click event that triggers a recalculate command inside your code.
I haven't done that though, but I have triggered the calculation of an indicator based on clicks, so a recalculate should be possible, too.

Regards,
ABC

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 22 times

Re: Running, Stopping an indicator using a mouseclickevent

Postby Katrin Yanenko » 16 Oct 2012

Hi Martin,

You can make your script be recalculated by analyzing the location of a drawing on a chart.
Such keywords as #return http://www.multicharts.com/trading-soft ... php/Return and recalculate http://www.multicharts.com/trading-soft ... ecalculate can help you to achieve this task.
So if you make a condition with the drawing location and when you change it by dragging the drawing on a chart then the study will be recalculated.

Best Regards,
Katrin Yanenko

User avatar
Henry MultiСharts
Posts: 9121
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2927 times

Re: Running, Stopping an indicator using a mouseclickevent

Postby Henry MultiСharts » 29 Oct 2012

arjfca, I have sent you the fix for testing via email.

arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Re: Running, Stopping an indicator using a mouseclickevent

Postby arjfca » 30 Oct 2012

arjfca, I have sent you the fix for testing via email.
Henry,
I did installed your newer version, but problem still there + create another dll problem.

I will sent info to your email

Martin

User avatar
Henry MultiСharts
Posts: 9121
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2927 times

Re: Running, Stopping an indicator using a mouseclickevent

Postby Henry MultiСharts » 01 Nov 2012

In your code you are referencing historical values of the variables. When you click on historical bars (away from the recent data), MultiCharts recalculates the study trying to adjust the max bars back. This causes multiple output lines.
In order to avoid this issue you need to use the reserved words that are not limited by the MaxBarsBack setting:
Symbol_high
symbol_low

So in your code it should be:
vclickbarhigh=symbol_high[vbarsago];
vclickbarlow=symbol_low[vbarsago];


Return to “MultiCharts”