Cancel a signal, prevent from executing

Questions about MultiCharts and user contributed studies.
User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Cancel a signal, prevent from executing

Postby syswizard » 19 Aug 2022

I know there is a way to effectively shutdown your system based on a condition.
Please refresh my memory on how to do this ?
Example: I reached my stop loss for the day and want my automated system to shutdown and no longer execute.

User avatar
rrams
Posts: 128
Joined: 10 Feb 2011
Location: USA
Has thanked: 7 times
Been thanked: 70 times
Contact:

Re: Cancel a signal, prevent from executing

Postby rrams » 20 Aug 2022

hi syswiz,

If your signal is running in Portfolio Trader; you can create a Portfolio Money Management script to disable trading of all signals in the portfolio using the pmms_strategies_pause_all keyword or just stop taking new entries with pmms_strategies_deny_entries_all.

If your signal is running in a chart window or PT; you can prevent that one signal from executing by writing an Abort keyword into the signal code when your stop loss condition is met. This will change the status of the signal to off until you manually change it back. RaiseRunTimeError will do the same except also pop up a message box.

If your signal is running in a chart window and you want to disable trading but still run the signal to see where the trades would have occurred; you can issue a "CommandLine(".at_toggle");" to change the autotrading status, but this has to be done carefully to avoid double toggling the AT button on signal init.

User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Re: Cancel a signal, prevent from executing

Postby syswizard » 20 Aug 2022

Thanks much for that RRAMS.
This is what I was looking for: RaiseRunTimeError


Return to “MultiCharts”