Chart Logic: Chart Automation for MT4

Chart Logic: Chart Automation for MT4

11 January 2024, 11:09
D Armond Lee Speers
0
115

Chart Automation for MT4: Put your Ideas into Actions!

If you are trading with MT4 and you're not a programmer, there is very little you can do in terms of automation.  Apart from the things you can do manually (open/close trades), you can put in pending orders (open a buy/sell if price gets to this level); and you can put alerts on the chart.  That's it.  But what if you want to put a little more logic than this?  If price closes above Yesterday's High, and then closes below Yesterday's High, then open a sell.  Or if I'm in BUY and RSI goes below 30.0, then send me a notification.  Or more generally, if A, B and C are true, then do X and Y.  If someone hasn't coded a script, indicator or EA for you that does exactly what you want, then you're stuck watching your charts for these conditions to occur so you can perform these actions manually.


Building Blocks

Chart Logic is an EA for MT4 that lets you define conditions about things on your charts, and when all of the conditions are true, perform the actions.  Conditions can be about a wide range of things, like candle data (high/low/open/close, as well as calculated data like top/mid/bottom, wick sizes, bull/bear candles, etc.), technical indicators, time of day, account information, trade information and so on.  Actions can be sending alerts or notifications; open/close trades or positions; draw objects on your charts (lines, text, rectangles, etc.); and more.  Now, you can simply define the set of conditions to test and the actions to perform.  

Building Blocks


Strategies

The conditions to test and actions to perform are grouped together in a "Logic Set."  When all of the conditions are true, all of the actions are triggered.  You can also combine Logic Sets into a Strategy, which you run on one or more charts.  You tell the Strategy what symbols you want it to run on and (if it's trading) give it a magic number, and activate it.  Chart Logic will run an instance of your strategy on every chart it's configured for, in memory, regardless of what chart it's running on.  You can safely change charts while a Strategy is running and Chart Logic will keep track of everything without missing a beat (er, tick).

Chart Logic main window


Testing Chart Logic Strategies in the MT4 Strategy Tester

Strategy files can even be tested in the MT4 strategy tester, so you can see how they perform and improve them incrementally.  You can save Chart Logic files to disk and reload them or import them into other Strategies.  I have been building a library of Conditions in Chart Logic that each handle some discrete bit of automation, and then I can re-use them in strategies that I'm developing when I need them.  This includes common functionality like showing BE lines on charts, a trade or position panel (depending on the trading logic of a strategy), target lines for open positions, ADR lines, key level lines and so on.  I also have various approaches for entry conditions that I am exploring, such as simple price action signals (swing high, swing low, higher high then close below the swing low as a short entry signal), which I can simply drop into a strategy.  Don't like that signal?  Then simply adjust it to suit your own logic.  You can develop complete trading strategies based on your own ideas, not limited to what was coded in someone else's EA.  Chart Logic is, in effect, a rules engine for programming declarative statements about chart conditions and performing actions on your charts.

CL in the Strategy Tester

Strategy Tester Graph


Use any Third-Party Indicators in Chart Automation!

One of the types of conditions in Chart Logic is the Indicator Condition.  There are a dozen or so built-in indicators available, which means that the Indicator Condition dialog has all of the necessary parameters for these indicators available for you to adjust to your preferences.  But what if you want some other indicator?  There is the "custom" indicator type available, which lets you take any third-party indicator and add it into your Chart Logic strategies.  As long as the indicator exposes its data correctly in MT4, you can access its data buffers and use its data.  You can tell if an indicator is exposing its buffers correctly by displaying the Data Window in MT4 and putting the indicator on a chart.  Its buffers will be displayed in the data window.  You can pass custom parameters to the indicator, test it out live to verify that your connection to the indicator is working correctly, and then integrate the data from this indicator into your EA logic.  

Custom Indicator type

Now, any third-party indicator can be easily integrated into your custom trading logic.  If you have an indicator you rely on but it doesn't do something you want, then you can build some logic around it.  Want to get notified when your indicator gets to some state but it doesn't support alerts or notifications?  Solved.  Or, you want to use data from the indicator as a market condition for an entry, or as a signal to open/close trades?  Done.  If you can describe it in terms of Conditions and Actions, you can automate it.  Achievement unlocked!


Chart Logic Files Library and Community

There is a playlist of videos available on the YouTube channel to demonstrate the capabilities and usage of Chart Logic features, which you can view here.  

There is also a website where the features of Chart Logic are documented, and where we are building a library of Chart Logic files to demonstrate specific functionality (this is just getting started, but it is sure to grow!). You can study these to see how things are done, and use them in your own logic, either as-is or as a starting point for more sophisticated logic.  The whole point is you may not agree with how I've shown something working and want to change the behavior; it's up to you!  There will be a library of strategy files designed to trade some standard trading strategies (Bollinger bands, moving average crossover, ADR pullback, etc.), but these are more designed to demonstrate what CL is capable of than to be used as live trading strategies.  You can also upload your own CL files to the library to share with other members of the CL community.  Now you can write, test, share and run files for MT4, all without writing a single line of code.  Chart Logic may be the last EA you ever need to buy!

Chart Logic Forums

What will you automate with Chart Logic?  Put your Ideas into Actions!



Share it with friends: