2026-03-06 03:57:21 +03:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| ClosePositionModifier.mq5 |
|
|
|
|
|
//| Copyright 2026, MasterOfPuppets |
|
|
|
|
|
//| https://forge.mql5.io/masterofpuppets/mql5 |
|
|
|
|
|
//+------------------------------------------------------------------+
|
2026-03-06 04:04:03 +03:00
|
|
|
#ifndef MASTER_OF_PUPPETS_LIB_CLOSE_POSITION_MODIFIER_MQ5
|
|
|
|
|
#define MASTER_OF_PUPPETS_LIB_CLOSE_POSITION_MODIFIER_MQ5
|
2026-03-06 03:57:21 +03:00
|
|
|
|
2026-03-06 06:41:42 +03:00
|
|
|
#include <MasterOfPuppetsLib\Modifiers\ClosePositionModifier.mqh>
|
2026-03-06 03:57:21 +03:00
|
|
|
|
|
|
|
|
#property copyright "Copyright 2026, MasterOfPuppets"
|
|
|
|
|
#property link "https://forge.mql5.io/masterofpuppets/mql5"
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Modify function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
void ClosePositionModifier::Modify() const
|
|
|
|
|
{
|
2026-03-06 19:04:08 +03:00
|
|
|
if(m_withExpert && m_tradeContext.GetPositionInfo().Magic() != m_traderContext.GetMagic())
|
2026-03-06 03:57:21 +03:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
m_tradeContext.GetTrade().PositionClose(m_tradeContext.GetPositionInfo().Ticket());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
//+------------------------------------------------------------------+
|