using trade history

Created at 13 Aug 2021, 19:03
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!
GH

Gholamia252

Joined 29.03.2021

using trade history
13 Aug 2021, 19:03


hello 

 i want to write 

if (last trade wasnt sell &&..)

sell;

or 

if( last trade wasn't buy &&..) 

buy;

i dont know how i get type of last trade and how write my Condition

thanks.


@Gholamia252
Replies

PanagiotisCharalampous
16 Aug 2021, 08:51

Hi Gholamia252,

Here you go

            if (History.Last().TradeType == TradeType.Buy)
            { 
            
            }
            else
            { 
            
            }

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous