how replace MarketSeries.Close[index] , is obsolete

Created at 29 Feb 2024, 17:16
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
bmercado.ar's avatar

bmercado.ar

Joined 29.02.2024

how replace MarketSeries.Close[index] , is obsolete
29 Feb 2024, 17:16


Hi,  I have a code wich is obsolete. How can I replace it with a new vesrsion?

 private bool EsAlcistaAscendente(int index)
        {
            return MarketSeries.Close[index] > MarketSeries.Open[index] &&
                   MarketSeries.Close[index] > MarketSeries.Close[index - 1];
                  
        }


@bmercado.ar
Replies

PanagiotisCharalampous
01 Mar 2024, 09:06

Hi there,

You should use the Bars collection instead e.g Bars.ClosePrices[index] etc

Best regards,

Panagiotis


@PanagiotisCharalampous

bmercado.ar
02 Mar 2024, 16:39 ( Updated at: 03 Mar 2024, 07:09 )

RE: how replace MarketSeries.Close[index] , is obsolete

PanagiotisCharalampous said: 

Hi there,

You should use the Bars collection instead e.g Bars.ClosePrices[index] etc

Best regards,

Panagiotis

Thanks a lot. 


@bmercado.ar