egorpe wrote:**IndicatorCounted** function is not present in FT3 API, so how would you convert this MQL4 loop to FT3?

Code: Select all

`int counted_bars = IndicatorCounted();`

if (counted_bars > 0) { counted_bars--; }

int limit = Bars - counted_bars;

for (int i = 0; i < limit; i++) {

// calculations happen here using High(i), Low(i), Volume(i), etc...

}

I couldn't figure it out from the documentation.

You can use your calculations in the Calculate method.

For example, you have next code

Code: Select all

`in start()`

{

int counted_bars = IndicatorCounted();

if (counted_bars > 0) { counted_bars--; }

int limit = Bars - counted_bars;

for (int i = 0; i < limit; i++) {

// calculations happen here using High(i), Low(i), Volume(i), etc...

}

}

So in ForexTester this code should be like this

Code: Select all

`EXPORT void __stdcall Calculate(int index)`

{

// calculations happen here using High(index), Low(index), Volume(index), etc...

}