Simple Forex Tester for MT4 - Your Time Machine ...

Auto-trading fun with Bollinger bands [Novice level].

Whilst we have a fair few 'novice' posts about TA and Global Macro (aka "Fundamentals"), there aren't too many involving auto-trading. Seeing as I'm in the middle of teaching myself MQL4, I thought I'd throw this out there as discussion prompter.
By "novice", I mean someone who has moved beyond complete beginner ("what's a FOMC and a NFP?") but still not deploying robust and market ready strategies ("how does market structure affect news event response?"), so constructive criticism, informed commentary or taking the ideas and developing them further are very much the point of sharing in the first place. It's not meant to be a showcase of code, because the code is a mess!
This post got me thinking about how relatively trivial it would be to implement a Bollinger Band mean reversion autotrader.
Project Goals
My interest in the project was as a way to begin development of a skeleton EA that would use a custom indicator to implement trade signals. The point of this would be to allow for faster prototyping of visually based autotrading before taking it to the testing environment. The key advantage of this is that you can see on your charts which entries are being missed, something that is much more laborious to do via visual mode in the strategy tester.
Concept Development
So to begin the project, I sketched out the concept.
One way to trade Bollinger Bands is to trade the reversion to the mean. Intuitively, we expect that wider deviations from the mean will result in more reliable reversions to the mean. To explore this we could enter when price breaches the second SD band and then returns back inside it.
Here's the default Bollinger Band on default settings in MT4, demonstrating this sort of behaviour:
http://i.imgur.com/dK2oDO7.png
Prototyping
I want to use the indicator, and not the EA, to generate trade signals, as this is the point of the project for me. Because I'm lazy and grew up coding in basements, I opt to fiddle with the default indicator code rather than build up from scratch.
My first goal is to add two things.
Firstly, I want to add another layer of bands, because I saw a set up like that a while ago and liked it. (This is not a very good reason, and I think it costs me down the track).
Secondly, I want to add in a way to visually indicate the trade signals before we pass them to the EA.
Adding another set of bands is just a copy and paste of the existing bands. My learning point here is that I need to adjust the amount of buffers to match the number of bands I want. This comes into play for adding the trade signal arrows, as they need to go in the same sort of structure as the second lot of bands.
[I know from reading about the project goals in advance that EAs access custom indicators via iCustom(). This function can only receive the contents of one of the first 8 indicator buffers. Thus the idea will be that the buffer that marks out the trade entries on the indicator will later be used by the EA to mark out where entries should be. It's possible this is not the best way for EAs to access custom indicators , so input from more experienced coders is welcome!]
#property indicator_chart_window #property indicator_buffers 8 // <---- have to set this to match your copy and pasted buffer amount #property indicator_color1 LightSeaGreen #property indicator_color2 LightSeaGreen #property indicator_color3 LightSeaGreen // hack in (make 'em colourful. Turns out I didn't understand how the numbering worked, and indictator_color4 is never visualised) #property indicator_color4 clrWhite #property indicator_color5 clrWhite #property indicator_color6 clrRed #property indicator_color7 clrGreen #property indicator_color8 clrRed //--- indicator parameters input int InpBandsPeriod=50; // Bands Period input int InpBandsShift=0; // Bands Shift input double InpBandsInnerDeviations=1.0; // Add in for our other Band input double InpBandsOuterDeviations=2.0; // Bands Deviations //--- buffers double ExtMovingBuffer[]; double ExtUpperBuffer[]; double ExtLowerBuffer[]; double ExtStdDevBuffer[]; // hack in buffers (these buffers will store our trade signals) double SellSignalBuffer[]; double BuySignalBuffer[]; // these buffers will hold the additional bands. apologies for the naming, I didn't originally intend to share this double ExtUpperUpperBuffer[]; double ExtLowerLowerBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit(void) { //--- 1 additional buffer used for counting. IndicatorBuffers(8); // don't forget to adjust this to account for the new buffers IndicatorDigits(Digits); //--- middle line SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMovingBuffer); SetIndexShift(0,InpBandsShift); SetIndexLabel(0,"Bands SMA"); //--- upper band SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtUpperBuffer); SetIndexShift(1,InpBandsShift); SetIndexLabel(1,"Bands Upper"); //--- lower band SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,ExtLowerBuffer); SetIndexShift(2,InpBandsShift); SetIndexLabel(2,"Bands Lower"); SetIndexBuffer(3,ExtStdDevBuffer); //--- Copy and paste from above, and just change the number! Upper outer band is INDEX 4 SetIndexStyle(4,DRAW_LINE); SetIndexBuffer(4,ExtUpperUpperBuffer); SetIndexShift(4,InpBandsShift); SetIndexLabel(4,"Bands Outer Upper"); //--- Copy& paste, lower outer band is INDEX 5 SetIndexStyle(5,DRAW_LINE); SetIndexBuffer(5,ExtLowerLowerBuffer); SetIndexShift(5,InpBandsShift); SetIndexLabel(5,"Bands Outer Lower"); //--- remind myself which is which so I don't forget later: sell signal is INDEX 6!!!! SetIndexStyle(6,DRAW_ARROW); SetIndexArrow(6,218); SetIndexBuffer(6,SellSignalBuffer); SetIndexShift(6,InpBandsShift); SetIndexLabel(6,"Sell Signal"); //--- buy signal is INDEX 7 !!! SetIndexStyle(7,DRAW_ARROW); SetIndexArrow(7,217); SetIndexBuffer(7,BuySignalBuffer); SetIndexShift(7,InpBandsShift); SetIndexLabel(7,"Buy Signal"); //--- check for input parameter if(InpBandsPeriod<=0) { Print("Wrong input parameter Bands Period=",InpBandsPeriod); return(INIT_FAILED); } //--- SetIndexDrawBegin(0,InpBandsPeriod+InpBandsShift); SetIndexDrawBegin(1,InpBandsPeriod+InpBandsShift); SetIndexDrawBegin(2,InpBandsPeriod+InpBandsShift); // hack in our additional buffers, so they also start at the corect point SetIndexDrawBegin(4,InpBandsPeriod+InpBandsShift); SetIndexDrawBegin(5,InpBandsPeriod+InpBandsShift); SetIndexDrawBegin(6,InpBandsPeriod+InpBandsShift); SetIndexDrawBegin(7,InpBandsPeriod+InpBandsShift); //--- initialization done return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Bollinger Bands | //+------------------------------------------------------------------+ // all of this code is from the default indicator int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { int i,pos; //--- if(rates_total<=InpBandsPeriod || InpBandsPeriod<=0) { return(0); } //--- counting from 0 to rates_total ArraySetAsSeries(ExtMovingBuffer,false); ArraySetAsSeries(ExtUpperBuffer,false); ArraySetAsSeries(ExtLowerBuffer,false); ArraySetAsSeries(ExtStdDevBuffer,false); // hack in to make sure our custom buffers run in the same direction ArraySetAsSeries(SellSignalBuffer,false); ArraySetAsSeries(ExtUpperUpperBuffer,false); ArraySetAsSeries(ExtLowerLowerBuffer,false); ArraySetAsSeries(BuySignalBuffer,false); ArraySetAsSeries(close,false); ArraySetAsSeries(high,false); ArraySetAsSeries(low,false); //--- initial zero if(prev_calculated<1) { for(i=0; i1) pos=prev_calculated-1; else pos=0; //--- main cycle for(i=pos; i After a bit of tweaking typos, the indicator now displays two sets of bands, one at 1x SD and one at 2xSD from the mean (moving average). It also has two buffers that will use the DRAW_ARROW style to mark out potential trades.
Adding trade logic
I still can't decide if it's better to isolate the logic code in the Custom Indicator or the EA, in the long run. There seem to be performative, stylistic and redundancy issues, but for the moment the project is to put the logic in the Indicator, so that's what I did.
The fastest way to prototype this idea seems to be identifying when price closes outside of the far band.
This is trivial to achieve. We compare the close to the two outer bands, and if it's outside them, then we set the relevant trade signal buffer.
//
 double tempclose = close[i]; if(tempclose>(ExtUpperUpperBuffer[i]+10*Point)) { SellSignalBuffer[i] = high[i]+(20* Point); } else { SellSignalBuffer[i] = 0; } if(tempclose<(ExtLowerLowerBuffer[i]-10*Point)) { BuySignalBuffer[i] = low[i]-(20*Point); } else { BuySignalBuffer[i]=0; } } 
