MQL Trendline EA
- Experts
- Martin Eshleman
- Versione: 1.30
- Aggiornato: 28 maggio 2024
Summary
This EA will trade semi-automatically based on trend lines or horizontal lines that are manually plotted on the chart by the user. It can handle any number of lines per chart and each line can have its own adjustable settings. This EA manages every line separately based on specific user 'keywords' set for each line. Since each line has it's own independent settings, this is why there are very few shared inputs in this EA. Doing it this way allows for a single EA to manage many lines and combinations of settings at the same time. This makes the EA more user-friendly.
Inputs
- See_Example_Lines - If true, the EA will draw 2 example lines on the chart to help you understand how to set the keywords for lines. You can drag the lines to where you want to see them trade, change their keywords, or even delete them and draw your own lines. They are merely example lines. Example lines will automatically be set in backtesting mode too, even if this input is false.
- The EA has all standard inputs that should be self-explanatory, such as Magic Number, max. slippage, and so on. Main EA settings are controlled with 'keywords' and not standard EA inputs.
Keywords
As mentioned above in the summary, each line can have it's own adjustable settings. These are controlled by set 'keywords' that the EA looks for. These keywords are entered into the 'name' field for each line. You can find and edit the name field for a trend line or horizontal line by highlighting the line by double clicking on it, then right clicking on the line, and then selecting either 'Horizontal Line properties' or 'Trendline properties'. You should remove the default name assigned by MetaTrader and replace it with your keywords and any values. Some keywords are mandatory and some are optional. It depends on the situation. Below is a list of the available keywords.
-
TL
Format: TL=1, TL=2, TL=3, etc...
Necessity: Mandatory
Description: This keyword is what is used to assign a unique trend line number to each trend line. The EA will use this number to categorize and manage the lines separately. For example, if you have 10 lines on the chart and each have their own settings, then the EA will not get confused since each will have its own TL identifier. This TL is also used for the order comments. So, this will help in your own analysis as well.
-
Trade
Format: Trade (by itself)
Necessity: Mandatory (if trading)
Description: This is the keyword to use if you want the EA to trade the trend line.
-
Alert
Format: Alert (by itself)
Necessity: Mandatory (if alerting)
Description: This is the keyword to use if you want the EA to alert for the trend line. There are 4 types of alerts possible which are in the EA's inputs.
-
Timer
Format: Timer=08:00-15:45 (hours:minutes-hours:minutes)
Necessity: Optional
Description: This represents the allowable time period that new trades can be opened and for alerts to occur. Existing trades will not be closed out if the current time goes outside the timer limits. They would still close out normally. Only new trades will not be made outside the allowed times. And new alerts will not occur outside the allowed times. This input must be in a valid format in order to be used properly. Do not add any strange characters or spaces to the input string. For example, 08.00, 0800, and 08 00 are not the same as 08:00. The timer is based on the broker's operating time as seen in the MetaTrader platform. The timer is not based on GMT time or your PC's time. Both hours and minutes can be used in the timer.
-
Lots
Format: Lots=0.10
Necessity: Mandatory (if trading)
Description: This is the keyword to use to set lot size of the trade. It is not used if trading is disabled.
-
SL
Format: SL=10
Necessity: Optional
Description: This is the keyword to use to set the stop loss of the trade. This input is based in Points and not Pips. This input is only used if the line will be traded. If trading and this keyword is not used, SL will simply be 0.
-
TP
Format: TP=20
Necessity: Optional
Description: This is the keyword to use to set the take profit of the trade. This input is based in Points and not Pips. This input is only used if the line will be traded. If trading and this keyword is not used, TP will simply be 0.
Keyword Examples
-
Example 1
Let's say price is below a trend line and you expect price to go up, bounce off, and reverse down. You want to set a TP of 200 Points and a SL of 400 Points.
You could use this keyword string: "TL=1,Trade,Sell,Lots=0.25,TP=200,SL=400"
-
Example 2
Let's say you see a market range and expect there to be a breakout once one of the horizontal lines is reached. You do not want a TP or SL.
You could use these two keyword strings: "TL=1,Trade,Buy,Lots=1.50" & "TL=2,Trade,Sell,Lots=1.50"
-
Example 3
Let's say price is currently below a certain important level and you simply want to receive an alert once a certain price is reached, so you can place a buy order manually.
You could use this keyword string: "TL=1,Alert,Buy"
-
Example 4
Let's say you want to trade a certain line but only after price has breached the line by 100 Points.
You could draw a parallel line above/below the important line you want to trade by 100 Points and use this as the actual trading line. Then you could use this parallel line and set this string: "TL=1,Trade,Buy,Lots=0.01"
Notes
- The keywords are NOT case sensitive. So, the keywords 'Trade', trade, and TRADE are recognized as the same.
- All alerts are standard MetaTrader alerts. Some of them will require you to input your details in the MetaTrader terminal in order for them to work.
- Screenshots are optional and meant to help with your records and analysis since they are taken before the lines are deleted. Screenshots are taken only when trading is done, but not when alerting only. They are saved in your platform's 'Files' folder. The file names are named by the order's ticket number.
- Keep in mind that once a trade or alert occurs, the EA will delete the line since it did its job already.
- This EA can be tested in the back tester in visual mode the same way as in live trading. In this case, the EA will draw 2 example lines. Just move them to where you want or delete them and just draw your lines on the chart as you normally would.
- The lines can be adjusted or moved on the chart even during EA operation. The EA reacts in real-time. You do NOT need to remove, pause, or reset the EA in order to adjust or move the lines.
- Keywords must be separated by a comma (",") but the order of keywords does not matter.
- The EA will check for available margin before placing a trade. If there is not enough available margin, the EA will skip the trade and the line will remain on the chart. It's possible there will be enough margin later and the EA can make the trade.
- The EA checks for lot size rules such as min/max lots and lot step. The EA will round up/down if needed instead of skipping the trade.
- IMPORTANT: Check out our site using the link in my profile to find other FREE indicators and EAs!
I purchased this product and downloaded to my laptop. I need this on my desktop. I reached to the developer who is not willing to support this simple process unlike other developers. MQL5 does support multiple activation but the developer is not willing to spend the time. I will change my review only when I recieve the level of support required for my request. Below are MQL5 Product Rules that developers need to obide by:
Rules of Using the Market Service
The number of free Product Activations available to the Buyer on another PC after purchasing the Product is defined by the Seller. The minimum number of such Activations is 4.
The Buyer purchases the right to activate a Product as many times as specified by the Seller at the moment of purchasing or renting this Product. For example, if a Product allows 20 activations at the moment of its purchase, the Buyers can install it on 20 different hardware + OS configurations even if the Seller will decrease this number afterwards.
https://www.mql5.com/en/market/rules