Assista a como baixar robôs de negociação gratuitos
Encontre-nos em Facebook!
Participe de nossa página de fãs
Script interessante?
Coloque um link para ele, e permita que outras pessoas também o avaliem
Você gostou do script?
Avalie seu funcionamento no terminal MetaTrader 5
Bibliotecas

Symbol Trade Made Simple - biblioteca para MetaTrader 5

Visualizações:
9106
Avaliação:
(32)
Publicado:
2019.06.21 15:34
Atualizado:
2022.07.10 00:16
\MQL5\Include\Trade\ \MQL5\Include\ \MQL5\Indicators\
Precisa de um robô ou indicador baseado nesse código? Solicite-o no Freelance Ir para Freelance

Version 1.19, updated 08/Jul/2022.

Functions:

  • SYMBOL:
  • SymbolOpenPositionsTotal - return the number of opened positions.
  • SymbolOpenPositionsVolume - return the total volume of opened positions.
  • SymbolPendingOrdersTotal - return the number of pending orders.
  • SymbolPendingOrdersVolume - return the total volume of pending orders.
  • SymbolPendingOrdersSpecific - return the number of specific open positions by comment.
  • SymbolPendingOrdersSpecificType - return the amount of pending orders by comment and type.
  • SymbolPendingOrdersType- return the amount pending orders by type.
  • SymbolOpenResult - return the result (profit) from all open positions together.
  • SymbolOpenPips - return the pips from all open positions.
  • 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.

Added:

  • 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.
  • SymbolPendingOrdersCloseBuyMagic - close buy pending orders by magic.
  • SymbolPendingOrdersCloseSellMagic - close sell pending orders by magic.
  • SymbolCalculateVolumeByPercentage - volume by percentage of risk.
  • SymbolVolumeByPercentage - get auto volume by percentage.
  • SymbolGetDecimalPoints - symbol decimal points value.
  • ChartGetPixelsWidth - chart width in pixels.
  • ChartGetPixelsHeight - chart height in pixels.
  • ChartGetColorForeground - chart foreground color.
  • ChartGetColorBackground - chart background color.
  • 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.
  • AccountPercentageByValue - return the accounte percentage according to a value.

Changes:

  • Added log print to functions that open and close trades (no print by default).
  • SymbolOpenPositionsHighest changed to SymbolOpenPositionsHighestType.
  • SymbolOpenPositionsLowest changed to SymbolOpenPositionsLowestType.
  • SymbolOpenPositionsSpecificType renamed to SymbolOpenPositionsSpecificTypeComment, now they are different.
  • SymbolOpenPositionsCloseSpecific renamed to SymbolOpenPositionsCloseSpecificComment.
  • SymbolPendingOrderCloseSpecific renamed to SymbolPendingOrderCloseSpecificComment.
  • SymbolOpenPositionsTotal - removed magic input. We already have SymbolOpenPositionsSpecificMagic.
  • CandleTime renamed to CandleTimeRemaining because CandleTime now return the candle datetime.

Fixed:

  • SymbolNormalizeVolume - huge improvement. From 20 lines of cote to just one.

Please comment what do you think :)


Laguerre RSI - no gamma Laguerre RSI - no gamma

Laguerre RSI - sem usar o parâmetro gama

Quatro cliques para desenhar um canal em forma de arco. Quatro cliques para desenhar um canal em forma de arco.

Uma maneira rápida de desenhar um canal em forma de arco com 4 cliques do mouse.

Volume Normalize (correct it) Volume Normalize (correct it)

Normalize (correct) the volume (lot) according to the symbol lot step

Regressão linear e ajuste polinomial de qualquer grau por mínimos quadrados. Regressão linear e ajuste polinomial de qualquer grau por mínimos quadrados.

O ajuste polinomial por minimos quadrados tem como objetivo encontrar uma equação polinomial de grau N, que mais se aproxima de um conjunto de pontos tabelados. Caso o grau N seja igual a 1, esse polinomio será uma reta, podendo caracterizar esse ajuste como regressão linear.