It works!
http://i.imgur.com/Ak3UkkK.png
Green arrows successfully mark out possible sell entries where price closes above the top band, and red arrows mark out possible buy entries when price closes below the lower band.
The logic can be a lot more complicated than this obviously, but the point of my project is to develop the iCustom technique, rather than make a good autotrader.
Now it's time to switch to the EA.
part two to follow
submitted by alotmorealots to Forex [link] [comments]

[Simple Forex Tester] Using Simple Forex Tester Free Forex Support & Resistance indicator download. See ... Simple Loss Recovered Forex Indicator🔥 Metatrader 4 ... BEST INDICATOR FOR SCALPING! Forex indicators mt4! - YouTube Very Accurate Scalping Indicator For Forex - Forex ... SimpleADR Metatrader 4 Indicator for No Nonsense Forex ATR ... How to test the indicator in MT4

Simple Forex Tester is a distinctive bit of software intended to provide you the greatest possible way to run-through your trading in MetaTrader 4 on historical data. By installing the software, you “open up” a new and prevailing feature on MetaTrader 4, permitting you “rewind” the markets . Any currency pair or any timeframe all the way back to 2005 (and before), and practice your ... Forex Tester 4 has a lot of the look and feel of Forex Tester (which is good). The software is very customizable and includes features like Hotkeys for almost any action and quick buy or sell orders all of which allow for quick action for fast testing. The ability to use fixed fractional position sizing is the most exciting feature. This allows ... Custom indicators in .dll format could be installed with the File → Install → Install indicator menu. After importing you can find your indicators in the Insert → Add Indicator → Custom menu. The list of built-in Forex Tester indicators: 1.1 Trend indicators: Adaptive Moving Average 2 (AMA2) Alligator; Bollinger Bands; BBandWidthRatio ... The Simple Forex Tester is a software suite that hooks DIRECTLY into the most powerful Forex trading platform on the planet – MetaTrader 4. It utilizes the power of your computer and the data feed from your broker to very accurately re-play the market TICK FOR TICK, allowing you to place trades just like the market was live! Since the Simple Forex Tester has a very simple and intuitive GUI ... Mt4 fx - Die Produkte unter der Vielzahl an analysierten Mt4 fx! Welche Punkte es beim Kaufen Ihres Mt4 fx zu beurteilen gilt! Unsere Redaktion hat im genauen Mt4 fx Vergleich uns jene empfehlenswertesten Artikel angeschaut und alle nötigen Eigenschaften zusammengetragen. Mt4 fx - Wählen Sie dem Sieger der Tester. Um Ihnen die Produktauswahl wenigstens etwas zu erleichtern, haben unsere Tester schließlich das beste Produkt dieser Kategorie ernannt, das zweifelsfrei unter allen verglichenen Mt4 fx extrem auffällt - vor allen Dingen im Testkriterium Qualität, verglichen mit dem Preis. Forex Tester (Forex Simulator) a simple piece of software for testing strategies. Forex Simulator is one of the relatively simple and user-friendly programs, which, after downloading quotes, allows you to test manual strategies at any historical period. The program is an MT4 application that allows you to combine its functions with the basic tools of the platform. The resulting summary report ... MT4 and MT5 indicators are forex market technical analysis tools dedicated soley for Metatrader platforms. In a few words, custom forex mt4 indicators can be described as mathematical formulas analysing price dynamics and generating trading signals. These signalas are used by traders for their speculation efforts and trend change predictions. Simple forex tester 2 as a Back-Testing Software. What makes this back-testing a preference over other ones is its compatibility and simplicity with the MT4 platform. There are other similar software applications as well such as Forex Tester and Trading Simulator – both of which are quite popular too. But a common drawback in both of these ... Simple forex tester free Mt4 or metatrader four is still the most popular forex trading platform around. No matter the discharge of the fifth generation of this platform chain from metaquotes software program corp. The 4th version remains going sturdy with the aid of recording paid downloads even now.

