Need some clarification on Calculation Cycle Method

Questions about MultiCharts .NET and user contributed studies.
victoryong
Posts: 24
Joined: 15 Sep 2013
Has thanked: 6 times
Been thanked: 3 times

Need some clarification on Calculation Cycle Method

Postby victoryong » 06 Jan 2014

Hi there,
Just started doing coding on MC.Net, I've read thru the programming guide but need some clarification on the calculation cycle,
  • 1. Bar by bar calculation, CalcBar() will be call for each bar, will StartCalc() be called for each bar as well? This means for each bar the cycle are, StartCalc() --> CalcBar() then back to StartCalc()? or StartCalc() will be called only at the start of the initial Bar?
    2. When a study is turn off, StopCalc() method is called. When the study is turn back on again, where will the state start? StartCalc()?

Cheers.
Victor

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Need some clarification on Calculation Cycle Method

Postby Henry MultiСharts » 07 Jan 2014

1. Bar by bar calculation, CalcBar() will be call for each bar, will StartCalc() be called for each bar as well? This means for each bar the cycle are, StartCalc() --> CalcBar() then back to StartCalc()? or StartCalc() will be called only at the start of the initial Bar?
Hello Victor,

StartCalc() will be called only once upon the study initialization.
CalcBar() will be called for each bar.
2. When a study is turn off, StopCalc() method is called. When the study is turn back on again, where will the state start? StartCalc()?
The calculation will start with a StartCalc, then CalcBar() will be called for each bar.

victoryong
Posts: 24
Joined: 15 Sep 2013
Has thanked: 6 times
Been thanked: 3 times

Re: Need some clarification on Calculation Cycle Method

Postby victoryong » 07 Jan 2014

Hi Henry,
In the .Net Programming Guide, it would be good if you guys can draw a state diagram of the Calculation Cycle in chapter 4.1, a diagram will give a good picture of the cycle.


Thanks.


Return to “MultiCharts .NET”