Login Page - Create Account

Support Board


Date/Time: Sun, 22 Dec 2024 12:24:37 +0000



Post From: ACSIL - How to run part of code only once per bar

[2015-04-20 06:36:11]
eagle - Posts: 92
I moved the assignment setting of "sc.OnExternalDataImmediateStudyCall" to run only on startup:

if (Index == 0) {        // Startups and recalculations.

    // Set the value of Fast Update for Trade Data.
    sc.OnExternalDataImmediateStudyCall = FastUpdate.GetIndex();

    // Initialize the LastIndexProcessed persistent variable.
    LastIndexProcessed = -1;

    // Don't process further on startups nor recalculations.
    return;
  }

2. Will this setting of "sc.OnExternalDataImmediateStudyCall" be persistent across calls to the study function?