what does the number (1) and (2) after the var mean MACDLine = macd.MACD.Last(1);

Created at 03 Nov 2022, 22:26
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!
AL

Alwin123

Joined 28.10.2022

what does the number (1) and (2) after the var mean MACDLine = macd.MACD.Last(1);
03 Nov 2022, 22:26


what does the number (1) and (2) after the var mean MACDLine = macd.MACD.Last(1);

I am looking for the correct setting of the PrevMACDLine, Signal and the PrevSignal. When the signal line goes above the 0 line

        var MACDLine  = macd.MACD.Last(1);
        var PrevMACDLine = macd.MACD.Last(2);
        var Signal  = macd.Signal.Last(1);
        var PrevSignal= macd.Signal.Last(2);

 if   ((MACDLine > Signal & PrevMACDLine < PrevSignal))

Thanks for the help

@Alwin123
Replies

Alwin123
03 Nov 2022, 23:04 ( Updated at: 21 Dec 2023, 09:23 )

is there anyone who can check both macd?? I want to have a buy position when the macdline is above the signal line and above the zero line


@Alwin123