add supports for Report Balance on Partial Close ...
This commit is contained in:
@@ -490,7 +490,7 @@ void OnTakeProfitTriggered(const XDeal &deal)
|
|||||||
*
|
*
|
||||||
* @param ticket: ULONG ...
|
* @param ticket: ULONG ...
|
||||||
* @param position: XPosition instance ...
|
* @param position: XPosition instance ...
|
||||||
* @param comment: String ...
|
* @param comment: string ...
|
||||||
*/
|
*/
|
||||||
void OnPositionForceClosed(
|
void OnPositionForceClosed(
|
||||||
const ulong ticket,
|
const ulong ticket,
|
||||||
@@ -501,6 +501,26 @@ void OnPositionForceClosed(
|
|||||||
eaTradeManager.HandleForceClose(position);
|
eaTradeManager.HandleForceClose(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle Position Partially Closed Event ...
|
||||||
|
*
|
||||||
|
* @param ticket: ULONG ...
|
||||||
|
* @param profit: double ...
|
||||||
|
* @param comment: string ...
|
||||||
|
*/
|
||||||
|
void OnPositionPartiallyClosed(
|
||||||
|
const ulong ticket,
|
||||||
|
const double profit,
|
||||||
|
const string comment //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
eaTradeManager.HandlePartiallyClosed(
|
||||||
|
ticket,
|
||||||
|
profit,
|
||||||
|
comment //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle Deals Changes ...
|
* Handle Deals Changes ...
|
||||||
*
|
*
|
||||||
@@ -674,6 +694,7 @@ void InitRequirements()
|
|||||||
eaTrade.AddOnStopLossEventHandler(OnStopLossTriggered);
|
eaTrade.AddOnStopLossEventHandler(OnStopLossTriggered);
|
||||||
eaTrade.AddOnTakeProfitEventHandler(OnTakeProfitTriggered);
|
eaTrade.AddOnTakeProfitEventHandler(OnTakeProfitTriggered);
|
||||||
eaTrade.AddOnForceClosePositionEventHandler(OnPositionForceClosed);
|
eaTrade.AddOnForceClosePositionEventHandler(OnPositionForceClosed);
|
||||||
|
eaTrade.AddOnPartialClosePositionEventHandler(OnPositionPartiallyClosed);
|
||||||
|
|
||||||
//
|
//
|
||||||
// EA Trae Manager ...
|
// EA Trae Manager ...
|
||||||
|
|||||||
@@ -1644,6 +1644,28 @@ class XCXCAEATradeManager : public XCBaseAlert
|
|||||||
RemoveTrade(idx);
|
RemoveTrade(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle Position Partially Closed Event ...
|
||||||
|
*
|
||||||
|
* @param ticket: ULONG ...
|
||||||
|
* @param profit: double ...
|
||||||
|
* @param comment: string ...
|
||||||
|
*/
|
||||||
|
void HandlePartiallyClosed(
|
||||||
|
const ulong ticket,
|
||||||
|
const double profit,
|
||||||
|
const string comment //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Handle Balance Reporting ...
|
||||||
|
string prefix = "Partially Closed: " + ToString(ticket);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Handle Balance Reporting ...
|
||||||
|
HandleReportBalance(prefix);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle Force Close Trades ...
|
* Handle Force Close Trades ...
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user