Abort a study without a run-time error  [SOLVED]

Questions about MultiCharts and user contributed studies.
OZ Trade
Posts: 39
Joined: 08 Nov 2013
Has thanked: 11 times
Been thanked: 18 times

Abort a study without a run-time error

Postby OZ Trade » 06 Jun 2014

Hi all,

Wondering if there is a way to abort a study without the run-time error.

Basically I want my study to run once then toggle off without the annoying pop-up and sound.

I am aware of the abort keyword (execution control) and have investigated command-line also but can't find a solution.

Thanks,

User avatar
JoshM
Posts: 2100
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1526 times
Been thanked: 1507 times
Contact:

Re: Abort a study without a run-time error

Postby JoshM » 06 Jun 2014

Wondering if there is a way to abort a study without the run-time error.

Basically I want my study to run once then toggle off without the annoying pop-up and sound.

I am aware of the abort keyword (execution control) and have investigated command-line also but can't find a solution.
I'm reasonably sure this can work with the return keyword (untested though):

Code: Select all

Variables:
alreadyCalculated(False);

if (alreadyCalculated = true) then
#return;

// Any statements below `return` are not executed,
// so as soon as this Boolean variable is true,
// the indicator is not 'calculated' anymore.

// Put the code that you want to run once below the `return` reserved word, for example:

once (BarStatus(1) = 2) begin

// This code will be executed once on the
// close of the first bar

alreadyCalculcated = true;

end;

OZ Trade
Posts: 39
Joined: 08 Nov 2013
Has thanked: 11 times
Been thanked: 18 times

Re: Abort a study without a run-time error  [SOLVED]

Postby OZ Trade » 07 Jun 2014

Thanks,

Its works in stopping the calculation but the study remain 'on' in the status line.. Was looking for the same effect as abort where the study becomes toggled off..

Its no big deal anyway

User avatar
JoshM
Posts: 2100
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1526 times
Been thanked: 1507 times
Contact:

Re: Abort a study without a run-time error

Postby JoshM » 07 Jun 2014

Its works in stopping the calculation but the study remain 'on' in the status line.. Was looking for the same effect as abort where the study becomes toggled off..
That would be an useful feature, but is not possible (see Shut down an indicator via code? is it possible?).

Edit: There's a feature request that asks for this with the help of hotkeys: MC-1136 - Enabling / Disabling Indicators via a HotKey Combination option.


Return to “MultiCharts”