Freelance: Custom Programming on MetaTrader and MQL?
Signal Bar Number for Repainting Indicator: Bar Shift to Use for Signal?
Description
On www.expforex.com, we offer advanced Expert Advisors equipped with a multitude of functional features and customizable parameters. Each Expert Advisor is built using a flexible template, allowing traders to tailor them to their unique trading strategies.
The primary functions include automatic opening and closing of trades based on signals from indicators such as Moving Average and MACD.
Parameters like Shift determine the number of bars used for signal analysis, ensuring precise trading decisions.
Risk management is facilitated through parameters like Stop Loss and Take Profit, which set automatic closure levels for positions upon reaching specific profit or loss points.
Slippage controls the allowable price deviation when executing orders, while Martingale and Trailing Stop offer dynamic volume management and profit protection.
A standout feature is the use of a Magic Number, which uniquely identifies each Expert Advisor‘s trades on the chart, preventing conflicts when multiple advisors operate simultaneously.
These functional features and parameters make the Expert Advisors from www.expforex.com powerful tools for successful automated trading in the Forex market.
Advantages of Buying Ready-Made Experts vs Programming Your Strategy
Exp – Templates MQL Open Source: Light Template for Creating Expert Advisors
EAPadPRO
Information Panel for all our advisors and utilities for the MetaTrader terminal.
Detailed Instructions on the basics of managing and using the EAPADPRO Panel in our trading Expert Advisors.
Friendly, Intuitive User Interface for convenient and successful work with our utilities.
Parameter: Get a Signal Bar
Shift (0,1,2…..) Bar Number.
This parameter represents the number of bars from which your indicators will take signals. Specify the following signal detection parameters when ordering an Expert Advisor:
- Open a deal immediately after the signal appears;
- Wait until a signal on the closed bar is formed and open a deal only at the opening of the following bar.
Some indicators have a clear definition of which bar triggers a signal due to their algorithms. C
onsidering the accuracy and correctness of order execution, a deal should be processed only on the closed bar, i.e., the shift=1 parameter.
If it is necessary to open a DEAL (Position) immediately on the current bar as the signal appears and the indicator allows it, then you should set shift=0.
Signal Bar number (shift) for indicator. Drawing Indicators. Which bar to choose for signal?
Function: Reverse of Strategy Signals
ReverseSignal (true – false) Enabled/Disabled.
This parameter represents the reversal of the signals from your indicator(s).
If your Expert Advisor operates based on a specific algorithm or definite signals from the indicator, you can change BUY/SELL signals without reprogramming them.
For example, ReverseSignal=true.
Your indicator gives a signal to BUY, but the Expert Advisor will open a SELL deal.
Your indicator gives a signal to SELL, but the Expert Advisor will open a BUY deal.
Parameter: Magic Number
Magic (0….99999) Number.
This parameter represents the unique number assigned to Expert Advisors on the chart. If you use multiple Expert Advisors on different charts, you need to assign them unique numbers to avoid confusion and errors.
For example, if you use one Expert Advisor with different settings, you should assign a unique magic number to each instance of the Expert Advisor.
Additionally, this parameter should be changed for different currency pairs to work with detailed reports and understand which currency pair is used by each Expert Advisor.
Parameter: Stop Loss of the Deal
StopLoss (0…) in points.
This parameter represents the Stop Loss for each position. It defines the number of loss points at which a deal will be closed.
0 – the parameter is disabled, and the Stop Loss of the deal will be set to 0.
This parameter should be set to no less than the minimum allowed stop value on your server.
If the parameter is set below the minimum allowed value on the server, the Expert Advisor will display error 130.
Metatrader Error Codes – MQL error codes received by the trading expert in the terminal. Solutions.
Parameter: Take Profit of the Deal
TakeProfit (0…) in points.
This parameter represents the Take Profit for each position. It defines the number of profit points at which a deal will be closed by the server.
0 – the parameter is disabled, and the Take Profit of the deal will be set to 0.
This parameter should be set to no less than the minimum allowed value on your server.
If the parameter is set below the minimum allowed value on the server, the Expert Advisor will display error 130.
Metatrader Error Codes – MQL error codes received by the trading expert in the terminal. Solutions.
Parameter: Slippage of the Deal
Slippage (0….) in points.
This parameter adjusts the price slippage when opening a deal.
In the real/live market, prices move very quickly. When sending an order to the server, the server might respond with changed prices, requotes, etc.
To prevent sending multiple orders to the server, you can set the allowed Slippage for opening deals.
For example: Slippage=10.
When sending an order to open, the price was 1.1234. But the price changed to 1.1238. In this case, the deal is opened at 1.1238 without requotes!
However, if Slippage were set to 0, the deal would not be opened, and the server would return a Requote error (New prices).
Function: Closing Deals by an Opposite Signal
ClosePosIfChange (true – false).
This parameter adjusts the ability to close an opposite deal when opening a new one.
If your indicator generates BUY – SELL – BUY – SELL signals, and this parameter is enabled, the Expert Advisor will close the opposite deal before opening the new one.
Parameter: Number of Positions per Signal
OnlyOnePosBySignal (true – false) Enabled/Disabled.
This parameter allows you to choose between single or multiple positions, enabling the possibility to open one or several positions.
If this parameter is enabled, only one position is opened per signal on each bar.
For example, if your strategy generates consecutive BUY signals on each new bar, and OnlyOnePosBySignal=true, then a BUY deal will be opened on each bar when the signal appears.
If OnlyOnePosBySignal=false, the Expert Advisor can open only one BUY deal and one SELL deal and wait until they are closed.
Parameter: Fixed Lot
Lots (0.01 ………) – setting a fixed lot size for all deals.
This parameter specifies the number of lots for opening deals. The lot size is fixed and applied to all deals.
You should consult your broker for the minimum allowed lot size for opening a deal.
Function: Dynamic Lot
DynamicLot (true – false) LotBalancePcnt (percentage of free margin).
These parameters adjust the automatic calculation of lots based on the available free margin.
A detailed description of this parameter is provided in the Autolot article (lot calculation using the current balance).
My Autolot Secrets. Dynamic Lot or Autolot.
Parameter: Martingale
Martin (1….) – Martingale Ratio.
This parameter allows you to apply the Martingale principle to your strategy.
This principle implies that the volume of a deal following an unprofitable deal will be calculated as Lot * Martin ratio.
If the parameter is set to 1, Martingale is not used.
For example: Lots = 0.01, Martin = 2:
- BUY deal (0.01) closed with loss or by Stop Loss.
- The next deal will be opened with a lot size of 0.01 * 2 = 0.02.
- If the previous deal is closed by Stop Loss, then the following deal will be opened with a lot size of 0.04.
If the previous deal is closed with profit or by Take Profit, then the following DEAL will be opened with the initial lot size of 0.01.
Function: Working Time of the Expert Advisor
OpenHour (in hours), OpenMinute (in minutes), CloseHour (in hours), CloseMinute (in minutes).
These parameters adjust the working time range of the Expert Advisor, which applies only to opening new positions. Trailing Stop and Break Even functions will operate independently of this range.
For example, if you want the Expert Advisor to trade only from 2 p.m. to 6:35 p.m., then the parameters will be set as follows:
OpenHour=14, OpenMinute=0, CloseHour=18, CloseMinute=35.
Deals will be opened only from 2 p.m. to 6:35 p.m., and the Expert Advisor will ignore strategy signals outside of this time range.
Market Time Pad. Indicator for MetaTrader with trading sessions
Function: Classic Trailing Stop
TrailingStopUSE (true – false), IfProfTrail (true – false), TrailingStop (in points), TrailingStep (in points).
These parameters enable or disable the automatic tracking of positions by moving the Stop Loss into the profitable zone.
TrailingStopUSE – enables/disables the trailing stop function.
IfProfTrail – if true, the Expert Advisor starts modifying the Stop Loss only when the position reaches break-even. If false, the trailing stop starts working immediately after opening the position and adjusts it as the price moves.
TrailingStop – the distance in points from the current price to the desired Stop Loss. This parameter can be set below the minimum allowed value on your server.
TrailingStep – the step size for modifying the Stop Loss.
For example, the Stop Loss will be modified by each TrailingStep point as the distance reaches TrailingStop points from the current price.
Function: Closing by Total Profit/Loss
These parameters adjust the ability to close deal(s) by the specified instrument and magic number when reaching one of the following conditions:
- TypeofClose=1 – closing by Profit: 1 – Dollar, 2 – Points, 3 – %Equity, 4 – %Balance;
- CloseProfit=false – do not close on profit;
- Profit = 10 – number of units (depending on TypeofClose) required to close profit;
- CloseLoss=false – do not close on loss;
- Loss = -10 – number of units (depending on TypeofClose) required to close loss;
- OFFAllEaAfterClosePROF=false – disable all Expert Advisors and scripts after closing profit;
- OFFAllEaAfterCloseLOSS=false – disable all Expert Advisors and scripts after closing loss.
For example:
- If you want to close several DEALS (positions) (BUY or SELL) at a profit of 10 USD on the account:
TypeofClose=1, CloseProfit=true, Profit=10. - If you want to close several DEALS (positions) (BUY/SELL) at a loss of 200 points on the account:
TypeofClose=2, CloseLoss=true, Loss=200. - If you want to close several DEALS (positions) (BUY/SELL) at a loss of 5% of the deposit and also close several DEALS (positions) (BUY/SELL) at a profit of 10% of the deposit:
TypeofClose=4, CloseLoss=true, Loss=5, CloseProfit=true, Profit=10.
In this case, you can disable Expert Advisors after closing using the OFFAllEaAfterClosePROF and/or OFFAllEaAfterCloseLOSS functions.
Then, the Expert Advisor will disable all Expert Advisors after closing.
Function: Moving Stop Loss to Break Even
MovingInWLUSE (true – false), LevelWLoss (in points), LevelProfit (in points).
These parameters adjust the ability to modify deals by moving the Stop Loss to break even as soon as possible.
For example:
- You want to set the Stop Loss to break-even when the deal reaches a profit of 10 points:
MovingInWLUSE=true, LevelWLoss=0, LevelProfit=10. - You want to set the Stop Loss to +5 points when the deal reaches a profit of 20 points:
MovingInWLUSE=true, LevelWLoss=5, LevelProfit=20.
Therefore, the difference between LevelProfit and LevelWLoss must always be greater than or equal to the minimum stop on the server.
Questions?
If you have any questions, please ask them. We do not sell a pig in a poke.
Each of our products can be tested before purchase.
We appreciate your feedback and wishes for our products and strive to maintain high-quality standards.
Thank you for being with us!
Do you have a question?
This post is also available in: English Українська Portuguese Español Deutsch Chinese Русский Français Italiano Türkçe 日本語 한국어