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

Examples step by step how to make your own automated strategy or user indicator
Message
Author
Jeronimo
Posts: 4
Joined: Fri Jul 01, 2016 5:56 pm

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

#1 Postby Jeronimo » Tue Jul 05, 2016 6:03 am

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);
}

FX Helper
Posts: 957
Joined: Mon Apr 01, 2013 3:55 am

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

#2 Postby FX Helper » Tue Jul 05, 2016 6:36 am

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.


Return to “Programming lessons”

Who is online

Users browsing this forum: No registered users and 1 guest