According to the docs on ParamTrigger it will trigger a one-shot code execution. My question is at what point the process of executing a back test does this triggered code get executed? Is it in phase 1 on the first symbol, or in phase 2 before anything before any other code, or at the end of phase 2 after all other code has been processed?
ParamTrigger is intended to be used in CHARTS only as it only then makes sense to "trigger" anything as it just causes chart refresh when you click on button.
You can easily see the behavior with a bit of test code like this:
eventTrigger = ParamTrigger("Event Trigger", "Press to Trigger");
if (eventTrigger)
{
_TRACE("eventTrigger Activated");
}
Filter = True;
AddColumn(C, "Close");
Open the Parameters window and click the Event Trigger button. Watch the Log/Trace window to see when the output appears. It should be the next time your AFL is executed, which could be to refresh a chart as @Tomasz mentioned, or on the first symbol of an Exploration, or even when you go back into the Parameters window again.
Okay, looks like best used only for charting and a semaphore is a better choice for use in back testing.