I am not very good in "C". I have tried to use array but always encounter error. Below is my simple code for experiment:
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
Value.Set(0);
else
{
double mean = 0;
double trend = 0;
double[] w;
for (int idx = Math.Min(CurrentBar, k3m - 1); idx >= 0; idx--)
w[idx]=idx;
What is my problem?
******************
1) I am not sure whether I have define the array correctly:
for example: double[] w;
2) I am also not sure how to place the array command correctly:
for (int idx = Math.Min(CurrentBar, k3m - 1); idx >= 0; idx--)
w[idx]=idx;
Can someone give some advise please? Thanks.
Shek
Comment