[index] [11020] [4905] [2959] [2345] [16810] [2739] [20216] [7954] [9622] [22042]

[Simple Forex Tester] Using Simple Forex Tester

This video runs down how to open Simple Forex Tester within your MT4 platform,and goes through the basics of some of it's uses For more information about Sim... New Metatrader 4 indicator, Simple Average Daily Range. The SimpleADR.ex4 indicator is now available at the following link... http://fxtoys.at/MyYoda/ --- Bo... Very Accurate Scalping Indicator For Forex - Forex Scalping Indicator for MT4 which uses arrows to show you direction. Download it free below. Get our free M... AGEA will pay you USD50 for every flaw that you find on AGEA.Trade platform. 🕵🏻‍♀️ 🕵🏻‍♀️ Our goal 🥅🥅🥅 is to be the best and we want you to help us in that mi... You can buy the FULL version of the robot from the link http://tutshara.com.ua/BS/ ===== DOWNLOAD our new Battle... How to Make Default Templates for Strategy Tester, Offline and Trading Charts in MT4 - Duration: 8:06. ClevaSys Trading 3,153 views This video shows you how to use the MT4 Forex tester for testing indictors. You can also download a great Support and Resistance MT4 Indicator from the Exper...

https://binaryoptiontrade.ilnarinuda.ml