This is my personal library with lot of functions to easily manipulate positions and receive various infos. I work on it since 2019. Hope you like it 🙂
- SymbolOpenPipsMagic –Â return open pips from all positions by magic number.
- SymbolOpenPercentageMagic –Â return percentage from open positions by magic number.
- SymbolOpenPoints –Â return open points/pipets trades.
- SymbolOpenPointsMagic –Â return open points/pipets by magic number.
- SymbolOpenPositionsClose – close all open positions.
- SymbolOpenPositionsClosePartial –Â close partial all open positions.
- SymbolOpenPositionsCloseSpecificMagic –Â close specific open positions by magic number.
- SymbolOpenPositionsBreakeven –Â breakeven specific position.
- SymbolOpenPositionsBreakevenAll –Â breakeven all open positions.
- SymbolOpenPositionsSpecific –Â return number of specific open trades by comment.
- SymbolOpenPositionsSpecificMagic –Â return number of specific open trades by magic number.
- SymbolOpenPositionsSpecificType –Â close specific open trades by comment and type).
- SymbolOpenPositionsCloseSpecific –Â close specific open trades by comment.
- SymbolOpenPositionsLast –Â return the price from last open trade.
- SymbolOpenPositionsLowest –Â return the lowest price from open trades.
- SymbolOpenPositionsHighest –Â return the highest price from open trades.
- SymbolOpenPositionsVolumeMagic –Â volume of open trades by magic.
- SymbolOpenPositionsTotalComment –Â total of open positions by comment.
- SymbolOpenPositionsModifyTPSpecificMagic –Â changes only the TP of specific positions type by magic.
- SymbolOpenPositionsModifySLSpecificMagic – changes only the SL of specific positions type by magic.
- SymbolOpenPositionsModifyTPMagic –Â changes only the TP of all positions by magic.
- SymbolOpenPositionsModifySLMagic –Â changes only the SL of all positions by magic.
- SymbolOpenPositionsCloseSpecificMagicType –Â close specificy position type by magic.
- SymbolOpenPositionsCloseSpecificMagicCommentType –Â close specific position type by magic and comment.
- SymbolOpenPositionsHighestType –Â highest price by type.
- SymbolOpenPositionsLowestType –Â lowest price by type.
- SymbolOpenResultSpecific –Â return the open result of specific type of positions.
- SymbolOpenResultSpecificMagic –Â return the open result of specific positions by magic number.
- SymbolOpenPositionsSpecificTypeMagic –Â return the number of open positions by specific parameters.
- SymbolOpenPositionsBars –Â bars amount of open trades.
- SymbolOpenPositionsCloseAfterSeconds –Â close the trades after specified seconds.
- SymbolPendingOrdersCloseAll – close all pending orders.
- SymbolPendingOrdersCloseSell – close all pending sell orders.
- SymbolPendingOrdersCloseBuy – close all pending buy orders.
- SymbolPendingOrdersCloseSpecific – close specific trades by comment.
SymbolPendingOrdersType –Â amount of orders by type. - SymbolPendingOrdersMagic –Â return the amount of pending orders by magic number.
- SymbolPendingOrdersCloseBuyMagic –Â close buy pending orders by magic.
- SymbolPendingOrdersCloseSellMagic – close sell pending orders by magic.
- SymbolPendingOrdersSpecificTypeMagic –Â return the amount of pending orders by specific parameters.
- SymbolRiskReward – return the risk/reward ration from specific open position (position = true) or pending order (position = false).  Stop loss and take profit must be specified.
- SymbolPositionReverse –Â reverse specific position.
- SymbolPositionReverseAll –Â reverse all open positions.
- CandleTime –Â return the candle remaining time in string mode.
- SymbolNormalizeVolume –Â return the normalized (corrected) the inputed volume.
- SymbolNormalizeDigits – normalize digits to divide on some functions.
- SymbolChartClean –Â clean all chart, including date and price (optional).
- SymbolTimeframe – return the timeframe in string (ex. M1, M12, H3, Weekly, ect).
- SymbolPositionsSwapTotal –Â return in double the total swap from all open positions.
- SymbolPositionsCommissionTotal – return in double the total commission from all open positions .
- SymbolPriceChange –Â return the percentage difference from two prices.
- SymbolNormalizePrice – normalize price by tick size.
- SymbolPositionResultMoney –Â return the result from a position specified price target in money.
- SymbolPositionResultPercentage –Â return the result from a position specified price target in percentage.
- SymbolPeriodChangePips –Â return the change in pips between the actual price and previous candle close. On daily period, for example, you can view the daily pips change.
- SymbolPeriodChangePercentage –Â return the change in percentage between the actual price and previous candle close. On daily period, for example, you can view the daily percentage change.
- SymbolBIDÂ –Â return the symbol bid price.
- SymbolASKÂ –Â return the symbol ask price.
- SymbolSpread – return the symbol spread.
- SymbolVolumeByBalance – calculate the operation volume by account balance excluding the stop loss factor. Only a generic interger factor is used. Big factor = small growth.
- SymbolCheckPriceUsed –Â check if specific price is occupied by a pending order.
- SymbolCalculateMargin –Â return the required margin to open a trade.
- SymbolDigits –Â return the symbol digits.
- SymbolSwapBuy –Â return the swap to open a buy trade.
- SymbolSwapSell –Â return the swap to open a sell trade.
- SymbolFilling –Â return in string mode the symbol filling type (FOK, IOC or Return).
- SymbolCalculateVolumeByPercentage –Â volume by percentage of risk.
- SymbolVolumeByPercentage –Â get auto volume by percentage.
- SymbolGetDecimalPoints –Â symbol decimal points value.
- SymbolGetExpirationType –Â expiration type in string.
- OTHERS:
- FixDatetimeDay –Â subtract or add days to specific date or time and return it in datetime.
- FixDatetimeHours – subtract or add hours to specific date or time and return it in datetime.
- FixDatetimeMinutes – subtract or add minutes to specific date or timed return it in datetime.
- FixDatetimeSeconds – subtract or add seconds to specific date or time and return it in datetime.
- RoundValue – return a integer rounded number.
- NewCandleCheck –Â boolean return when new candle are formed.
- ChartHideObjects –Â hide all objects from chart.
- ChartGetScale -chart scale in integer.
- ChartShowHiddenObjects –Â show all hidden objects from chart.
- ChartGetPixelsWidth –Â chart width in pixels.
- ChartGetPixelsHeight –Â chart height in pixels.
- ChartGetColorForeground –Â chart foreground color.
- ChartGetColorBackground –Â chart background color.
- IsFirstTime –Â return boolean if is first time running the application.
- GetDeinitReason – return in string the reason to program deinitialization.
- StringRemoveEmptySpace – return in string type the original modified string.
- CheckIfIsNumber – return true if a variable is number or false if it is not number. Good for text boxes.
- ChartObjectsDeleteAll – delete all objects on chart.
- IfMarketClosed – boolean return if market is closed.
- KeyboardKeyCode– return in string mode the key pressed.
- LocalHour – return the local computer hour.
- LocalMinutes – return the local computer minutes.
- GMTHour – return the GMT hour.
- GMTMinutes – return the GMT minutes.
- ToPoint –Â automatically convert to symbol _Point.
- ScreenDPIFactor() –Â return the integer screen DPI factor for GUI purposes.
- TradeTimeRemaining –Â return in boolean if the actual time is the scheduled trading time (hour and minute to start and end).
- CheckStrategyTester –Â return in boolean if is Strategy Tester or not.
- CandleOpen –Â return in double the open price of determined candle.
- CandleClose – return in double the close price of determined candle.
- CandleHigh – return in double the high price of determined candle.
- CandleLow – return in double the low price of determined candle.
- CandleCheckTrade –Â check if there is one or more trades on a candle (shift option).
- CandleTime –Â the old function was renamed (now it is CandleTimeRemaining), now this one returns the candle datetime.
- ACCOUNT:
- AccountMode() –Â return the account mode in string (netting, exchange or hedging).
- AccountType() –Â return the account type in string (demo, competition or real).
- AccountDate(bool show day, bool show month, bool show year, str separator) – return in string modethe actual time in day, month and year.
- AccountMonthOfYear(default months or specify each one) – return in string mode the actual month of year.
- AccountDayOfWeek(default days or specify each one) – return in string mode the actual week day.
- AccountDayOfWeekInt(default days or specify each one) –Â return in integer mode the day of week.
- AccountHour() – return in integer mode the current hour.
- AccountMinutes()Â – return in integer the current account minutes.
- AccountOpenResult() – return in double mode the result from all open positions.
- AccountOpenPercentage() – return in double mode the result in percentage from all open positions.
- AccountCheckConnections(bool CheckServer, bool CheckTradingEnabled, bool CheckMQL5, str ServerErrorMsg, str TradingErrorMsg, str MQL5ErrorMsg, str MsgCaption) –Â show a error message when specific connections is not working.
- AccountConnectionState() –Â return in string type the connection state (on-line or off-line).
- AccountPositionsClose(str ErrorPrint) –Â close all open positions from all symbols.
- AccountCheckReal –Â return bool type if account is real or not.
- AccountPercentageByValue –Â return the accounte percentage according to a value.
- HISTORY:
- HistoryDealLastEntryAsString() –Â reason of last trade closed.
- HistoryDealLastResult() –Â result of last closed trade.
Please comment what do you think 🙂