Having trouble getting historical trade data

Created at 28 Mar 2018, 01:12
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!
andrepasuf's avatar

andrepasuf

Joined 28.03.2018

Having trouble getting historical trade data
28 Mar 2018, 01:12


I'm building an automated CBOT and I need a way to find out what the last buy and sell trade stats are when the cbot is activated. 

I cant seem to find any examples online of how to do this. I just need to know things like was it a profitable trade, how many pips etc.. The last buy and sell. 

Unfortunately I'm not the best C# coder but I do program in other languages so I learn easily from examples. Does anyone know how to do this? 


@andrepasuf
Replies

PanagiotisCharalampous
28 Mar 2018, 09:52

Hi andrepasuf,

You can access the last deal using the followng code

History[History.Count - 1]

Let me know if this helps you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

andrepasuf
29 Mar 2018, 23:10

Yes it works perfectly. 


@andrepasuf