//============================================================================= // LibDerksUtils.mqh // Copyright © 2006, Derk Wehler // ashwoods155@yahoo.com // // Companion header file for LibDerksUtils.mq4 // //============================================================================= #property copyright "Copyright © 2006, Derk Wehler" #property link "no site" #import "LibDerksUtils.ex4" #define OP_BOTH -1 #define ALL_OPEN -1 #define ALL_PENDING -1 #define ALL_PENDING_BUYS -2 #define ALL_PENDING_SELLS -3 // Money Management Helper Functions double LotsOptimized(double TradeSizePercent, double Lots, double MaxLots); double GetLots(bool MoneyManagement, double TradeSizePercent, double Lots, double MaxLots); // Magic Number Helper Functions int TimeFrameConst2Val(int TF_In_Minutes); int SymbolConst2Val(string symbol); // Trading Functions int NumOpenPositions(int magic, int dir); int NumPendingPositions(int magic, int dir); int ClosePendingOrders(int magic, int dir); int ReplenishOrders(int magic, int dir[], double price[], double sls[], double tps[]); bool AdjTrailOnAllOrders(int TrailType, int TrailVal, int Magic, int Direction, int FirstMove, int FirstStopLoss, int SecondMove, int SecondStopLoss, int ThirdMove);