SlideShare a Scribd company logo
1 of 4
Download to read offline
MT4 EA Programming
If you have a profitable manual trading strategy, you can completely automate it. This will give you several advantages:
1. You will be able to test your strategy on historical data in fully automated mode, using MT4 tester.
Backtest will help you to find all weaknesses and improve strategy. For example if your strategy has loses on
certain days or hours, you can add day filters or time filters. Or if your strategy has not often repeat losing
trades (losses series), you can increase the size of the lot after each losing trades. Etc.
Possibility to define work days of the week
• MondayOn = true;
• TuesdayOn = true;
• WednesdayOn = true;
• ThursdayOn = true;
• FridayOn = false;
• SaturdayOn = false;
• SundayOn = false;
Trade time to open order from hh:mm to hh:mm
example: from 6:30 to 22:45 by ServerTime
Close open orders at CloseTime (CloseTime is external param)
a) only profitable
b) only losing
c) all
2. You can try other different features, which can improve your trading strategy
Dynamic lot calculation
a) as percent of Account Balance
b) as percent of Accout Equity
c) as percent of Account FreeMargin. So on increase of Account Balance/Equity/FreeMargin the lot size will growth too
Dynamic lot calculation with RiskPcnt option
You will enter an initial risk % of equity you can lose if StopLoss is triggered.
So if StopLoss = 50 pips, AccoutnEquity = 5000 and RiskPcnt = 10.0
then you will pay only 500$ on StopLoss.
Dynamic lot calculation by Martingale theory.
New lot will be multiplied by 2.0 (LotFactor = 2.0 is external parameter)
if previous lot was closed in loss.MaxLot of series will be second external parameter.
Make StopLoss, TakeProfit, TrailingStop hidden to brokers
In this case EA will manage Hidden (or invisible) stops
Standard (or visible) stops will be available too
Breakeven function
Moves StopLoss to breakeven level when trade is in profit by X pips
Standard Trailing: simple trailing, stoploss follows by the market
High/Low Trailing: trailing by bars High/Low
ATR Trailing: trailing by ATR indicator
Fractals Trailing: trailing by Fractals
PSAR Trailing: trailing by Parabolic Stop And Reverse indicator
ProfitPcnt Trailing: trailing with lock of some pcnt of max. profit reached
TLine Trailing: trailing by some TrendLine added manual on the chart
MA Trailing: trailing by MovingAverage indicator
3. You will be able to optimize your strategy (parameters of indicators, stop loss, take profit) on historical data
in fully automated mode, using MT4 optimizer. You also can re-optimize your strategy time to time.
4. You also will be able to use all the benefits of automated trading, which are very difficult to implement
trading manually. For example you can improved Order Entry /Exit Speed. Since computers respond
immediately to changing market conditions, automated systems are able to generate orders as soon as
trade criteria are met. Getting in or out of a trade a few seconds earlier can make a big difference in the
trade's outcome. As soon as a position is entered, all other orders are automatically generated, including
protective stop losses and profit targets.
5. Automated trading systems minimize emotions throughout the trading process. By keeping emotions in
check, traders typically have an easier time sticking to the plan. Since trade orders are executed
automatically once the trade rules have been met, traders will not be able to hesitate or question the trade.
6. Automated trading systems permit the user to trade multiple accounts or various strategies at one time.
This has the potential to spread risk over various instruments while creating a hedge against losing positions.
Almost any manual trading system can be the automated, but you need to formalize trade rules, ie write an algorithm.
The following description will help you formalize your strategy
1.Entry point(s)
You should first consider when (rules for open position), what (symbol(s)), and how much (lot size) to buy and sell.
2. Exit point(s)
Next, consider when (rules for close position) do I want to close/hedge/lock the trade?
Wait for Stop Loss and Take Profit? Use trailing stop?
3. Number of open trades
Think about how many trades you want open at the same time.
4. Time frame
If the time frame is not specified, the time frame of the chart to which the Expert Advisor is attached will be used.
5. Repeating
As soon as a trade is open, consider whether or not the action should be repeated. Generally the answer is "no".
However, it is very important to keep in mind that the majority of traders only show the entering conditions, which
the Expert Advisor fulfils at every tick.
6. Next trade
If at least one trade is placed, please point out when a new trade can be opened: (e.g. when this one is closed; when
the floating profit of this one is at least X pips; when the conditions on signs are fulfilled once again; even on the next
bar, etc.).
7. Indicators.
Unless otherwise pointed out, all the values of signs will be handled the present bar. All the crosses will be compared
with the previous bar or the one before it.
8. Conditions.
All trading conditions must be quantitatively clear and sensible. If the conditions are impractical, they may be difficult
to program or the outcomes your program creates will be arbitrary.
9. Variety of currency pairs.
Consider how many symbols (currencies, CFDs, etc.) you wish to make use of at the same time. It is typically advised
to trade on a couple of symbols. Note - unless specified, an Expert Advisor will trade only on the currency pair of the
plan to which it is connected. If you prefer trading on several currency pairs or MT4 symbols, the following solutions
are available:.
a) Attach the Expert Advisor to several plans of different currency pairs;.
b) Program the Expert Advisor so that it deals with several currency pairs. In this case, you will not be able to optimize
and backtest your strategy.
10. Back testing and optimization. We can help you to test and optimize your expert advisor.
BJF Trading Group inc. offer MQL4, MQL5, JForex, FIX API programming
service for individual traders and brokerage companies.
Our company has developed:
• about 3000 expert advisors for MT4/MT5,
• most professional trade copiers: CopyTool and PowerTradeCopier
• most popular expert advisors: Stomper, TFOT
• arbitrage software
• DDE Tool
• Unique Elliott Indicator for MT4
• Unique Wolfe wave Indicator for MT4
• Divergence indicators Generation 3
• Social networks, PAMM, MAM, portals for brokerage companies
Will provide you with “clean” mql4, MQL5 or JForex code and the basic logic of the robot will be divided into
functions. Our professional robots never lose control and easily restore its last state after MT4 restarts. We are not
afraid of developing complex and integrated forex robots and find it interesting. We can suggest new ideas or see the
obvious errors in your description.
Please, send coding requests via e-mail: coding@iticsoftware.com

