Can't use Bars.ClosePrices in bool

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