Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Basic GridManager Library - Library for MetaTrader 5 | Grid EA Download - MT4/MT5 Resources

author EAcpu | 4 reads | 0 comments |

This library contains basic public methods for managing the grid:

 people :
                    GridManager(ENUM_GRID_DIRECTION direction, double grid initial lot size, integer grid gap points, double grid profit percentage);
                    ~GridManager() {};
Blank Set GridMagicNumber( Oolong Magic);
Blank Set grid maximum DD ( double the maximum_dd_percentage);
Blank Set the grid multiplier ( double the batch multiplier);
blank start( blank );
blank update( blank );
blank closeGrid();
Double GridPnL();
integer countPosition();

In the code above:

Here is a sample code based on the EA running the Grid Manager purpose:

 #include
GridManager *buy_grid; integer initialization ()
  {
  buyGrid = newGridManager (GRID_BUY, 0.01 , 100 , 1 );
  buy_grid.SetGridMagicNumber( 100 ); 
  buy_grid.SetGridMultiplier( 1.5 ); 
  buy_grid.SetGridMaxDD( 5 );
Return ( initialization successful );
  } Blank solution initialization ( constant integer reason)
  {
Delete purchase grid;
  } Blank check ( blank )
  {
BooleanBuyCondition = True ;
if (purchase condition)
      buy_grid.Start();
  buy_grid.Update();
  }

Attachment download

📎Gridtest.mq5 (0.46 KB)

📎 gridmanager.mqh (10.41 KB)

Source: MQL5 #49186

Verification code Refresh