Difference between revisions of "Recalculate"
Jump to navigation
Jump to search
(Created page with "Initializes recalculation of the study. All the variables will be re-initialized. The study will be recalculated from the first bar of the data series. ==Usage== <syntaxhig...") |
|||
Line 25: | Line 25: | ||
end; | end; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | This link has an example of the recalculate command and the RecalcPersist command showing how they work with a fileappend command to show the results. http://www.multicharts.com/discussion/viewtopic.php?f=5&t=10371 | ||
[[Category:Execution Control]] | [[Category:Execution Control]] |
Latest revision as of 14:08, 12 August 2012
Initializes recalculation of the study. All the variables will be re-initialized. The study will be recalculated from the first bar of the data series.
Usage
Recalculate;
Note
To avoid infinite looping of the script, use global variables with recalculation conditions.
Example
Set the condition for recalculation:
var: recalcpersist recalc_once(true), vol0(0);
if LastBarOnChart then begin
print("Last bar volume = ", volume);
if recalc_once then begin
print("Recalculate study!");
recalc_once = false;
recalculate;
end;
end;
This link has an example of the recalculate command and the RecalcPersist command showing how they work with a fileappend command to show the results. http://www.multicharts.com/discussion/viewtopic.php?f=5&t=10371