okWarrior_EA/references/MQL5/Experts/GoExploer/Cell.mqh

89 lines
7 KiB
MQL5

<EFBFBD><EFBFBD>//+------------------------------------------------------------------+
//| Cell.mqh |
//| Copyright DNG<EFBFBD> |
//| https://www.mql5.com/en/users/dng |
//+------------------------------------------------------------------+
#property copyright "Copyright DNG<00>"
#property link "https://www.mql5.com/en/users/dng"
#property version "1.00"
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#define HistoryBars 20 //Depth of history
#define Buffer_Size 2112
#define FileName "GoExploer"
//+------------------------------------------------------------------+
//| Cell |
//+------------------------------------------------------------------+
struct Cell
{
int actions[Buffer_Size];
float state[HistoryBars * 12 + 9];
int total_actions;
float value;
//---
Cell(void);
//---
bool Save(int file_handle);
bool Load(int file_handle);
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
Cell::Cell(void)
{
ArrayInitialize(actions, -1);
ArrayInitialize(state, 0);
value = 0;
total_actions = 0;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool Cell::Save(int file_handle)
{
if(file_handle <= 0)