Can't use Bars.ClosePrices in bool

Created at 26 Aug 2021, 12:38
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!
JO

joseph.decosta.tan

Joined 26.08.2021

Can't use Bars.ClosePrices in bool
26 Aug 2021, 12:38


Trying to set a criteria based on AroonUp crossing over AroonDown, and the closing price of that same bar being the lowest of the last 3.

       I'm getting the error: "Error CS1955: Non-invocable member 'cAlgo.API.Bars.ClosePrices' cannot be used like a method."

 private bool LongRules()
        {
            if (_aroonindi.Up.HasCrossedAbove(_aroonindi.Down, 1) && Bars.ClosePrices(1) < Bars.ClosePrices.Minimum(3))
            {
                return true;
            }
            return false;
        }

 


@joseph.decosta.tan
Replies

PanagiotisCharalampous
27 Aug 2021, 07:48

Hi joseph.decosta.tan,

Your problem is here

Bars.ClosePrices(1)

It should be

Bars.ClosePrices.Last(1)

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous