Getting results from last trade?

Created at 15 Dec 2018, 11:46
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!
AR

arron3@gmail.com

Joined 12.12.2018

Getting results from last trade?
15 Dec 2018, 11:46


So, once my bot closes a position, I am trying to figure out how to get the results from the last trade (in pips)

 

maybe with 

HistoricalTrade 

? .... tho i am not sure the snytax..


@arron3@gmail.com
Replies

Shares4UsDevelopment
17 Dec 2018, 10:57

Use the onclose eventhandler
 

protected override void OnStart()
{
             Positions.Closed += sender => Orders.Events.PositionsOnClosed(sender, this);
             '''''''
}
 

&&

 public static void PositionsOnClosed(PositionClosedEventArgs Posit, Robot This)
 {
               Print(  Posit.Reason);
 }

 


@Shares4UsDevelopment