Page 1 of 1

How i translate the integer const to Delphi. this are not in the strategy buiolder

Posted: Tue Jul 05, 2016 6:03 am
by Jeronimo
int OnCalculate (const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{
int limit = rates_total - prev_calculated;
//--- counting from 0 to rates_total
ArraySetAsSeries(Buffer1, true);
ArraySetAsSeries(Buffer2, true);
ArraySetAsSeries(Buffer3, true);
//--- initial zero
if(prev_calculated < 1)
{
ArrayInitialize(Buffer1, 0);
ArrayInitialize(Buffer2, 0);
ArrayInitialize(Buffer3, 0);
}

Re: How i translate the integer const to Delphi. this are not in the strategy buiolder

Posted: Tue Jul 05, 2016 6:36 am
by FX Helper
Hello

You don't need to write all these constants while creating the indicators in Forex Tester.
You just need to use the function Calculate.

procedure Calculate(index: integer); stdcall;

begin

// Here you should calculate values of

// index buffers for bar defined with "index"

...

end;

You can find more info in the Help -> Indicators API menu in the Forex tester program.