44 lines
2.1 KiB
MQL5
44 lines
2.1 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Trader.mqh |
|
|
//| Copyright 2026, MasterOfPuppets |
|
|
//| https://forge.mql5.io/masterofpuppets/mql5 |
|
|
//+------------------------------------------------------------------+
|
|
#ifndef MASTER_OF_PUPPETS_LIB_TRADER_MQH
|
|
#define MASTER_OF_PUPPETS_LIB_TRADER_MQH
|
|
|
|
#include <MasterOfPuppetsLib\Modifiers\IModifier.mqh>
|
|
#include <MasterOfPuppetsLib\TradeAction.mqh>
|
|
#include <MasterOfPuppetsLib\TradeContext.mqh>
|
|
#include <MasterOfPuppetsLib\TraderContext.mqh>
|
|
#include <MasterOfPuppetsLib\Utils.mqh>
|
|
|
|
#property copyright "Copyright 2026, MasterOfPuppets"
|
|
#property link "https://forge.mql5.io/masterofpuppets/mql5"
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Trader class |
|
|
//+------------------------------------------------------------------+
|
|
class Trader
|
|
{
|
|
private:
|
|
const TradeContext *m_tradeContext;
|
|
const TraderContext *m_traderContext;
|
|
double m_buyPyramidPriceOpen;
|
|
double m_sellPyramidPriceOpen;
|
|
void Log(const string message) const;
|
|
void ModifyPositions(const IModifier* modifier) const;
|
|
public:
|
|
Trader() : m_tradeContext(NULL), m_traderContext(NULL) {}
|
|
void Init(const TradeContext *srcTradeContext, const TraderContext *srcTraderContext);
|
|
void DeleteOrders(const string message, const bool allOrders) const;
|
|
void Modify(const string message, const IModifier* modifier) const;
|
|
void OrderOpen(const string message, const TradeAction tradeAction) const;
|
|
void PositionOpen(const string message, const TradeAction tradeAction);
|
|
const double GetBuyPyramidPriceOpen() const;
|
|
const double GetSellPyramidPriceOpen() const;
|
|
};
|
|
|
|
#include <MasterOfPuppetsLib\Trader.mq5>
|
|
|
|
#endif
|
|
//+------------------------------------------------------------------+
|