المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Running a loop, try to get both [i] value (todayvalue), and [i - 1] value (yesterdays value)



C# Programming
04-26-2013, 01:52 AM
Hi

I have a loop where I try to pull stockdata, i'm getting moving averages for each day in the loop.

The basic idea is to enter a trade if MA20 is crossing MA50, and MA10 is above MA50.

I've written this test in VBA in Excel, then it was easy to define yesterdays value, it todays value was set by i, yesterday was i - 1.

But in C# I don't know how to solve it, I've just started to write in this language....

if (0