2026-03-06 03:09:30 +03:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| TraderContext.mq5 |
|
|
|
|
|
//| Copyright 2026, MasterOfPuppets |
|
|
|
|
|
//| https://forge.mql5.io/masterofpuppets/mql5 |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
#ifndef MASTER_OF_PUPPETS_LIB_TRADER_CONTEXT_MQ5
|
|
|
|
|
#define MASTER_OF_PUPPETS_LIB_TRADER_CONTEXT_MQ5
|
|
|
|
|
|
|
|
|
|
#include <MasterOfPuppetsLib\TraderContext.mqh>
|
|
|
|
|
|
|
|
|
|
#property copyright "Copyright 2026, MasterOfPuppets"
|
|
|
|
|
#property link "https://forge.mql5.io/masterofpuppets/mql5"
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Trader context initialization function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
void TraderContext::Init(const double contracts, const bool soundEnabled, const string soundFileName,
|
2026-03-06 19:04:08 +03:00
|
|
|
const double stopLoss, const double takeProfit, ulong magic)
|
2026-03-06 03:09:30 +03:00
|
|
|
{
|
|
|
|
|
m_contracts = contracts;
|
|
|
|
|
m_soundEnabled = soundEnabled;
|
|
|
|
|
m_soundFileName = soundFileName;
|
|
|
|
|
m_stopLoss = stopLoss;
|
|
|
|
|
m_takeProfit = takeProfit;
|
2026-03-06 19:04:08 +03:00
|
|
|
m_magic = magic;
|
2026-03-06 03:09:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
2026-03-06 19:04:08 +03:00
|
|
|
//| Get contracts function |
|
2026-03-06 03:09:30 +03:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
const double TraderContext::GetContracts() const
|
|
|
|
|
{
|
|
|
|
|
return m_contracts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
2026-03-06 19:04:08 +03:00
|
|
|
//| Get sound enabled function |
|
2026-03-06 03:09:30 +03:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
const bool TraderContext::GetSoundEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return m_soundEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
2026-03-06 19:04:08 +03:00
|
|
|
//| Get sound file name function |
|
2026-03-06 03:09:30 +03:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
const string TraderContext::GetSoundFileName() const
|
|
|
|
|
{
|
|
|
|
|
return m_soundFileName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
2026-03-06 19:04:08 +03:00
|
|
|
//| Get stop loss function |
|
2026-03-06 03:09:30 +03:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
const double TraderContext::GetStopLoss() const
|
|
|
|
|
{
|
|
|
|
|
return m_stopLoss;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//+------------------------------------------------------------------+
|
2026-03-06 19:04:08 +03:00
|
|
|
//| Get take profit function |
|
2026-03-06 03:09:30 +03:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
const double TraderContext::GetTakeProfit() const
|
|
|
|
|
{
|
|
|
|
|
return m_takeProfit;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 19:04:08 +03:00
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
//| Get magic function |
|
|
|
|
|
//+------------------------------------------------------------------+
|
|
|
|
|
const ulong TraderContext::GetMagic() const
|
|
|
|
|
{
|
|
|
|
|
return m_magic;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 03:09:30 +03:00
|
|
|
#endif
|
|
|
|
|
//+------------------------------------------------------------------+
|