Closed bar stop loss

Created at 08 Dec 2020, 03:48
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!
CT

ctid2908776

Joined 08.12.2020

Closed bar stop loss
08 Dec 2020, 03:48


anyone know of a bot that do this.

example short trade, i want to close out if a bar closes above x.xx - not when it hits, when it closes the other side (same for longs)


@ctid2908776
Replies

PanagiotisCharalampous
08 Dec 2020, 09:30

Hi ctid2908776,

You can write a condition like the below

            if(Bars.ClosePrices.Last(1) > xxx)
            {
                // Close trades
            }

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous