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

Zepto Case study(On Track to Profitability).pptx
Zepto Case study(On Track to Profitability).pptxZepto Case study(On Track to Profitability).pptx
Zepto Case study(On Track to Profitability).pptx
aryan963438
 
PPT- Chapter 5- Cost Allocation presentation pdf
PPT- Chapter 5- Cost Allocation presentation pdfPPT- Chapter 5- Cost Allocation presentation pdf
PPT- Chapter 5- Cost Allocation presentation pdf
Kalkaye
 
wiley-cpa-review-focus-notes revieww.pdf
wiley-cpa-review-focus-notes revieww.pdfwiley-cpa-review-focus-notes revieww.pdf
wiley-cpa-review-focus-notes revieww.pdf
allysaamping
 
一比一原版(UW毕业证书)华盛顿大学毕业证成绩单学位证书
一比一原版(UW毕业证书)华盛顿大学毕业证成绩单学位证书一比一原版(UW毕业证书)华盛顿大学毕业证成绩单学位证书
一比一原版(UW毕业证书)华盛顿大学毕业证成绩单学位证书
atedyxc
 
一比一原版(ASU毕业证书)亚利桑那州立大学毕业证成绩单学位证书
一比一原版(ASU毕业证书)亚利桑那州立大学毕业证成绩单学位证书一比一原版(ASU毕业证书)亚利桑那州立大学毕业证成绩单学位证书
一比一原版(ASU毕业证书)亚利桑那州立大学毕业证成绩单学位证书
atedyxc
 
一比一原版(KPU毕业证书)昆特兰理工大学毕业证成绩单学位证书
一比一原版(KPU毕业证书)昆特兰理工大学毕业证成绩单学位证书一比一原版(KPU毕业证书)昆特兰理工大学毕业证成绩单学位证书
一比一原版(KPU毕业证书)昆特兰理工大学毕业证成绩单学位证书
atedyxc
 
一比一原版(SFU毕业证书)西蒙菲莎大学毕业证成绩单学位证书
一比一原版(SFU毕业证书)西蒙菲莎大学毕业证成绩单学位证书一比一原版(SFU毕业证书)西蒙菲莎大学毕业证成绩单学位证书
一比一原版(SFU毕业证书)西蒙菲莎大学毕业证成绩单学位证书
atedyxc
 

Recently uploaded (20)

Canvas Business Model Infographics by Slidesgo.pptx
Canvas Business Model Infographics by Slidesgo.pptxCanvas Business Model Infographics by Slidesgo.pptx
Canvas Business Model Infographics by Slidesgo.pptx
 
Zepto Case study(On Track to Profitability).pptx
Zepto Case study(On Track to Profitability).pptxZepto Case study(On Track to Profitability).pptx
Zepto Case study(On Track to Profitability).pptx
 
PPT- Chapter 5- Cost Allocation presentation pdf
PPT- Chapter 5- Cost Allocation presentation pdfPPT- Chapter 5- Cost Allocation presentation pdf
PPT- Chapter 5- Cost Allocation presentation pdf
 
Goldamn report on India's economy in 2024
Goldamn report on India's economy in 2024Goldamn report on India's economy in 2024
Goldamn report on India's economy in 2024
 
Maximize Your Business Potential with Falcon Invoice Discounting
Maximize Your Business Potential with Falcon Invoice DiscountingMaximize Your Business Potential with Falcon Invoice Discounting
Maximize Your Business Potential with Falcon Invoice Discounting
 
Consumer rights and its importance and value
Consumer rights and its importance and valueConsumer rights and its importance and value
Consumer rights and its importance and value
 
wiley-cpa-review-focus-notes revieww.pdf
wiley-cpa-review-focus-notes revieww.pdfwiley-cpa-review-focus-notes revieww.pdf
wiley-cpa-review-focus-notes revieww.pdf
 
Abhay Bhutada: A Journey of Transformation and Leadership
Abhay Bhutada: A Journey of Transformation and LeadershipAbhay Bhutada: A Journey of Transformation and Leadership
Abhay Bhutada: A Journey of Transformation and Leadership
 
how can I sell my pi coins in the United States at the best price
how can I sell my pi coins in the United States at the best pricehow can I sell my pi coins in the United States at the best price
how can I sell my pi coins in the United States at the best price
 
一比一原版(UW毕业证书)华盛顿大学毕业证成绩单学位证书
一比一原版(UW毕业证书)华盛顿大学毕业证成绩单学位证书一比一原版(UW毕业证书)华盛顿大学毕业证成绩单学位证书
一比一原版(UW毕业证书)华盛顿大学毕业证成绩单学位证书
 
Economics - Development 01 _ Handwritten Notes.pdf
Economics - Development 01 _ Handwritten Notes.pdfEconomics - Development 01 _ Handwritten Notes.pdf
Economics - Development 01 _ Handwritten Notes.pdf
 
New Stratus Corporate Presentation May 2024
New Stratus Corporate Presentation May 2024New Stratus Corporate Presentation May 2024
New Stratus Corporate Presentation May 2024
 
L1 2024 Prequisite QM persion milad1371.pdf
L1 2024 Prequisite QM persion milad1371.pdfL1 2024 Prequisite QM persion milad1371.pdf
L1 2024 Prequisite QM persion milad1371.pdf
 
一比一原版(ASU毕业证书)亚利桑那州立大学毕业证成绩单学位证书
一比一原版(ASU毕业证书)亚利桑那州立大学毕业证成绩单学位证书一比一原版(ASU毕业证书)亚利桑那州立大学毕业证成绩单学位证书
一比一原版(ASU毕业证书)亚利桑那州立大学毕业证成绩单学位证书
 
Fintech Belgium General Assembly and Anniversary Event 2024
Fintech Belgium General Assembly and Anniversary Event 2024Fintech Belgium General Assembly and Anniversary Event 2024
Fintech Belgium General Assembly and Anniversary Event 2024
 
Monthly Market Risk Update: May 2024 [SlideShare]
Monthly Market Risk Update: May 2024 [SlideShare]Monthly Market Risk Update: May 2024 [SlideShare]
Monthly Market Risk Update: May 2024 [SlideShare]
 
一比一原版(KPU毕业证书)昆特兰理工大学毕业证成绩单学位证书
一比一原版(KPU毕业证书)昆特兰理工大学毕业证成绩单学位证书一比一原版(KPU毕业证书)昆特兰理工大学毕业证成绩单学位证书
一比一原版(KPU毕业证书)昆特兰理工大学毕业证成绩单学位证书
 
What is an ecosystem in crypto .pdf
What  is  an  ecosystem  in  crypto .pdfWhat  is  an  ecosystem  in  crypto .pdf
What is an ecosystem in crypto .pdf
 
一比一原版(SFU毕业证书)西蒙菲莎大学毕业证成绩单学位证书
一比一原版(SFU毕业证书)西蒙菲莎大学毕业证成绩单学位证书一比一原版(SFU毕业证书)西蒙菲莎大学毕业证成绩单学位证书
一比一原版(SFU毕业证书)西蒙菲莎大学毕业证成绩单学位证书
 
Human Capital: Education and Health in Economic Development
Human Capital:  Education and Health      in Economic DevelopmentHuman Capital:  Education and Health      in Economic Development
Human Capital: Education and Health in Economic Development
 

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