Hi I'm using VC++.net 2.0 an creating a few technical indicators for grad school. I am having a problem creating the aroon indicator and I would appreciate some help. Here is a description of what the Aroon Indicator is :

Aroon(up) = ((total_num_of_periods - num_of_periods_since_highest_close) / total_num_of_periods) x 100

Aroon(down) = ((total_num_of_periods - num_of_periods_since_lowest_close) / total_num_of_periods)) x 100 

I would really appreciate any help. Thanks!

    Tick ^m_Tick;
        SortedList ^m_TickList;
        double Max = -100000;
    double Min = 100000;
    int aroonNumPeriodsSinceHH = 0;
        int aroonNumPeriodsSinceLL = 0;
    int HighestHigh;
    int LowestLow;

    m_AroonU = 0;
    m_AroonD = 0;
    m_AroonO = m_AroonU - m_AroonD;

    while(1)
    {
    //Add the tick object to the SortedList.
        m_TickList->Add( m_Tick->Price, safe_cast<System::Object^>(0) );

        if (m_TickList->Count > 15 )
        {
            m_TickList->Remove(m_TickList->Count - 1);
        }
        if ( m_TickList->Count.CompareTo >  15)
        {

        for( int Z = 0; Z < m_TickList->Count - 1 ; Z++)
        {
            if (m_TickList->Values[Z] > HighestHigh)
            {
                 HighestHigh = m_TickList->
                 aroonNumPeriodsSinceHH = Z + 1;
            }
            if( m_TickList->Count[Z] < LowestLow)
            {
                LowestLow = m_TickList->Count[Z];
                aroonNumPeriodsSinceLL = Z + 1;
            }

      m_AroonU = (((m_TickList->Count - aroonNumPeriodsSinceHH) / m_TickList->Count[]) * 100);
      m_AroonD = (((m_TickList->Count - aroonNumPeriodsSinceLL) / m_TickList->Count[]) * 100);
        }

    }

    }
}

I am getting error codeC2660, because of
m_TickList->Values[Z] > HighestHigh
since values does not take an argument...I am not sure how to fix this..

Thanks

> if ( m_TickList->Count.CompareTo > 15)
Edward gets an error here too. CompareTo isn't even being treated like a function.

> I am not sure how to fix this..
ICollection doesn't have an overloaded indexing operator, but you can use the GetByIndex method of SortedList:

if (Convert::ToInt32(m_TickList->GetByIndex(Z)) > HighestHigh)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.