How to get nth Candle's High and store it in a double?

 

I am trying to store high of any particular candle in a double.

here is what i am doing

if (blah blah happens) {
            double HighFC[];
            int HighestFC;
            ArraySetAsSeries(HighFC,true);
            CopyHigh(_Symbol,_Period,1,2,HighFC);
            HighestFC= ArrayMaximum(HighFC,1,2);
            static double StoreHighValue = PriceInformation[HighestFC].high;
            Comment("HFCX", StoreHighValue);
}

but HFCX always returning value of last 2nd candle's high

how can i store nth candle's value in a static manner ?

Any help is highly appreciated

 
Arpit T: but HFCX always returning value of last 2nd candle's high

how can i store nth candle's value in a static manner ?

  1. Of course, it does, that is what you asked for.

  2. Perhaps you should read the manual.
    Timeseries and Indicators Access / CopyHigh - Reference on algorithmic/automated trading language for MetaTrader 5
    Array Functions / ArrayMaximum - Reference on algorithmic/automated trading language for MetaTrader 5

       How To Ask Questions The Smart Way. 2004
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

Reason: