Check if last trade was buy or sell condition

Created at 24 Jun 2022, 21:16
IS

isabakas

Joined 25.11.2021

Check if last trade was buy or sell condition
24 Jun 2022, 21:16


Hi all, how would one code the following entry condition? The cbot can only enter a new buy position, if the last trade it took was a sell position. And vice versa.

Thx


@isabakas
Replies

PanagiotisCharalampous
27 Jun 2022, 12:20

Hi isabakas,

You can try something like this

            if (History.Last().TradeType == TradeType.Sell)
            { }

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous