Let's trade using computer science!


My first 100% automated and 100% accurate workflow, StrategyQuant test case

DISCLAIMER: The presented results below are still preliminary, there is still a small chance that my positive results are influenced by an undiscovered bug in the current version of SQ-X (build 118.84) or that I’ve just made a stupid mistake somewhere in my workflow resulting in a huge ‘Data Mining Bias’. However I did my best and rechecked everything multiple times…Moreover since this all is based on a relatively new ‘custom projects’ feature of SQ-X, nothing of this has been tested yet on a real account…but I think I have built a strong case supporting I could be right on this one 😉

My claim: It looks like I’ve managed to create a 100% automated and 100% accurate workflow using StrategyQuant feature called ‘custom projects’.

100% automated means: I push 1 button before going to bed, and every morning my workflow automatically generates, validates and selects few new strategies which are ‘ready to go’

‘Ready to go’ means: I can deploy them immediately to my live account. Without a need of further processing.

100% accurate means: Every single strategy that has been selected by this automatic workflow (~50 so far), has been profitable in the 2 years period from the generation date.

To test this all I’ve adapted my SFT method as described in this topic: See HERE.

The workflow is based on standard validation test (common knowledge) as shared by SQ team in their free courses, however with a very rigorous settings. The workflow does not use any advanced validation methods like WFA,WFM,OP,SPP. Instead a customized Monte-Carlo test is used to simulate behavior of a SPR method. No portfolio analysis is performed (some systems can be correlated).

My automatic workflow test case is split into two verification moments:
1. End of year 2014.
2. End of year 2016.

At each point in time 1 and 2, I used my workflow to automatically generate and select 20 NEW strategies (out of several hundreds thousands systems) without ANY manual intervention and then ALL of selected systems where forward tested using SFT (future data). Let me be clear on one thing: I did not cherry picked any strategies.

It seams that every single selected strategy was profitable in the period following the selected generation date. See figures blow:

Test case 1: Strategy creation @ 2014.12.31, Simulated Forward test: 2015.01.01…2016.12.31.
Real-Ticks (Dukascopy data), Real-spread (no commissions)

Test case 2: Strategy creation @ 2016.12.31, Simulated Forward test: 2017.01.01…2018.12.31.
Real-Ticks (Dukascopy data), Real-spread (no commissions)

My conclusions so far:
1. If there are no mistakes, then it seems that it is totally possible to use SQ-X automated ‘custom projects’ to automatically generate and select profitable trading systems.
2. No advanced validation/filtering methods needed. Of course these tests should only improve total result and minimize DD on portfolio level.
3. The results in SFT of >2014 are slightly better than >2016. Workflow is somehow sensitive to used data during strategy generation (due to changing market condition). It seems that years 2017 and 2018 are very difficult years for trading using selected trading type.
4. It is not 100% proven yet, but it’s a pretty damn good result so far, taking into account it’s based on a simple workflow that is using basic filtering principles.
5. Some of the strategies can be correlated, but for the sake of this investigation no manual correlation filtering has been performed. This would jeopardise the objectivity of this test case.
6. The filtering settings are very rigorous, this workflow filters out only the most robust strategies. According to my statistics only 0.05% of the generated strategies are able to pass this workflow.

– Refine the workflow and implement further strategy selection, perform correlation tests, WFM analysis and additional portfolio level related tests.


Simulated Forward Test

How to test your strategy development process to see if your are really a profitable system trader?

Hereby I want to propose a validation method called ‘simulated forward test (SFT)‘. (Note: This is not WFA or WFM, WFA/WFM is a different topic, this is also not an additional OOS test as used during strategy generation since the SFT period is not used for strategy selection)

Simulated forward test is basically a ‘walk forward’-like test of your ‘total strategy design workflow/method’.

In the last few months I tried to develop a fully automated workflow using SQ-X ‘custom projects’ module and I got very interesting results (which I will post in another topic). My small breakthrough was based on an observation that majority of traders, and even experienced traders giving online courses, just assume they are right about their strategy validation method based on their experience and their past results. There is nothing wrong with that assumption, but it can be killing for new traders or people who are trying to design their own strategy design methods.

What you normally see is the following development sequence:

1. All traders have their own ideas or methods for generating strategies and they use these methods to generate their new automated trading systems.

2. In 90% of all cases, new traders generate and run their systems on demo (or small live) accounts to see if their strategies are profitable or not.

3. This results in a ‘generate & hope’ methodology.

In my opinion the proper approach should be as follows:

1. At first you need to develop or learn a new strategy design workflow (a new system design method or process including strategy generation/testing/validation and strategy selection).

2. In order to test if your method works you go back in time and pretend to be living in the past, e.g.: 2014. This is your point of reference.

3. Then you develop a sufficient (significant) amount of strategies using your workflow using data <=2014. In this case using data >2014 is forbidden to prevent any type of ‘Data Mining Bias’.

4. Then you test ALL strategies that have passed your workflow and strategy selection on a simulated forward period (your simulated future) >2014 and verify how many of selected strategies have worked for you. You do this without cheating or fooling yourself, so you use ALL strategies that have passed your workflow successfully. You draw your conclusions based several different pass/fail criteria that are important for you e.g.: Max DD, Net Profit, Red/DD, Stagnation etc….and you write down the effectiveness percentage of your workflow e.g: 65% of selected strategies were profitable (or did not exceeded Max. expected DD) in the simulated future.

5. You repeat the whole process by selecting a different point of reference in the past e.g.: 2016. And start all over again by generating, testing and selecting new strategies. Then you test again ALL of the selected strategies in a simulated period >2016.

You can repeat this process many times, by ‘walking forward’ your whole workflow in time using historical data and see if your strategy generation method really produces robust strategies in a simulated forward period.

An example of time slots as used in a typical workflow:

Simulated Forward Test

– Point of reference (in the past) = 2014.12.31 (you are forbidden to use data > 2015.01.01 until you have generated 30 strategies that passed your workflow and selection method for live trading, this can be including portfolio building methods)

– Your first IS/OSS for strategy generation is e.g.: IS: 2008.01.01…2011.06.01 and your first OOS is 2011.06.02…2014.12.31. 

– Your second OOS2 for cure-fitting check is e.g.: 2003.01.01…2007.12.31

– All other validation tests (spread,skipping trades, MC, cross market etc..) are done using data <=2014.12.31

– You select 30 strategies and test them ALL on data >2015.01.01

After you are confident with your workflow and your results you can jump-back to present time and generate/validate and select new strategies and feel confident that selected systems have a significant chance of being profitable in the upcoming future.

Just wanted to share this because this approach has led to my first small breakthrough with my 100% automated workflow.

Conclusion: stop fooling yourself, stop generating strategies based on untested methods and stop hoping those will work out for you well in the future…

Any comments are welcome 🙂 Visit our forum HERE.



Will a free trading group help us?

How about we create our own!

After many years of EA coding for other traders (also for many of you) I think, I have seen it ALL. I have seen people creating EA’s and strategies based only on one chart screenshot or just because they have read something on a ‘forum’. Obviously it doesn’t work!

Now I’m fully convinced that the only proper way to go is automatic strategy generation and testing.

But this method is also not perfect, it is like trying to find a needle in a haystack. Learning curve takes several weeks, finding robust strategies takes several days, testing takes up to several months.

So why not to combine our efforts?

Here is my idea: I want to create our own private forum, our own trading group where we can share ideas, experiences and knowledge. A real gentleman’s (and ladies) club for serious traders.

YOU CAN JOIN HERE: Coensio’s Algo-Trading Group

I want to concentrate only on automatic strategy generation. This is how ‘they‘ do it. This is how EA vendors find their strategies, this is how professional quants and algo-traders design their strategies. 

So if there is any chance you are already using StrategyQuant platform, and you want to join this club, just let me know (reply to this email). I am looking for experienced traders and also for forum moderators.

I’m still learning this platform especially the new ‘SQ X‘ version, so the only thing I can promise you, is that I will share my knowledge for free. Starting from 2019 I will also prepare some kind of free algo-trading course.

For traders which do not know what I am talking about, please read my review of this platform: HERE. I also provide 20% discount + other bonuses for people that want to purchase this platform, but first download a demo version and see if this way of working will work for you.

ATTENTION: If you will use my discount code you will get ArrowHunterEA and CoensioMt4Charts for free: COENSIO-20-OFF-ZSHXY

You can read more on my blog. or join here:
Coensio’s Algo-Trading Group



Free Video course: How to prevent curve-fitting

And how to properly optimize trading systems

Curve-fitting is the most common mistake made by inexperienced algo-traders. This is because the MT4 based optimization is nothing else but pure curve-fitting.

Curve-fitting is a fancy name for cherry-picking (or ‘falsely’ connecting the dots), where you optimize your system using all possible combinations of all parameters and you select only the best results, the highest profits or the best looking equity charts.

This topic is so huge I can write a book about it. But let’s keep it very pragmatic for now. Because you are here to see some results. So, without going into details here is the approach that I use to keep cure-fitting minimized:

  1. Keep the number of optimized parameters as low as possible: each new parameter which is optimized adds an additional degree-of-freedom (or dimension), in which equity graph can be curve-fitted.
  2. Following the logic of point 1: avoid complex trading systems with many parameters and dependencies. Keep it simple!
  3. Split your historical data range in: ‘in-sample’ and ‘out-off-sample’ periods: the in-sample period is the longest period where you run your optimization. The out-of-sample period is the period where you will validate your settings after the optimization.
  4. Make sure you have sufficient amount of historical data. Note that you need at least 100 trades in your in-sample period, which is minimum required amount of trades needed for statistical significance. More is better.
  5. Optimize for profit-growth stability not for the maximum profit. In the end you need to see a straight equity line with stable increase over the whole testing period. (During optimization the ArrowHunterEa returns a custom ‘profit-factor’ in OnTester results column, which determines the stability of growth)
  6. Perform a robustness test on optimized parameter set. This can be done by manual ‘monte-carlo’ like simulation using the MT4 tester.

I know it is a lot of info in one post. That is why I have prepared a free video course for you with an real life example of strategy optimization.

Video I:

Video II:

Video III:



How to backtest & optimize in MT4

Just like me, many of you are using the MetaTrader platform for daily trading using Experts Advisors. However, not many people know how to backtest in MT4 properly. In this short blog I will try to explain you the logic behind the EA optimization process on a MetaTrader 4 or 5 platform. If you do not know how to run the strategy tester on your MT4 platform then there are many places to go like YouTube to learn from. This article explains only the optimizing steps needed to get the best results during the optimization.

So here we go:

  1. How to approach mt4 strategy tester optimization
  2. Is 99% tick data accuracy one big lie?
  3. What level of tick data accuracy is needed for backtesting?
  4. Putting it all together

1. How to approach mt4 strategy tester optimization?

I will explain it on a simple example. Imagine we have a given trading system with the following trading results.
Backtesting in mt4
Now imagine today is the point where we have drawn a red vertical line. Of course we can not predict the future and the only thing that we can see are the backtested results from the past. So how can we make sure the optimized EA results are not curve-fitted and the optimized EA parameters have any chances of being profitable in the future? Let’s split our optimization process in two steps.
Strategy optimization steps
Optimize a given trading strategy on a small historical data fragment, from a given date in the past (Start) until today (End). It is extremely important that the number of trades in the selected period is representative for the given trading system. You need to optimize using  at least 10% of the total number of trades which have occurred within history data range.

Test if the optimized parameters found in STEP 1 are not curve-fitted! Yes, this is my big secret magic trick, that I use in my all trading systems, so read and think about the following sentence for a while, let it sink in:

If you can predict the past = most probably you will be able to predict the future!

Basically, if I see nice results on a backtest using history data which was never used during the optimization (so called out-of-sample period), then it gives me confidence, that selected set of parameters could also be profitable in the feature.

2. The 99% tick data accuracy is one big lie!

In my early days when I was just starting my adventure in automated trading, everybody was saying (and still is) “You need to use 99% tick data to backtest properly, 90% is garbage etc..etc…”. I was like: ohh man..I need always to have 99% modelling quality! I was obsessed by tick data accuracy. I spent hundreds of dollars on tools which gave me 99% accurate tick data….but then I’ve discovered the following:

The 99% accuracy visible after a backtest is
just a number in the FXT file header!
tick data modeling accuracy
And moreover what does it mean to have 99% of accuracy? The answer is: it doesn’t mean anything! It is just representation of tick modeling quality for the broker where the tick data comes from and in almost all cases it is Ducascopy tick data.
Furthermore in most cases people will use different broker with different tick prices, spread, latency etc…So 99% backtest data modeling is a myth, but 99% data is not entirely useless, read the flowing point.

3. What level of tick data accuracy is needed for backtesting?

There is one good answer: in best-case scenario you want to use the real broker live account data ticks. However this is only possible if:
  • You are using MT5 platform and run your optimization using: “Every tick based on real ticks” mode. (Even then, most brokers provide slightly “adjusted” tick data, so no, they will not let you win that easy, hehe)
  • Your broker will provide you the real recorded tickdata from a live account. (It does not happen a lot)
  • You know how to record live tick data by your self and know how to export it to strategy tester. (Too difficult for most people)
If you can not use one of above mentioned options, then a simple alternative, is to simply test your history tick data for accuracy. The key word is: results correlation.

In order to test your historical data for accuracy just run the following simple test:
  1. Run your (or any other) EA on a live account on a selected broker. To minimize the potential losses minimize the lotsizes of open positions.
  2. Collect the live trading results for at least few days (or even weeks) in order to capture different market moods and events.
  3. After that, backtest the same EA using exactly the same EA settings and using the same time period! (In this step you can use 99% modeling or the tick data you currently have)
  4. See how big are the differences in trading results between live and backtested data.
  5. If the difference in all critical parameters such as: number of trades (very important), drawdown and profit etc..are not that big, then your history tick data is sufficient to be used in optimization and backtesting. If the differences are significant, then you need to test it on a different broker or using different source of tick data.

4. Putting it all together

Trading strategy optimization and accurate result prediction is not an easy task, however it can really be achieved with a little bit of effort and practice. In order to achieve some level of confidence in your backtest, you need to make sure:
  1. Your EA settings are not curve fitted
  2. Trading results are also profitable outside your optimization period (in the past or the future)
  3. There is a good correlation between results from backtesting and optimization and the your live account
*** Bonus tip: The most important characteristic I’m using during selection of the best EA settings is the trading curve-shape! Ideally I want to see a straight line in upwards direction with as many trades as possible. If resulting trading curve has many dips (DrawDowns), then it means the strategy is risky since theoretically you could start your live trading precisely on a top before an upcoming DrawDown period and so blow up your account before making any profit. See a simple comparison between two different results below:


P.S.: do not forget to like or share this article!

How to trade news

As you probably already know, there are many successful traders that trade on forex news from fundamental point of view. However, most of the traders get the concept of ‘news trading’ totally wrong and lose their money time after time. This is because they base their trading decision only on the fundamental market laws and fundamental analysis.

My statement: Trading by blindly following fundamental analysis is totally wrong!

In this article I will show you:

1. Why fundamental analysis does not work like you think it should?

Most people think that they can base their trades on a general fundamental view on the market and use few basic economic laws to predict the market direction. A simple example: when FED (The US Federal Reserve) raises the interest rates, the basic economic law says that the dollar should go up. This is because in this case, the dollar will become an attractive currency to hold (in any US bank) because of a high interest rate. In this scenario people would buy dollar and sell other currencies, dollar should go up!
fed raising rates
So let’s look at a real life example on what market does when FED announces a rate hike. For this example let’s look at the FOMC (Federal Open Market Committee) that took place on 15 March 2017 (Ms. Janet Yellen in the figure above). I have selected this example because March 15 was a very interesting day for a currency trader (but also for me personally). Below a screenshot from ForexFactory calendar:
FOMC news announcement
Click here to zoom in image

On that day, during a press conference at 8pm (CET time) the FOMC announced a new rate hike. The basic laws of economics say:

“When US interest rate goes up = dollar should go up = EUR/USD should go down”

So let’s look at the EUR/USD chart on that day in the evening:EURUSD rally
Click here to zoom in image

And the EUR/USD went up?? I guess many traders who were hoping to get few pips of profit on a stronger dollar were quite surprised 😉 So what happened here? Apparently the market did not read the book called: “basic economics” and the EUR/USD pair went up instead of down?

And this is where the most traders are losing their money. Because one thing that most traders do not know, is that there is a huge difference between ‘expected news‘ and ‘unexpected news‘ events! When analyzing the
EUR/USD price movement on that evening, we can see that two different news events happened almost simultaneously:

A. Expected news: (News with already expected outcome) FED raised the US dollar interest rate during the FOMC meeting. This was ‘expected news’, because long before this news event, in previous weeks and days, there were many market rumors, that Ms. Janet Yellen from FED will finally announce another ‘rate hike’ during her next presentation. And the most of analysts gave up to 80% of probability of rate hike long before the FOMC meeting took place. Basically this interest rate raise was already ‘priced in’ by the market and all smart traders long before the news event on March 15.

B. Unexpected news: (News with unexpected outcome) On the other continent (in Europe), Dutch parliament election were taking place (in The Netherlands). And there was a big element of surprise related to that event, because nobody knew if Dutch populist party PVV would win or lose those elections. In case of winning this would be a very negative signal for Euro-zone and Euro would drop very hard. However it turned well for all of us (especially me since I am an emigrant living in The Netherlands) and the populist party PVV did not win those elections! On that day I was watching the Dutch television with my laptop on my lap and just in few seconds after first official exit-poll was announced the Euro went up like crazy!
forex major news event

Very important note: in most cases the ‘unexpected news‘ is not a direct ’cause’ of the market move, but rather just a catalyst of market forces that were already in place. Secondly, the only thing, we can relay on is the correlation between the ‘news’ and the ‘move’! The market moves only when the ‘news’ is supported by market sentiment (the collective herd behavior of all market participants). This is the most important sentence on this whole page. Please try to understand this, and you will become much better trader. So, in the example above, the EUR/USD went up, because the unexpected and positive news was supported by the overall bullish bias for the euro. This market behavior is can be explained by the concept called ‘teflon euro‘ (just google for it), which means that in most cases, the market will use any valid excuse (any positive news) to buy euro.      

2. How to trade the market news?

Strategy A: scalping the market directly after the news:
way to trade the news, is to trade only on ‘unexpected news’ (news with an unexpected outcome) and to enter the market very fast! In most cases the first reaction to the news comes just in minutes/seconds after the news release. After few minutes you are already too late to scalp the market and there is a big risk of pull-back since people will take their profits after just few pips of gain. In order to be very fast you need to have access to real-time information. One platform I can recommend is RANsquawk forex news service. This service provides real-time ‘no lag’ information updates, so you can trade all news without any delays and never miss any trading opportunity. If you want to read more about this service read more here:
RANsquawk banner
Promotion: Exclusively for Coensio blog readers RANsquawk offers extended 2 week trial of their great service! Contact info@coensio.com for more info.

Furthermore, my free version of hedging EA contains a news trading option that makes you able to preset trade entry conditions based on pending horizontal entry lines on chart. You need to disable recovery option by setting EnableRecovery to ‘false’ and enable news trading option by setting EnableNewsTrading to ‘true’. This is an ideal tool for trading news events. You can learn more and grab it for free HERE.

Strategy B: Trading the
correlations between the news and market moves:
This is my favorite news trading strategy, since it is easy, clear and effective way for trading the news. In this strategy you can trade the news in direction dictated by the prediction which is based on the previous news releases and previous market moves. So for example when a given forex pair move (after a news release with a given outcome) was the same or similar for all previous 10 news events, then you have an increased chance that it will happen again! Here is how it can be done:

Step 1: Find a high impact news event
In order to find all high impact news events, you can go to free
ForexFactory calendar and select only red flagged news. Then select any news event you want to trade oNews Trading step1
Click here to zoom in image

In this example let’s select ‘Michigan Customer Sentiment = UoM’ as our target.

Step 2: Find a correlation between the news and market move

This steps requires an external tool (see automatic selection below) or some data mining skills (manual selection).

Manual selection: For example you can use forex calendar filtering option to filter out only the selected news event for the past 12 months. Then you need to open a chart (on your MT4 platform) of the related currency (currency pairs) and mark all dates where this particular news event has happened. Then you need to seek for market reaction correlations by looking in which direction market has moved directly and within few hours after the news release.

Automatic selection: There are many tools that do this work for you. I’m using the “events & trade” portal which is available on my broker: markets.com. Here is how it looks like:

News Trading step2
Click here to zoom in image

This simple web portal not only tells you what are the best upcoming news trading opportunities, but it also analyses up to 12 previous outcomes and it calculates probability of profitable trading in direction dictated by the news. You can read more about this tool here: Visit “events & trade” website.
Events and trade
For this example we will target USDCAD pair which has a 80% probability (
for a profitable trade) in case when the ‘Actual’ value provided during the news will be higher than the ‘Consensus’ (the forecast) value. See figure below:
USDCAD trade prediction

Step 3: Setup your trade and wait for the news.
So in this example we can tell upfront that when the
‘UoM Consumer Sentiment’ news will result in a ‘Actual value > Consensus’, then we have a big chance that USD/CAD pair will move in the ‘BUY’ direction within 4h and 12h time-frames. Lets see what happened in this case:
News Trading step4
Click here to zoom in image

In this case the outcome from news was positive, since 98.0 > 97.1. Let’s see what was th reaction on USD/CAD on this positive news:
News Trading step3b
Click here to zoom in image

So in this case the price moved as predicted, this would result in a profitable trade!

3. How to avoid trading during news?

If you would like to avoid trading during the news releases and avoid fast market moves, you can look at my EaBlocker indicator. I have created a simple indicator that allows you to automatically disable AutoTrading during given hours and also on major market news releases.

You can read more about it on the product page: HERE.

4. Conclusions:

– To summarize we can say that forex market (like any other market) is driven by not more than three factors:

  • Long term forces dependent on global fundamental view (e.g: policy of central banks)
  • Short term rallies on unexpected news events (e.g: Geo-political events)
  • Market sentiment (I will discuss this in one of my next posts)

– For successful trading during news events you can use one of the following strategies:

– If you want to avoid trading during news, you can use my EaBlocker indicator.

Talks soon!


Follow me on Facebook:

Stocks to buy now!

Coensio score
9 Amazon AMZN Strong Buy
See TipRanks
Nvidia NVDA Moderate Buy
See TipRanks
Microsoft Corp MSFT Strong Buy See TipRanks
8 Micron MU Strong Buy See TipRanks
7 Advanced Micro Devices AMD
Moderate Buy See TipRanks
9 Google GOOG
Strong Buy See TipRanks
8 Facebook FB Strong Buy See TipRanks
8 Bank Of America
BAC Moderate Buy See TipRanks

On this blog I will share with you every single step I take while selecting only the good stocks to buy. Note that ‘buy’ is the main keyword here since this strategy covers only the good stocks that are worth buying and the companies that are worth investing in.

Here is how to find the best stocks to purchase today

To find the best performing stocks right now, you need to learn the following:

1. Why it is ‘always’ better to buy stocks

It is very simple. There are three main reasons why it is better to be bullish about stock market then to look for selling opportunities (and go ‘short’):

  • Looking at the past performance of stock indices like S&P500, Nasdaq or Dow Jones, you can easily see that when looking at the long term period the stock prices are ‘continuously’ rising. The current bull market conditions is 8years old (anno. 2017). Of course this is true for periods ‘out side’ big depressions and markets crashes, which also happen periodically.
  • The second reason is that the technology and world wide economy are growing in an accelerating way. And it is much more ‘comfortable’ to think that the best companies like: Google, Amazon or Microsoft will continue to grow in the long term.  
  • You can enjoy yearly dividend payouts! The majority of the best performing stocks pay out a nice yearly dividend up to 4%! 
bullish stocks

2. The sources of reliable information

While looking for the best stocks, you can get lost in the amount of the provided information. There are so many websites, paid portals, blogs, smartphone apps..it is hard to say which source is worth to follow and which is pure garbage. So let’s say that I have already been in this situation and I’ve already prepared a list of best places you can go to learn about the best stocks to buy. So below is my top 3:




Those three websites will give you access to the best quality stock market investing ideas and the best stock picks you can get for free. Those investing recommendations are provided by the professional hedge funds managers, Wall Street analysts and also financial bloggers. Now the ‘only’ thing you need to do is to select few high quality companies to invest in;) Reading all those articles will give you a good idea about what are the best performing companies and what stocks you should avoid buying.

So the biggest problem is that most people will get lost in the huge amount of the provided information. Since it is impossible and very unwise to follow every single stock recommendation, we need to do our own post-analysis and see what stocks are really worth buying. See next point.

3. How to do your own stock market analysis

You really do not need to have a master degree in economics to be able to tell if a given company is worth investing your money or not. There are only few key parameters (or indicator) that you need to look for while selecting best stocks to buy. Those are:
  • The overall fundamental picture of market mood and future opportunities
  • P/E ratio
  • Pervious earnings (previous performance) and earnings estimations
  • Stock price trends and sentiments (on chart technical analysis)
The overall fundamental picture of market mood and future opportunities:
All experienced traders say: “in order to be successful in trading you need to become one with the market”. This basically means that you need to be fully ‘synchronized’ with the market events and market moods = you need to be 100% up to date. Note that there are two things you need to master in your trading: Fundamental Analysis and Market Sentiments (based on technical analysis). Those two, are the most powerful tools you can use while
forecasting the next market movement. You need to learn how to do your own analysis or know where to go to find this information. Lucky for us, there are many places on the net that are providing a full day by day market coverage, my favorite two are:

P/E ratio:
Price to Earnings (per share) ratio is the most basic measure that can tell you if a given stock is cheap or expensive at a given price.

P/E= Market Value per Share / Earnings per Share

There are many places, books and online video’s that are explaining this concept (click here). If you want to know how to select best stocks to buy you need to learn about the basic concept behind P/E figure and how it can affect buying decision. The ‘rule of thumb’ says that a stock with a lower value of P/E is considered ‘cheaper’ than one with a high P/E figure. Just google it if you want to learn more.

Previous earnings and earnings estimations:
Earnings estimations for a given company can be also a very powerful tool you can use to predict the next stock price movement. Previous earnings can tell you if a given company is doing OK or not so well. My personal recommendation is to always invest your money into companies that show a stable grow in quarterly earnings and gross profit. You can go to yahoo finance website to see the previous earning numbers and also estimated figures. Below an example of Amazon stock:
Amazon Earnings
The second way to tell given stock is worth buying, is to look on earnings estimation numbers:
Earnings Estimation
When estimated number is much lower than actual or previous number, there is a chance the stock price will drop during or even few weeks before the earnings date (the date when companies release their earnings numbers). The rule of thumb tells us: “buy the rumor, sell the news”. In practice it means that if you expect good earnings numbers of given company you should buy the stock far before the official earnings date.

Stock price trends and sentiments:
There is one important thing you should know when trading stocks, forex or commodities: fundamental analysis (predictions done by professional market analysts)
does not work 100% of time, it works only when market is in a trend. There are many, many reasons for that, but the most important one is that the price movement forecast is always lagging behind the market sentiment. Quote from Seeking Alpha article:
Market Forecast
So in order to become successful trader you need to learn how to recognize when fundamental analysis aligns with a market trend or sentiment. The good start would be to master the basics of ‘Elliot wave‘ theory.

How to find great stocks just in 5 minutes each day
I can imagine that stock trading can be a little bit overwhelming for a beginner. Or that there are many people with full-time job and families with small kids, that do not have time for continuous reading, watching market news and doing market analysis. Therefore I have personally selected two options that you can use for your daily trading, when your trading time is very limited:

This is a professional, daily news letter which covers the best investing opportunities every single day.
 DailyInside Best Stocks

This is a professional portal (a search engine like google) which evaluates public stock recommendations made by professional financial analysts and bloggers. The search results are ranked by experts based on their accuracy and performance from their past predictions. Below a simple example of how a typical TipRanks search result looks like:
TipRanks Analysis
For each single stock you a considering to buy this great tool can tell you the following:
  • The current ‘buy/sell or hold’ recommendation of the best market analysts
  • The mid/long term price range prediction
  • The insider buy/sell actions (extremely strong buy or sell signals) 
  • Financial bloggers recommendations
  • The current recommendation of all experts who have already successfully predicted price movement in the past for a given stock
  • Currently trending stocks
  • Many many more….

Get My Special 10% Discount: Use Coupon Code: COENSIO

TipRanks Discount Coupon Code

Convert any MT4 indicator to an EA in an easy way.   Without Programming!

Any MT4 Indicator
Hunter EA
Automated trading system

This simple but powerful project started with a simple idea:   “How to convert any indicator to EA automatically and without programming”. So after many hours of coding and testing, here it is:

The Arrow Hunter EA V04

ArrowHunterEa cover

This EA can turn any of your fancy indicators into an automated trading system with only few clicks of the mouse. No coding or programming is required. Download DEMO version first to test compatibility with your indicator.

Many Great Features

Automated "OnChart" indicator signal detection

Automated "indicator-buffer" signal detection

Automated money management mechanism

In this mode the EA can look for new signals which are displayed by any indicator on the chart. After signal detection the EA will open a trade in direction that is suggested by the indicator.



In this mode the EA can read the status on internal indicator buffers and execute new order using a simple “if lower than” and “if greater than” logic, based on the values calculated by an external indicator (not necessary attached to the chart). 

This EA has several different modes of operation like: trade reversal on each new signal, stoploss and takeprofit, trailing stoploss and breakeven mechanism.




What is new in ArrowHunterEA V04 version?
  1. EA controls up to 5 external indicator parameters. 
  2. Indicator parameters / strategy optimization is now possible!
  3. ECN broker support. 
  4. Email or notifications on indicator signal detection.
  5. CloseAfterXBars mechanism.
  6. Advanced money management mechanism.
  7. Optimization using profit-stability factor!
  8. (Beta) Works with FxMagnetic indicator. Read more HERE.
Can I get a demo version?

Yes a DEMO version of this EA is available in the download link below. After a short registration you can test it with your favorite indicator on AUDUSD pair. Read the installation manual below!

Does it run on multiple MT4 accounts?

After purchasing the ArrowHunterEa, you will get your own Licesne Key which will be linked to your personal MT4 account. This means 1 License Key is valid only on 1 MT4 account, at a time. You can always change your MT4 accounts, by sending me an email (without any additional costs).

Which brokers are supported?

The ArrowHunterEA is compatible with all brokers that are compliant with MT4 interface. ECN accounts are also supported.

I've downloaded a DEMO version, but still do not know what to do next

Please read carefully the EA manual that is provided below. If you are not able to find proper EA settings, in order to get ArrowHunterEA working with your MT4 indicator, I am here to help you. Note that some additional costs will be applied: €20 / indicator setting. Just click on the "Contact" link in the menu above.

ArrowHunterEA is great tool, but I still do not know how to find profitable settings

My personal mission is to educate other traders about automatic (or algorithmic) trading. The fact is that most indicators will not be profitable out-of-the-box, since most systems require optimization for each currency pair. Auto-trading is not simple and requires some specialized knowledge. In the near future I will provide my advanced algorithmic trading course to people that follow me, so stay tuned (subscribe to my news letter on the main page)! B.t.w: you can always ask me questions. Just write me an email, I will do my best to answer all your questions. 


Get a free DEMO version
ArrowHunterEa demo
If you are running demo version make sure the LicenseKey EA parameter is set to ‘DEMO’ and you have entered valid email address in EmailAddr field. After that go to your mailbox and activate this product by clicking on the provided link in the welcome email. Check your spam folder!


Video 1: Installation of ArrowHunterEA (FromIndicatorBufferMode)
Download example indicator and example setting file here:

Video 2: Indicator parameter optimization example
Download example indicator and example setting file here:

Video 3: Installation of ArrowHunterEA (FromChart mode)
Download example indicator and example setting file here:

Video 4: Advanced EA optimization method part I
Note: The CoensioBBandWidthRatioIndicatorV03 indicator and setting files are available for ArrowHunterEA users only.

Video 5: Advanced EA optimization method part II
Note: The CoensioBBandWidthRatioIndicatorV03 indicator and setting files are available for ArrowHunterEA users only.

Video 6: Advanced EA optimization method part III
Note: The CoensioBBandWidthRatioIndicatorV03 indicator and setting files are available for ArrowHunterEA users only.

User Manual of Arrow Hunter EA (F.A.Q)

1. Installation and activation
2. Overview of EA parameters
3. Common issues / F.A.Q
4. Last words

1.Installation and activation

1a) Make sure the EA is installed in your local MQL/Experts directories. Depending on your system configuration this will be one of the following directories:
Instalation step 2a

1b) Make sure the Auto trading and DLL imports are enabled:

Instalation step 2b

1c) Activate your EA:

DEMO version: If you are running demo version make sure the LicenseKey EA parameter is set to ‘DEMO’ and you have entered valid email address in EmailAddr field. After that go to your mailbox and activate this product by clicking on the provided link in the welcome email. Check your spam!

FULL version: If you have purchased this product you should have received a welcome email together with a valid LicenseKey code. Enter this code into EA LicenseKey parameter and then just run the EA.

Note: If you did not get any email, check your spam folder as well.

2. Overview of EA parameters

Bellow an overview of the EA parameters and functions:

2a) ReverseOnOppositeSignal:
This parameter enables and disables the automatic trade reversal mode. For example if EA is trading ‘long’ and an external indicator displays new ‘short’ entry signal on chart (e.g.: a down-arrow), then the current BUY order is closed and a new SELL is opened immediately.
When ReverseOnOppositeSignal is set to ‘true’ the TakeProfit and Stoploss EA settings need to be configured in such way that they do not interfere with the reversal signals (e.g.: by setting SL and TP to very high values: 200pips)

2b) AnalyzeEveryTick:
This parameter enables and disables the Tick logic execution. When set to ‘true’ all logic is analyzed at each market tick, when set to ‘false’ the logic is analyzed only on new candle. Note that setting this flag to ‘true’ can dramatically slow down backtesting speed. However some indicators provide new signals within last candle and so require fast signal execution.

2c) EmaEntryFilterPeriod:
This parameter enables an additional EMA based entry signal filtering mechanism. The following figure explains its operation:
EMA filtering example

2d) SignalEntryMode:
This parameter has two options: ‘FromChart‘ and ‘FromIndicatorBuffer‘. Those options tell the ArrowHunterEA where it must look for its entry signals.

FromChart mode: In this mode the EA will look for entry signals by analyzing the objects that are displayed on chart by any external indicator. IMPORTANT NOTE: in order to make it work the displayed objects like : arrows, dots, thumbs up/down etc..must be real chart objects, and must be ‘clickable’. You can easily check if the object on chart is clickable by clicking on it and displaying its object parameters (right mouse click). See parameters in point 5.

FromIndicatorBuffer mode: This is an advanced mode of operation. In this mode the EA will access and use the internal buffers of an external indicator with a given name. The indicator buffers and their values can be displayed by pressing ‘CTRL+D’ on chart where a selected indicator is attached. This operation mode is required in case when the attached indicator does not display ‘clickable’ chart objects, but only shows the internal buffer data. Read more at point 3h) and the following.

2e) CheckPreviousCandles: (When SignalEntryMode=FromChart)
This parameter indicates how many previous candles need to be checked for potential entry signals. In most cases we only need to check up to 6 previous bars and look if there are any signals on chart. Note that this parameter becomes handy in case when you need to deal with delaying indicator, that displays delayed signals.

2f) LongArrowCommonString and ShorArrowCommonString: (When SignalEntryMode=FromChart)
This setting tells the ArrowHunterEa, what object names it should analyze while looking for valid entry signals. Note that each ‘clickable’ object has its own name and in most cases the signals share a common string like: “BUY/SELL” or “long/short”. This setting will help EA to filter out only objects that need to be used as entry signals. See figure below, where an object contains a “BUY” string as common signal name:

Convert Indicator To EA

In this case we would set LongArrowCommonString=BUY and ShorArrowCommonString=SELL.

2g) LongArrowCode and ShorArrowCode: (When SignalEntryMode=FromChart)
This setting is very similar to the ‘Long/ShortArrowCommonString’ parameter, however in this case the EA will look for chart objects with a specific code. Example:

Indicator To EA converter

In this case we would set LongArrowCode=233 and ShorArrowCode=234.

2h) IndicatorName: (When SignalEntryMode=FromIndicatorBuffer)
This parameter defines the name of selected external indicator, like: “Scapler V2.0” or “traderdream” etc..This name will be used to call the internal indicator buffers from the EA code. This is an advanced option ans should be used only by experienced users who know how to deal with indicator buffers.

2i) NumberOfBuffer1/2: (When SignalEntryMode=FromIndicatorBuffer)
Those parameters define the internal buffer numbers of the selected indicator. To display the indicator buffers you need to attach the selected indicator on chart and hit ‘CTRL+D’. Below an example of internal indicator buffers:
Indicator buffers example

The figure above shows a typical setup of the internal indicator buffers. In this case we would like to work with Buffer1 (NumberOfBuffer1=0) indicating BUY condition and Buffer2 (NumberOfBuffer2=1) indicating a SELL condition. See next point.

2j)Buffer1/2ValueGreaterThan,Buffer1/2ValueSmallerThan: (When SignalEntryMode=FromIndicatorBuffer)
After that internal buffer access is defined (see previous point), this set of 4 parameters can be used to define desired entry condition. In this example we can see that the indicator changes the value of Buffer1 from 0 to actual bid price during a ‘long’ entry condition, and Buffer2 value is changed from 0 to actual ask price during a ‘short’ entry period. We need to tell the ArrowHunterEA when to execute BUY and SELL trades. For this special example we will set the following:

Open BUY order when:
Buffer1ValueGreaterThan=0 AND Buffer1ValueSmallerThan=10000

Open SELL order when:
Buffer1ValueGreaterThan=0 AND Buffer1ValueSmallerThan=10000

This settings will tell EA when to open BUY and SELL without looking on chart objects.

2k) NumOfParameters
Defines the number of the external indicator parameters that need to be controlled by the ArrowHunterEa. Note that ArrowHunterEa supports up to 5 external parameters. The reason for this limitation is simple: optimizing more than 5 external parameters will result in too many degrees-of-freedom and so it will lead to unwanted curve-fitting.

2l) ParamXType (Param1Type to Param5Type)
Those input parameters are used to specify desired type of the external indicator parameters. The supported types are:
BOOL = boolean
INT3 = integer
DOUBLE3 = double
STRING3 = string
EMPTY3 = no value
Those 5 different input types will make possible to control the majority of the indicators.

2m) ParamXValue (Param1Value to Param5Value)
Those input parameters together with ‘ParamXType’ are used to specify the desired external indicator parameter values.

[insert_php] /* NumOfParameters = 1; Param1Type = INT1; Param1Value = “14”; Param2Type = EMPTY2; Param2Value = “”; Param3Type = EMPTY3; Param3Value = “”; Param4Type = EMPTY4; Param4Value = “”; Param5Type = EMPTY5; Param5Value = “”; */ [/insert_php]

2n) CheckPreviousBars (When SignalEntryMode=FromIndicatorBuffer)
This setting tell the EA how many of previous candles need to be analyzed while looking for a valid entry condition. (Similar to ‘CheckPreviousCandles’ setting when SignalEntryMode=FromChart).

> 2o) EA locking settings:
Some times it is desired to lock the EA during selected marked hours or close all orders at specified date. This is possible using these settings:

AllowedTradingHours: Defines the allowed trading hours separated by comma: 12,13,14,15,16,20,22,
AllowLongTrading: Disables and enables trades in ‘long’ direction
AllowShortTrading: Disables and enables trades in ‘short’ direction
MaxSpreadPoints: Defines the maximum allowed spread in points when opening new trades
TimeToCloseOrders: Defines date and time when all open trades need to be closed
OptimizeUsing1Hour: Defines if strategy tester optimization needs to be done per hour as defined by: ‘OptimizationHour’
OptimizationHour: Defines at what trading hour optimization needs to be performed when ‘OptimizeUsing1Hour’ is set to true.

2p) Common EA settings:
Those are the common EA settings, and are in most cases self-explanatory. Below the list of common EA settings:

MagicNr: Defines your selected magic number
LotSize: Defines selected Lot size for all orders
MmRiskPerc: When different than 0, the EA will calculate the LotSize automatically using the percentage of accounts balance and defined StopLoss. E.g.: set it to 2 to risk only 2% of your account balance with selected StopLoss level.
TakeProfitPips: Take profit level in pips
StopLossPips:  Stop loss level in pips
TrailingStopLossPips: Trailing stop loss step in pips, when set to 0 trailing is disabled
BreakEvenPips: breakeven level in pips from entry price, when set to 0 break even is disabled
CloseAfterXBars: when set to’X’ bars the EA will close all open positions ‘X’ bars/candles after the opening candle
SlippagePoints: slippage level in points
SendEmailOnSignal: When set to ‘true’, email notification is send upon each positive indicator signal detection
SendNotificationOnSignal: When set to ‘true’, a MT4 notification is send upon each positive indicator signal detection

3.Common issues / F.A.Q

3a) ‘I can not download my DEMO EA, and my browser displays strange code’:
This ‘page of code’ is the actual ArrowHunterEA in ex4 format. This means your browser does not recognize this binary ex4 format, in that case you need to safe this page of code as ‘CoensioArrowHunterEaV041.ex4′. Please do not change the name of this file it will not work under a different name.

3b) ‘I enter my email address in EmailAddr filed but do not received any email’:
Please make sure you enter a valid email address! I see a lot of people entering fake email addresses with hope that EA will activate itself. Check also your spam folder for any messages from: coensio.com.

3c) ‘I got an activation link in email, but the link does not work saying ‘Undefined offset’:
This is probably ‘link formatting issue’ :
“Undefined offset: 1 in /public/sites/www.coensio.com/ea/FreebieDB3ArrowHunter/FreebieDB3ArrowHunter.php on line 71.”
In order to fix this please copy the whole activation link from email and paste it to any text editor, remove all “white spaces and ‘%20’ codes”, examples:


Solution1: As you can see this is not a valid link, copy it and paste manually to your browser and remove ‘%20’ characters from link:

3d) ‘How can I see that my EA is initialized properly?’:
You can see it by displaying the ‘Experts’ tab on your MT4 platform, if everything is ok you should see the following:

4.Last words

Please note that this project is not an easy EA to work with and it requires some patient and practice. If you will find any bugs or errors please let me know and I will fix it for you. And finally:

If you will find a profitable setting + indicator please share it here with our great community!


P.S.: and do not forget to like this page 😉

Hi fellow traders!

One of the most frequently asked questions I get from my blog readers is how to handle market spread when opening new orders using MetaTrader platform. So in this section I will try to illustrate how I handle Spread vs Stop Loss and Take Profit levels. So let’s first look in the MQL4 manual (MQL4 is the programming language of MT4).

Source: https://docs.mql4.com/trading/ordersend ordersend with stoploss

In the example above a ‘Buy’ order is opened at ‘Ask’ price, with a StopLoss and TakeProfit levels equal to minimum allowed StopLoss distance from the current ‘Bid’ price. Using the ‘Bid’ price as reference for SL/TP levels, is the recommended way of opening orders, but is this really the best way?..So it depends on your risk-reward ratio. Most of my own trading systems require a risk-reward of 1:1, so for example: StopLoss = 10 Pips and TakeProfit = 10 Pips. Let’s see what would happen if I have followed recommendation from the MT4 manual and used ‘Bid’ price as reference point for my TP and SL levels: In this configuration, with assumed spread of 2 Pips, my EA would make only 8 Pips hitting profit and would loss 12 Pips when hitting my StopLoss level. If my trading system had a 50% winning ratio I would be only losing my money!

So how to deal with spread when opening new market positions?

The answer is very simple: Always use your entry price as SL and TP reference. This means using ‘Ask’ for Buy orders and ‘Bid’ levels for ‘Sell’ orders. In this configuration the EA will always win and lose the same amount of money. Using this approach you need only a winning ratio of 51% in order to be profitable on the long term. (this of course not including slippages and broker commissions).

However, there is a big ‘BUT’ for this strategy! You should avoid spread widening, which can be introduced by your broker e.g.: during high volatile events like market news release. The code below show how to avoid spread widening and how to set SL and TP using entry levels.

bool OpenBuy()
   //Get new market prices
   //Define lot size
   double Lots = 0.1;
   int LotDigits = (int) - MathLog10(SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_STEP));
   double LotSize=NormalizeDouble(Lots,LotDigits); 
   //Calculate and check spread  
   double MaxSpreadInPoints = 50; 
   double Spread = Ask - Bid;
   //Define allowed slippage
   int SlippageInPoints = 20;
   //Define TakeProfit and StopLoss levels 
   double TakeProfit = NormalizeDouble(Bid+Spread+10*PIP,Digits);
   double StopLoss = NormalizeDouble(Bid+Spread-10*PIP,Digits);;

   Ticket=OrderSend(Symbol(),OP_BUY,LotSize,Ask,SlippageInPoints,StopLoss,TakeProfit,"Spread Test",MagicNr,0,Green);
      Alert("Buy Error: " ,GetLastError());

bool OpenSell()
   //Get new market prices
   //Define lot size
   double Lots = 0.1;
   int LotDigits = (int) - MathLog10(SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_STEP));
   double LotSize=NormalizeDouble(Lots,LotDigits); 
   //Calculate and check spread  
   double MaxSpreadInPoints = 50; 
   double Spread = Ask - Bid;
   //Define allowed slippage
   int SlippageInPoints = 20;
   //Define TakeProfit and StopLoss levels 
   double TakeProfit = NormalizeDouble(Bid-10*PIP,Digits);
   double StopLoss = NormalizeDouble(Bid+10*PIP,Digits);;

   Ticket=OrderSend(Symbol(),OP_SELL,LotSize,Bid,SlippageInPoints,StopLoss,TakeProfit,"Spread Test",MagicNr,0,Red);
      Alert("Sell Error: " ,GetLastError());

As you can see only 'Buy' orders need an additional entry level correction, since 'Sell' orders are using 'Bid' as entry price. The following figure shows the outcome of this approach: 1:1 risk-reward example
The EA based on this strategy always wins and losses equal amount of money, which in this example is equal to $10.

That's it;)

Let’s talk about 2% risk rule

Here is why you should always follow the proportional risk management rule. Let’s consider two simple examples:

1. Proportional growth: Trading on $10000 using proportional risk of 2% per trade
2. Linear growth: Trading on $10000 using fixed lotsize of 0.1Lot and 200 pips StopLoss (= 2% of initial balance)

Just for this example we will simulate a sequence of 100 wining and 100 losing trades (n=0 to 100).
proportional risk management winning trades proportional risk management losing trades
We can clearly see that proportional risk management not only results in a higher and faster balance growth, but also in a lower total drawndown. In case of fixed lot size the account would blowup after 50 losing trades. So why traders do not use this simple rule? Because this involves some calculation and people do not really know how to do it properly. The proper calculation is as follows:
proportional risk management calculation
Below two simple approaches to deal with this problem:

1. Implement your proportional risk strategy in your EA code

/* Variables */
double Pip,Lots,LotSize;
int StopLoss=100;
double Risk=2;

/* Define 1 Pip */ 
if(Digits==2 || Digits==4) Pip=1*Point; 
if(Digits==5 || Digits==3) Pip=10*Point; 
if(Digits==6) Pip=100*Point;  
/* Get new lot size */
/* GetLotSize function */	
double GetLotSize(int StopLossPips)
   /* Proportional risk management */
   LotSize = NormalizeDouble(((Risk/100)*AccountEquity()/StopLossPips) / (Pip/Point),2); 
   if(LotSize<MarketInfo(Symbol(), MODE_MINLOT)) LotSize=MarketInfo(Symbol(), MODE_MINLOT); 
   if(LotSize>MarketInfo(Symbol(), MODE_MAXLOT)) LotSize=MarketInfo(Symbol(), MODE_MAXLOT);
   return (LotSize);   

2. Use an online calculator as provided below:
There is one important thing that should be mentioned here. Trading using proportional lot sizes based on account balance, requires proper Risk:Reward ratio, that should be always smaller than 1:1! This means that Risk should always be slightly smaller than Reward. Let’s think about this for a minute, using a simple example below:
After 1 losing trade of 2% on a $10000 account using 200 pips StopLoss and 0.1 LotSize, the account balance will be equal to $9800. So to breakeven in the next “wining” trade (not including spread) we need to have a TakeProfit level set to: 204pips (R:R = 200:204 = 0.98), since 2% of $9800 is equal only to $196. Winning back 2% of the account balance after losing 2% is not enough to breakeven!

So that’s it! If you have any questions you can always mail me.

mt4 programming service
Short about me

Welcome to my Blog!

My name is Chris, I'm an engineer, system trader and internet entrepreneur. I hope you will enjoy my website and my free MT4 software. Do not forget to check out my blog and our forum.
B.t.w: 'coensio' (Latin) = assessing, assessment, census, estimating, opinion, rating, taxing.

Join my Discord and Twitter!
discord link twitter link
StrategyQuant with discount!
My newsletter

Subscribe to my newsletter