API Support Forum
OEC API > API Support > Questions about Calculate/Reclaculate
Author Topic: Questions about Calculate/Reclaculate
(2 messages, Page 1 of 1)
Moderators: VPfau
JJerry
Posts: 1
Joined: Nov 29, 2010


Posted: Nov 29, 2010 @ 02:42 PM             Msg. 1 of 2
1) What is the difference between Calculate and Recalculate? And when should I override each? I tried override both and it appears that
overridding Recalculate breaks something. If I have Calculate, it's called and shows my Log.Writes. If I add Recalculate it doesn't log anything.

public override void Recalculate(RecalculateArg arg)
{
//Log.Write( "{0} {1}", arg.Start, arg.End);
Log.Write( "Recalc" );
}

2) Is there a field that holds the Session's begin and end time?

Thanks, Jerry

Jerry Whitnell
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Dec 09, 2010 @ 12:40 PM             Msg. 2 of 2
It is better to override Calculate() method. This method is calling bar-by-bar even a bunch of bars were updated.

Recalculate() method can be used for algorithms that should see a range of updated bars and use some optimized techniques for calculations.

You can see differences in our sample indicators that come with Chart package.

Victor Vins
Software Developer