More Related Content

More from Boris Fesenko

More from Boris Fesenko (6)

Roadmap for forex brokers
Roadmap for forex brokersRoadmap for forex brokers
Roadmap for forex brokers
 
Elliott Waves Strategies
Elliott Waves StrategiesElliott Waves Strategies
Elliott Waves Strategies
 
Power tradecopier ebook
Power tradecopier ebookPower tradecopier ebook
Power tradecopier ebook
 
Forex robottfot 9 multi currencies
Forex robottfot 9 multi currenciesForex robottfot 9 multi currencies
Forex robottfot 9 multi currencies
 
FOREX ROBOT TFOT 9.0 MultiCurrencies
FOREX ROBOT TFOT 9.0 MultiCurrenciesFOREX ROBOT TFOT 9.0 MultiCurrencies
FOREX ROBOT TFOT 9.0 MultiCurrencies
 
Forex Trading
Forex TradingForex Trading
Forex Trading
 

Recently uploaded

MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdfMASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
Cocity Enterprises
 

Recently uploaded (20)

Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
 
7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options
 
Explore Dual Citizenship in Africa | Citizenship Benefits & Requirements
Explore Dual Citizenship in Africa | Citizenship Benefits & RequirementsExplore Dual Citizenship in Africa | Citizenship Benefits & Requirements
Explore Dual Citizenship in Africa | Citizenship Benefits & Requirements
 
Webinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech BelgiumWebinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech Belgium
 
Kurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
Kurla Capable Call Girls ,07506202331, Sion Affordable Call GirlsKurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
Kurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
 
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
 
Benefits & Risk Of Stock Loans
Benefits & Risk Of Stock LoansBenefits & Risk Of Stock Loans
Benefits & Risk Of Stock Loans
 
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdfMASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
 
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
 
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...
 
Premium Call Girls Bangalore Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
Premium Call Girls Bangalore Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...Premium Call Girls Bangalore Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
Premium Call Girls Bangalore Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
Business Principles, Tools, and Techniques in Participating in Various Types...
Business Principles, Tools, and Techniques  in Participating in Various Types...Business Principles, Tools, and Techniques  in Participating in Various Types...
Business Principles, Tools, and Techniques in Participating in Various Types...
 
7 steps to achieve financial freedom.pdf
7 steps to achieve financial freedom.pdf7 steps to achieve financial freedom.pdf
7 steps to achieve financial freedom.pdf
 
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
 
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
 
Bhubaneswar🌹Kalpana Mesuem ❤CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...
Bhubaneswar🌹Kalpana Mesuem  ❤CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...Bhubaneswar🌹Kalpana Mesuem  ❤CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...
Bhubaneswar🌹Kalpana Mesuem ❤CALL GIRLS 9777949614 💟 CALL GIRLS IN bhubaneswa...
 
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdf
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdfSeeman_Fiintouch_LLP_Newsletter_May-2024.pdf
Seeman_Fiintouch_LLP_Newsletter_May-2024.pdf
 
Turbhe Fantastic Escorts📞📞9833754194 Kopar Khairane Marathi Call Girls-Kopar ...
Turbhe Fantastic Escorts📞📞9833754194 Kopar Khairane Marathi Call Girls-Kopar ...Turbhe Fantastic Escorts📞📞9833754194 Kopar Khairane Marathi Call Girls-Kopar ...
Turbhe Fantastic Escorts📞📞9833754194 Kopar Khairane Marathi Call Girls-Kopar ...
 
cost-volume-profit analysis.ppt(managerial accounting).pptx
cost-volume-profit analysis.ppt(managerial accounting).pptxcost-volume-profit analysis.ppt(managerial accounting).pptx
cost-volume-profit analysis.ppt(managerial accounting).pptx
 
Lion One Corporate Presentation May 2024
Lion One Corporate Presentation May 2024Lion One Corporate Presentation May 2024
Lion One Corporate Presentation May 2024
 

Expert advisors programming

  • 1. MT4 EA Programming If you have a profitable manual trading strategy, you can completely automate it. This will give you several advantages: 1. You will be able to test your strategy on historical data in fully automated mode, using MT4 tester. Backtest will help you to find all weaknesses and improve strategy. For example if your strategy has loses on certain days or hours, you can add day filters or time filters. Or if your strategy has not often repeat losing trades (losses series), you can increase the size of the lot after each losing trades. Etc. Possibility to define work days of the week • MondayOn = true; • TuesdayOn = true; • WednesdayOn = true; • ThursdayOn = true; • FridayOn = false; • SaturdayOn = false; • SundayOn = false; Trade time to open order from hh:mm to hh:mm example: from 6:30 to 22:45 by ServerTime Close open orders at CloseTime (CloseTime is external param) a) only profitable b) only losing c) all 2. You can try other different features, which can improve your trading strategy Dynamic lot calculation a) as percent of Account Balance b) as percent of Accout Equity c) as percent of Account FreeMargin. So on increase of Account Balance/Equity/FreeMargin the lot size will growth too Dynamic lot calculation with RiskPcnt option You will enter an initial risk % of equity you can lose if StopLoss is triggered. So if StopLoss = 50 pips, AccoutnEquity = 5000 and RiskPcnt = 10.0 then you will pay only 500$ on StopLoss. Dynamic lot calculation by Martingale theory. New lot will be multiplied by 2.0 (LotFactor = 2.0 is external parameter)
  • 2. if previous lot was closed in loss.MaxLot of series will be second external parameter. Make StopLoss, TakeProfit, TrailingStop hidden to brokers In this case EA will manage Hidden (or invisible) stops Standard (or visible) stops will be available too Breakeven function Moves StopLoss to breakeven level when trade is in profit by X pips Standard Trailing: simple trailing, stoploss follows by the market High/Low Trailing: trailing by bars High/Low ATR Trailing: trailing by ATR indicator Fractals Trailing: trailing by Fractals PSAR Trailing: trailing by Parabolic Stop And Reverse indicator ProfitPcnt Trailing: trailing with lock of some pcnt of max. profit reached TLine Trailing: trailing by some TrendLine added manual on the chart MA Trailing: trailing by MovingAverage indicator 3. You will be able to optimize your strategy (parameters of indicators, stop loss, take profit) on historical data in fully automated mode, using MT4 optimizer. You also can re-optimize your strategy time to time. 4. You also will be able to use all the benefits of automated trading, which are very difficult to implement trading manually. For example you can improved Order Entry /Exit Speed. Since computers respond immediately to changing market conditions, automated systems are able to generate orders as soon as trade criteria are met. Getting in or out of a trade a few seconds earlier can make a big difference in the trade's outcome. As soon as a position is entered, all other orders are automatically generated, including protective stop losses and profit targets. 5. Automated trading systems minimize emotions throughout the trading process. By keeping emotions in check, traders typically have an easier time sticking to the plan. Since trade orders are executed automatically once the trade rules have been met, traders will not be able to hesitate or question the trade. 6. Automated trading systems permit the user to trade multiple accounts or various strategies at one time. This has the potential to spread risk over various instruments while creating a hedge against losing positions. Almost any manual trading system can be the automated, but you need to formalize trade rules, ie write an algorithm. The following description will help you formalize your strategy
  • 3. 1.Entry point(s) You should first consider when (rules for open position), what (symbol(s)), and how much (lot size) to buy and sell. 2. Exit point(s) Next, consider when (rules for close position) do I want to close/hedge/lock the trade? Wait for Stop Loss and Take Profit? Use trailing stop? 3. Number of open trades Think about how many trades you want open at the same time. 4. Time frame If the time frame is not specified, the time frame of the chart to which the Expert Advisor is attached will be used. 5. Repeating As soon as a trade is open, consider whether or not the action should be repeated. Generally the answer is "no". However, it is very important to keep in mind that the majority of traders only show the entering conditions, which the Expert Advisor fulfils at every tick. 6. Next trade If at least one trade is placed, please point out when a new trade can be opened: (e.g. when this one is closed; when the floating profit of this one is at least X pips; when the conditions on signs are fulfilled once again; even on the next bar, etc.). 7. Indicators. Unless otherwise pointed out, all the values of signs will be handled the present bar. All the crosses will be compared with the previous bar or the one before it. 8. Conditions. All trading conditions must be quantitatively clear and sensible. If the conditions are impractical, they may be difficult to program or the outcomes your program creates will be arbitrary. 9. Variety of currency pairs. Consider how many symbols (currencies, CFDs, etc.) you wish to make use of at the same time. It is typically advised to trade on a couple of symbols. Note - unless specified, an Expert Advisor will trade only on the currency pair of the plan to which it is connected. If you prefer trading on several currency pairs or MT4 symbols, the following solutions are available:. a) Attach the Expert Advisor to several plans of different currency pairs;. b) Program the Expert Advisor so that it deals with several currency pairs. In this case, you will not be able to optimize and backtest your strategy. 10. Back testing and optimization. We can help you to test and optimize your expert advisor. BJF Trading Group inc. offer MQL4, MQL5, JForex, FIX API programming service for individual traders and brokerage companies. Our company has developed: • about 3000 expert advisors for MT4/MT5, • most professional trade copiers: CopyTool and PowerTradeCopier • most popular expert advisors: Stomper, TFOT • arbitrage software • DDE Tool • Unique Elliott Indicator for MT4
  • 4. • Unique Wolfe wave Indicator for MT4 • Divergence indicators Generation 3 • Social networks, PAMM, MAM, portals for brokerage companies Will provide you with “clean” mql4, MQL5 or JForex code and the basic logic of the robot will be divided into functions. Our professional robots never lose control and easily restore its last state after MT4 restarts. We are not afraid of developing complex and integrated forex robots and find it interesting. We can suggest new ideas or see the obvious errors in your description. Please, send coding requests via e-mail: coding@iticsoftware.com