Doing without ArraySetAsSeries(close,true)?

How do I access close[] array correctly without using ArraySetAsSeries(close,true)?‌

Currently using:

ArraySetAsSeries(close,true);

for(shift= 0; shift < 500; shift++)
{
      total += close[shift];
}

thanks.‌

Currently using:

ArraySetAsSeries(close,true);

for(shift= 0; shift < 500; shift++)
{
      total += close[shift];
}
thanks.‌

‌‌
Why should you use ArraySetAsSeries() at all?

Just invert the loop direction‌

Why? because I was changing from mq4 to mq5 and was suggested.

for(shift= 500; shift >= 0; shift--)
{
      total += close[shift];
}

that’s not the latest 500 though, it’s the oldest 500.

How to get the latest?

‌Actually your code got the 501 oldest (not 500) :wink:

for(shift= rates_total-500; shift >= rates_total-1; shift--)
{
      total += close[shift];
}

‌Will give you the 500 newest with using ArraySetAsSeries().

Thanks, I’m getting it all now so should be ok.

Manually can make about 100% profit in about 8 hours.‌ Just hoping I can program my EA to do the work for me and do it 24 hours a day. Which case will make approx. 400% profit daily(I’m wishing :).

I have a lot of experience in c++ and OpenGL graphics so should be ok to produce good code.

Can anyone tell me if their making anywhere near 400% profit daily? Interested to know.

Even if my EA only makes 100% profit daily, still be a great money making machine :). ‌

Well, if you can make 400% profit per day, you can turn $100 into nearly $1,000,000 in 10 days… I do not think you will find many people consistently making anywhere near 400% profit daily!

What kind of a loop would you use for 400% a day? Double inverted tweet loop :slight_smile: