ETAsoft Forex Generator - [PDF Document] (2024)

  • 7/22/2019 ETAsoft Forex Generator

    1/106

    Forex Generator version 4.x

    Etasoft Inc. Page 1 8/11/2011

    Forex Generator version 4.xCopyright 2009-2011 Etasoft Inc.Mainwebsitehttp://www.forexgenerator.com

    P urpose.........................................................................................................3

    Req uir ement s...............................................................................................3

    Ma in P rog ram...............................................................................................3

    mp ort Other Custo m I ndicato rs...................................................................8

    How to CombineBlocks...............................................................................11

    Ord er I d......................................................................................................14

    Ord ers.........................................................................................................15

    Using Generated EA....................................................................................16

    General Guide on BuildingBlocks................................................................17

    Special Warnings........................................................................................19

    License........................................................................................................20

    Cross Up and Cross Down...........................................................................22

    ReducingBlocks..........................................................................................22

    EA Example 1 - Diagram Using Moving Averages........................................24

    EA E xample 2 - Diagram Using Cus tom I ndicators......................................30

    EA Example 3 - Diagram Using Bollinger Bands..........................................38

    EA Example 4 - Diagram Using Parabolic SAR.............................................47

    Brokers and Accounts.................................................................................52

    Scripts vs. ExpertAdvisors..........................................................................54

    T estin g EA ........ ....... ..... ........ ....... ............. ....... ..... .......... ..... ..... .......... ..... ....56

    Cust om Code...............................................................................................57

    Martingale and Semi-Martingale.................................................................63

    Exp ort ed P aramet ers..................................................................................65

    Bar Values...................................................................................................67

    My Diagram Does Not Work. WhatsWrong?...............................................68

    http://www.forexgenerator.com/http://www.pdfpdf.com/http://www.forexgenerator.com/
  • 7/22/2019 ETAsoft Forex Generator

    2/106

    Forex Generator version 4.x

    Etasoft Inc. Page 2 8/11/2011

    DiagramExecution......................................................................................69

    Before GoingLive........................................................................................70

    MT5 and MT4Differences............................................................................71

    Custom I ndicator Mode (new since Generator version 4)...........................71

    CI Example 1 High Low as H istogram.......................................................73

    CI Example 2 Detrend P rice Oscillator as Chart Line................................74

    CI Example 3 Suppo rt and R esistance as Dotted Line..............................76

    CI Example 4 Spread as Chart T ext..........................................................80

    CI Example 5 - Moving Average as Tw o Color L ine......................................82

    CI Example 6 MACD as T w o Color Histog ram...........................................83

    CI Example 7 iTrend as Tw o Hi stogram s..................................................84

    CI Example 8 Mov ing Average Crossing as Ar row Tags............................86

    ntegrating Your Custom I ndicator into Expert Advisor..............................89

    T hir d P ar ty Cust om Bl ock s ... ....... ..... ............... ..... .......... ..... ..... .......... ..... .... 90

    License Agreement.....................................................................................92

    Limited Support..........................................................................................92

    Appendix A . List of Blo cks fo r EA and Script Generator - MT4.....................92

    Appendix B. List of Blo cks for EA and Script Generator - MT5...................100

    Appendix C. List of Blocks fo r Custom I ndicator Generator MT4............105

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    3/106

    Forex Generator version 4.x

    Etasoft Inc. Page 3 8/11/2011

    Purpose

    Forex Generator is designed to help you create Forex ExpertAdvisors, Custom Indicators and Scripts for MetaTrader platform.Youcan test your ideas without programming. Generated Expert Advisor,Custom Indicators and Scripts can help with trading orrade inautomated mode.

    Diagram based interface offers incredible flexibility. It allowsyou to create complex trading setups. But do not be overwhelmedbyall the possibilities. Always start small. First create simplediagram that just executes orders. Once you get it working build onit.

    Start diagram with just few basic blocks. Then generate ExpertAdvisor or Script. Test it make sure it works the way you expect.Add few more blocks. Test it again. Repeat.

    Requirements

    MinimumRequirements

    Software Windo ws 2000/XP/Vista/Serve r 2003/W indows 7.Hardware Pentium 1GHz, RAM 256Mbt.

    Permissions Use run as Administrator if you are not anAdministrator on that computer.

    Main Program

    Before you start your first diagram make sure to enter compilerand choose MT version using Options screen.

    Forex Generator supports both MT4 and MT5 terminals. Dependingon what version of the terminal you choose you will getdifferentset of building blocks. Therefore diagrams you create for MT4 cannot produce code that will run under MT5.

    f you do not setup compiler Generator will not be able to createExpert Advisor, Custom Indicators or Script for you.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    4/106

    Forex Generator version 4.x

    Etasoft Inc. Page 4 8/11/2011

    Target terminal is indicated on the main screen.

    Central part of the program is a diagram that helps you setupExpert Advisor and generate final compiled EA file.1. Top paneallows you to drop building blocks on to main diagram.

    2. Central pane contain diagram.3. Left pane contains propertiesand short description for selected block.4. Bottom pane containsresults for generated EA. Professional Edition also shows generatedsource code in Source Code

    tab.

    Main program screen contains most information you need to setupEA.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    5/106

    Forex Generator version 4.x

    Etasoft Inc. Page 5 8/11/2011

    All diagrams you build have to start with rounded block.Starting from it EA Generator will produce output EA file. Allother blocksconnect down from rounded block. Rounded block is thefirst function that will start Expert Advisor once it runs in theForexerminal.

    Set property 5-digit Broker to True if you are using broker thatquotes currencies in 5-digits after decimal point.

    We recommend you to use On Every Tick block in almost allsetups. This is important if you are accessing current bar valuesinyour blocks down below. On Every New Bar or Once Per Bar executesother blocks connected to it only when new bar startsorming in thechart, and therefore current bar (bar with index 0) is not fullyformed yet.

    Once you have rounded block on the diagram drop other blocksbelow it and connect them using a line from toolbar. You candraw aline following these steps:

    1. Select line tool.

    2. Select rounded tool.3. Click left button of the mouse.4. Movemouse pointer over second block.5. Click on the second block bypressing left mouse button.

    This should draw a line with arrow pointing from rounded blockdown to second block.

    There are some useful shortcut keystrokes:1. You can deleteobject from the diagram by simply pressing Delete key on yourkeyboard.2. Generate EA using F7 key.3. Generate Script using F5key.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    6/106

    Forex Generator version 4.x

    Etasoft Inc. Page 6 8/11/2011

    Use arrows to connect building blocks.

    One of the most important building blocks is a TechnicalAnalysis block. It allows you to compare two indicators, bars orconstantvalues. You can setup Technical Analysis block usingproperties _First Function and Second Function in property sheet.Onceyou click on any of those properties small button with threedots will appear in the corner of the field. Once you press it, popupwindow will allow you to setup the expression.You can compare twomoving averages or compare current bar value with previous barclosing value, etc.

    Use button to setup Technical Block expression.Tip: Instead ofusing button you can also edit property manually and enterindicator function or other expression by hand. It isnotrecommended unless you know MQL and have some programmingknowledge.

    Once you have Technical Analysis block setup attach other blocksto it.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    7/106

    Forex Generator version 4.x

    Etasoft Inc. Page 7 8/11/2011

    You can setup various technical indicators using this screen. Inthis example we are using Moving Average indicator that comeswiththe terminal. You can name exported variables and they will show upin the input parameters list when EA is used in theerminal.

    mportant: Almost everything you enter in the Generator iscase-sensitive. So MODE_SMA is not the same as mode_sma,andPRICE_CLOSE is not the same as price_close. If you make thisseemingly small mistake, nothing will work and you will probablygetnumber of compilation errors.

    Restrictions for exported variables:1. Exported variable namecan not start with the number and must contain only letters andnumbers.2. Most special symbols (except _ underscore) are notallowed in exported variable name.3. Exported variable name shouldbe unique within Expert Advisor. In other words, you can not havetwo variables namedperiod, but you can have one variable namedperiod1 and another named period2.

    4. MQ4/MQ5 reserved words can not be used as variable names.Such as double or string or int.5. Avoid using accent characters(non-English letters).

    As you can see, the list of restrictions for variable names israther long. One easy way to avoid some of the problems is to use2-3

    etter prefix for your variable names. Example: myPeriod,myShift, myMethod, etc. Here prefix my is used to form uniquenameshat do not conflict with the rules above. Instead of my youcan use initials of your first and last name as prefix.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    8/106

    Forex Generator version 4.x

    Etasoft Inc. Page 8 8/11/2011

    You can also access values of the current and number of previousbars, and compare them to values of other bars orindicatorvalues.

    mport Other Custom Indicators

    EA Generator can import some of the custom indicators found onthe Internet. Use Import Custom Indicator menu and aftermportselected custom indicator will appear in the Expression drop downlist. EA Generator can import original customndicators with sourcecode from files with extension *.mq4.

    EA Generator can not import custom indicators that are alreadycompiled and have extension *.ex4. Compiled custom indicatorsdo notreturn information on how many and what parameters they use. Thatswhy EA Generator can not import them from *.ex4iles.

    You can still call compiled custom indicators via TechnicalAnalysis block, but you need to manually enter call syntax in aform of:double iCustom(string symbol, int timeframe, string name,..., int mode, int shift). See below for sample.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    9/106

    Forex Generator version 4.x

    Etasoft Inc. Page 9 8/11/2011

    After you import custom indicator into EA Generator make sure tocopy your custom indicator source code file *.mq4into..\terminal\experts\indicators folder.

    Problem with most custom indicators found online is that theycome with zero documentation. If you drop them on the charttheyshow some graphical information but what values they return isnot documented. Without knowing what values they return it isnotpossible to understand how to integrate them into your EA. Somecustom indicators are simply not designed to be used viaExpertAdvisor. Since most custom indicators found on Internetforums are free they come with no support. Authors of thecustomndicators are usually only interested in developingindicators but not documenting or supporting them.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    10/106

    Forex Generator version 4.x

    Etasoft Inc. Page 10 8/11/2011

    There is how custom indicator might be called from ExpertAdvisor.

    Use button next to property value to setup exact syntax for thecall.

    Most parameters are usually easy to setup except mode Lineindex. This is because MT4 indicators can return up to 8different

    return values. You request specific value you are interested inby passing different value into mode Line index parameter. Ifyouhave downloaded custom indicator from some Internet forum and thereis no documentation for it, you are out of luck unlessyou know MQLand you can understand what value this custom indicator expects formode Line index parameter.

    magine that custom indicator can display up to 8 different lineson the chart. You can request value of each line bypassingdifferent value for mode Line index parameter (values rangefrom 0 to 7).

    EA Generator has no way of knowing which of 8 possible Lineindex values custom indicator uses. It is author of thecustomndicator that knows it best.

    One way to find out what value custom indicator returns is touse Print Functions to Chart building block. This block allows youtoprint results of the indicators and functions on the chart of theterminal. Simply create an Expert Advisor with only On EveryTickand Print Functions to Chart blocks. Start this new ExpertAdvisor in the terminal and see what values are displayed onthechart.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    11/106

    Forex Generator version 4.x

    Etasoft Inc. Page 11 8/11/2011

    Use Print Functions to Chart to see what values indicatorreturns.

    Another way is to have someone with programming skills look intosource code for the indicator and find used Line index value as

    well. It is not difficult. There is part of simple customindicator below:

    Sometimes Line index is easy to spot in the *.mq4 customindicator source code. Look for SetIndexBuffer() function incustomndicator source code. There might be many SetIndexBuffer()functions. In that case it is not so simple to understand whichone

    you need.

    How to Combine Blocks

    You can combine blocks so they would execute one after the otheror would execute independent of each other. If you chain oneblockafter the other then EA Generator will produce code in a way thatblocks will execute in sequence. And if block in sequence

    ails with error or conditions for its execution are not met,other blocks below it will not run.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    12/106

    Forex Generator version 4.x

    Etasoft Inc. Page 12 8/11/2011

    n this diagram both Technical Analysis blocks will be executedin generated EA. If any one of the Technical Analysis blocksmeetsconditions following below blocks will be executed as well.

    n this diagram if any one of the Technical Analysis blocks meetsconditions following below chains of blocks will be executed. Itisalso possible that both chains will execute if both TechnicalAnalysis blocks meet conditions.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    13/106

    Forex Generator version 4.x

    Etasoft Inc. Page 13 8/11/2011

    n this diagram only first Technical Analysis block will beexecuted and if it meets conditions then second Technical Analysisblockwill execute, and if it meets conditions as well thenfollowing block will execute, and so on.

    n this diagram setup is more complete with Trailing Stopattached to rounded block so it would execute every time EA isexecutedn the terminal.

    This helps you to setup various trading scenarios where blockscan be combined in different ways to generate conditional code.Ifyou want certain blocks to execute every time generated EA isexecuted in the terminal, connect those blocks to the firstrounded

    block. Typical blocks that should be executed all the time areTrailing Stop, Crawling Stop and other order management blocks.Theyshould all be connected closer to the rounded block.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    14/106

    Forex Generator version 4.x

    Etasoft Inc. Page 14 8/11/2011

    n this diagram we have connected blocks in the circle. EAGenerator will produce output file but if resulting EA is startedin theerminal it m ight be running in infinite loop (notice howarrows are connected in circle). While in some rare cases it mightbe

    desired behavior we recommend to avoid these setups and alwaysdraw arrows down and never make infinite loops.

    You can change names of the blocks on the diagram. You can alsoadd text labels on the diagram that could help you to identifywhateach block chain is setup for.

    Use menu Edit to perform various operations on the diagram. Youcan cut, copy and paste blocks in the diagram. There arealsooperations for undo and redo changes made to the diagram.Changes made to the property sheet and Options screen can notbeundone or redone using Edit menu Undo/Redo.

    Order Id

    Most order execution and order management blocks contain OrderId property. This property sets unique identifier number forneworder so later those order(s) could be identified by o rdermanagement blocks and handled separately from other orders.

    Using different Order Id you can separate long (buy) positionsfrom short (sell) positions. Order Id is most useful property whentcomes to order execution and management in scenarios when you havemore than one order open at one time. Lets say you

    have scenario where you open two orders at once, one withsmaller stop loss and take profit than the other. Now you cansetupTrailing Stop to trail only second order, simply use differentOrder Id for both orders and set Trailing Stop with Order Id fromthesecond order.Order Id is important when you want to use CloseOrder block in cases when you have more than one order open at atime.

    Then you can identify what specific order to close.

    f you ever programmed MT4 or MT5 you have probably came acrossso called magic number. Order Id is the same as magicnumber. Wehave used a term Order Id because it is easier to understand mainpurpose of this numeric identifier and its use in

    he Generator.

    f you create Expert Advisor or Script that manages orders youopen manually (example: EA that does trailing stop, trade uporbreak even on your orders), in that EA set "_Order Id" = 0 on allblocks. This way Expert Advisor will "see" orders youenteredmanually and will be able to manage them.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    15/106

    Forex Generator version 4.x

    Etasoft Inc. Page 15 8/11/2011

    Use Order Id to identify orders in cases when you have more thanone order open at a time.

    Usually it is best to start your EA small and then build on it.Use incremental development technique add few blocks to thediagram,compile EA, test it in the terminal. If it works, then add few moreblocks. In initial stages use various diagnostic blockshat printmessages to the log or on the screen when EA runs in the terminal.This helps to see that EA is actually working.

    Orders

    f ECN or STP Broker parameter is set to True market orders areexecuted in two steps: order is sent and then it is modified.Onebox such as Buy Order represents two operations. This is donebecause some ECN/STP brokers do not allow Stoploss andTakeprofit tobe sent at once, order has to be sent and then modified. But you donot need two boxes: one to open order and oneo modify it, s ingleBuy Order or Sell Order box does both operations internally. If ECNor STP Broker parameter is set toFalse market orders are executedin one step (via OrderSend).

    Most order execution errors relate to the broker specificminimal Stoploss or Takeprofit. When testing new EA set high valuesforStoploss and Takeprofit. Some Forex brokers do not allow smallvalues and will keep on throwing errors at you if StoplossandTakeprofit values are below they allowed limit.

    Pending orders have special parameters: Expiration, Ask Offset,Bid Offset.Expiration is a number of minutes for the order to bepending. If you want it to be good for an hour set it to 60. Wantit to be goodor 24 hours: 60 times 24 = 1440.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    16/106

    Forex Generator version 4.x

    Etasoft Inc. Page 16 8/11/2011

    Price Offset is special parameter that can have negative valuedepending on what type of pending order you want to create.BUYLIMIT and ASK LIMIT may have negative offset values. Lets sayyou want to open BUY LIMIT order that is 5 pips below currentAskingprice. Simply enter -5 in the property sheet.

    Using Generated EA

    Use "Generate EA.." menu to generate EA based on the diagram. Ifyou setup compiler via Options screen EA Generator willcreate andcompile EA in ../terminal_directory/experts folder. Aftercompilation restart your MetaTrader platform and your ExpertAdvisorwill be imported and show up in the list of Expert Advisors inMetaTrader.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    17/106

    Forex Generator version 4.x

    Etasoft Inc. Page 17 8/11/2011

    Once you drag and drop your Expert Advisor on the selected chartin MetaTrader platform make sure to check Allow liverading.Otherwise Expert Advisor will not be allowed to open neworders.Generated EA uses symbol pair that is displayed on thechart. So if you start EA on the chart for EURUSD then it will usethat pairor all the orders and technical analysis functions.

    General Guide on Building Blocks

    Expert Advisor you are building may be used to assist you intrading or trade b y itself in automated mode. Depending on thisyouhave to choose what building blocks to include and how toarrange them.

    EA Generator comes with number of building blocks grouped basedon they functionality:

    1. Events. Those are main blocks that start EA execution. Youcan have only one Event block in your diagram.2. Signals containtechnical analysis blocks. Technical Analysis blocks where you makea decision to open, modify or close

    traded positions.3. Order execution blocks open, modify or closepositions. You can choose to use Risk Managed blocks where youcan

    setup Risk parameter in percentage and Lots will be calculatedbased on that number and Free Account Margin.4. Order managementblocks perform various automated management tasks, such as trailingstops, etc.5. Filters perform additional filtering before your EAgets to technical analysis and order execution. You can limit yourEA

    execution to certain days of the week, certain hours and limitedspreads.6. Utility blocks help with other extra tasks such asoutput extra information in the log, on the chart or sound beep.7.Custom code blocks give you ability to add your own functions andblocks of MQL to the diagram.

    Signals and Filters are special blocks because they executeother connected blocks only if conditions are met. This allows youtosetup processing to execute certain blocks only under specialcirc*mstances.

    Some blocks in Order Management group also act as filters. Theystart with word If or Check. Such blocks are If Order Exists

    or If Order Does Not Exist. Those are useful in cases when youwant to check if certain order(s) are open and take specialactionson them. Example: check if order with specific Order Id is stillopen and then close or modify it.

    Some Expert Advisors get very complex and when you run them inbacktest it is impossible to understand why they work the wayheywork. There are few diagnostics building blocks that can help youwith that:

    1. If you are u sing MT4, run backtested EA in Visual Mode, andpause it at critical moments when trades are made, modifiedorclosed.2. If you are not sure indicators give you right signalsuse block Print Functions to Chart to see what values theyreturn.3. If you not sure certain parts of the diagram getsexecuted or not, or just want to check processing flow, use blocksPrint toLog. Place those blocks in critical spots in the diagram.Once backtested EA is paused, check Experts tab for your logentries.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    18/106

    Forex Generator version 4.x

    Etasoft Inc. Page 18 8/11/2011

    Diagram uses number of diagnostic blocks to test how ExpertAdvisor is executed.

    Blocks like Trailing Stop, Break Even or Trade Up have to beattached directly or almost directly to the On Every Tick.Theseblocks monitor every tick and perform order management on alreadyopen orders. If they are not attached in a way to runon every tick,they might miss an opportunity to open more trades (in case ofTrade Up), or miss break even opportunity (in caseof Break Even),etc.

    Break Even, Trailing Stop, Trade Up, Trade Up Trailing, etc. allshould be attached to execute on every tick.

    Note: If you use Break Even you do not need Trailing Stop in thesame diagram since Break Even also trails orders.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    19/106

    Forex Generator version 4.x

    Etasoft Inc. Page 19 8/11/2011

    Special Warnings

    There are some of the most common issues that come up whenbuilding and testing your Expert Advisor:

    1. You may try to open two orders one for long (buy) and one forshort (sell) position but Expert Advisor opens only one ofthem.This is probably because your broker does not allow hedging. Checkthe log for Expert Advisor (look under Experttab in the Forexterminal).

    2. Set Detect Broker Digits to True or make sure to setup5-digit broker support on rounded block in the diagram if youare

    using broker that uses 5 digits after the decimal point torepresent currency values.3. When using Stoploss and Takeprofitvalues make sure to set them above broker limit. Example: somebrokers limit how

    small your Stoploss can be. If you set it to 2-3 pips yourbroker may not accept values that small and your order will beopenbut will not have any Stoploss or TakeProfit set.

    4. Some brokers increase spreads when there is heavy trading andcurrencies fluctuate widely. If you are scalping or usingothertrading strategies that are very sensitive to spreads use SpreadFilter block before you open a position. This willreduce yourchance to open the position at a specific moment because EA willwait for spreads to calm down. But EA willnot open position whenspreads are huge and all your profits are eaten away by brokerspreads.

    5. I am using moving averages and want to open position whenthey cross. Why does generated EA open a Buy position?Here was nocrossing!

    There was crossing, but it has disappeared. The chart reflectsindicator values on already formed bars and you can seetheirchanges in a bar development process only using a visual testingmode or in real operation. Believe me, there wasan intersection atthe moment of position opening. If you wish, you can make the EAso, that positions will be openedupon the signals of formed bars.In such a case all signals will be visible on a chart. Use Shiftparameter in Technical

    Analysis block and set it to 1 to access previous bar. If youset Shift to 0 you will access current bar that is stillmoving.Using already formed bars (not current bar) has a negativeside effect - you might be too late for a trade because youarewaiting for the bar to form before you make a decision totrade.

    EA Generator produces Expert Advisor and shows compilationsuccessful message but when I run it in terminal it does notwork.What do I do now?Simplify, simplify, simplify...1. If you usepending orders change them to non-pending open market orders.2. Ifyou use a lot of indicators for opening and closing positionschange it to use only one simplest indicator.3. If your broker uses5 digits after decimal point, make sure to check that option in EAGenerator.4. Restart your MT terminal for changes to EA takeeffect.Once you have simplest EA working, build on it by addingmore indicators. But test every additional feature you add.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    20/106

    Forex Generator version 4.x

    Etasoft Inc. Page 20 8/11/2011

    EA Generator shows Compilation failed when I press Generate EAbutton.This is critical error. Most values you enter in propertysheet are validated and should not cause compilation to fail. Somevaluesn technical analysis block are not validated and can bemanually edited and this could be source of errors. There might besome

    parameters that escape validation and cause compilationerror.Please email your diagram saved in a file with *.ea4 or *.ea5extension. You can find our support email on our websitesupportpage.

    License

    nitially installed product comes as time limited trial. If triallicense expires you can purchase retail version online. Singleretailicense allows time unlimited product use on one computer.After the purchase permanent license key will be sent to you byemail,

    enter your new license key in the dialog screen underHelp->License menu. This will remove time limit and turn productinto retailversion.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    21/106

    Forex Generator version 4.x

    Etasoft Inc. Page 21 8/11/2011

    Make sure you enter both license key and who product is licensedto. This information will be in the email you receive afterthepurchase.

    Product comes in two Editions: Standard and Professional.Professional Edition does everything Standard Edition can do andalsoshows generated source code and produces *.mq4 or *.mq5files.

    Professional Edition creates both compiled and original sourcecode files. It also shows source code in Source Code tab.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    22/106

    Forex Generator version 4.x

    Etasoft Inc. Page 22 8/11/2011

    Cross Up and Cross Down

    n many technical analysis blocks there are cases when you wantto check when indicator crossed certain value going up orgoingdown. This is especially true when working with MovingAverages. You want to know if faster moving Moving Averagecrossedslower one from the bottom going up or from the top goingdown and based on that trading decision would be made.Same appliesto many other indicators like RSI, CCI or Stochastics. Basic ideais very simple: you use current and previous barvalues of theindicator. There is example with Stochastics:

    1. Use "On Every Tick" round block.2. Use "Technical Analysis2".3. Check Stochastics for previous bar and then check Stochasticsfor current bar.f previous Stochastics value was above and currentvalue is below some line (fixed number) then it is cross down(going down).f previous Stochastics value was below and currentvalue is above some line (fixed number) then it is cross up (goingup).

    There is also screenshot of similar setup with Moving Average(MA):

    n this example only one Technical Analysis 2 is used. For bothcross up and cross down you would need two TechnicalAnalysis 2blocks. One block would have reversed Compare and Compare2parameters in order to check for indicator line

    crossing in opposite direction.

    Reducing Blocks

    When creating your diagram try to keep number of blocks to theminimum. Large diagrams take more time to generate, and createbigresulting MT4 Expert Advisors. One way of reducing number of blocksis by using Technical Analysis 2 or TechnicalAnalysis 3 instead oftwo or three simple Technical Analysis blocks.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    23/106

    Forex Generator version 4.x

    Etasoft Inc. Page 23 8/11/2011

    Those two diagrams functionally produce the same result but oneuses more blocks.

    Resulting EA from those two diagrams will work the same way.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    24/106

    Forex Generator version 4.x

    Etasoft Inc. Page 24 8/11/2011

    EA Example 1 - Diagram Using Moving Averages

    This setup is provided for illustration purposes on how to useEA Generator and it is not a final profitable Expert Advisor.

    MT5 specific: Diagrams below use building blocks specific toMT4. The differences between MT4 and MT5 block names are minorbutimportant. One important point: blocks If Order Does Not Exist inMT4 in most cases have to be replaced with blocks IfPosition DoesNot Exist. See chapter on MT5 and MT4 differences for details.

    This simple setup e xecutes BUY order once fast moving averagecrosses slow moving average. Setup also prevents openingmore BUYorders if one is already open. So EA would not be opening ordersendlessly on every tick one after the other onceconditions areright.

    We start with On Every Tick block that marks a point where ourEA will start executing on every new tick. You can also setupaparameter based on your broker support for currencyrepresentation. If broker supports 5 digits after decimal point,setup 5-digitBroker parameter to true.

    This setup is just an example on how to setup basic buildingblocks and use Technical Analysis and Buy Order blocks together.Its not a full trading system.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    25/106

    Forex Generator version 4.x

    Etasoft Inc. Page 25 8/11/2011

    Add block Print Info To Chart to get some basic informationdisplayed on the chart.

    Press button Generate EA to make sure you have compiler setupvia Options screen and your EA gets compiled successfully.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    26/106

    Forex Generator version 4.x

    Etasoft Inc. Page 26 8/11/2011

    Add Technical Analysis block. This is where decision will bemade to open BUY position or not.

    Use button to setup each function.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    27/106

    Forex Generator version 4.x

    Etasoft Inc. Page 27 8/11/2011

    Setup indicator we use. In this case it is moving average.

    f fast moving average is above slow moving average, it is oursetup so lets execute other connected blocks below.Use button tomodify indicator function parameters.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    28/106

    Forex Generator version 4.x

    Etasoft Inc. Page 28 8/11/2011

    We do not want to continue opening more BUY positions if one isalready open. If Order Does Not Exist checks for existingBUYpositions and only executed connected blocks if there is noother BUY open at the same time.

    Setup BUY (go long) order execution block with specific lotsize, Stoploss and Takeprofit.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    29/106

    Forex Generator version 4.x

    Etasoft Inc. Page 29 8/11/2011

    Here is our simple setup in action in Forex terminal.

    That is the same setup as before but this time we have addedanother branch where we make a SELL if fast moving averagecrossesdown below slow moving average.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    30/106

    Forex Generator version 4.x

    Etasoft Inc. Page 30 8/11/2011

    EA Example 2 - DiagramUsing Custom Indicators

    This setup is provided for illustration purposes on how to u seEA Generator and it is not a final profitable Expert Advisor.

    MT5 specific: Diagrams below use building blocks specific toMT4. The differences between MT4 and MT5 block names are minorbutimportant. One important point: blocks If Order Does Not Exist inMT4 in most cases have to be replaced with blocks IfPosition DoesNot Exist. See chapter on MT5 and MT4 differences for details.

    This is more complicated sample that uses custom indicators andpending orders. Again we start with On Every Tick block andaddother blocks below it.n this case we use pending orders for BUYLIMIT and SELL LIMIT. Idea behind this setup is that once ourcustom indicator

    signals BUY (go long) or SELL (go short) setup, we open only onepending order 5 pips below current price and we expect marketofluctuate a bit in opposite direction than we expected and pendingorder kick-in to become open market order.

    We start with On Every Tick block that marks a point where ourEA will start executing on every new tick. You can also setupaparameter based on your broker support for currencyrepresentation. If broker supports 5 digits after decimal point,setup 5-digitBroker parameter to true.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    31/106

    Forex Generator version 4.x

    Etasoft Inc. Page 31 8/11/2011

    Add block Print Info To Chart to get some basic informationdisplayed on the chart.

    Add Trailing Stop block to manage opened o rders.We want to runTrailing Stop block on every tick so it is attached directly to OnEvery Tick block. Tailing stop checks if there are

    any open market non-pending orders and tries to trail currencyprices, maximize profits and minimize risk. In somescenariosrailing stops are not effective. It all depends on yourspecific trading setup.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    32/106

    Forex Generator version 4.x

    Etasoft Inc. Page 32 8/11/2011

    You can also use Order Id property to trail only specificorders. Let say your EA opens two orders when it gets market signalviaTechnical Analysis block. You use one Order Id for the firstorder and use another Order Id for the second order. Now you canuserailing stops on the first order and do not use trailing stopson the second order.

    Add two Technical Analysis blocks. Each block is directlyconnected to On Every Tick so it will execute on every t ick. ButeachTechnical Analysis block will execute other blocks we laterconnect to them only if conditions are met and custom indicatorsignalsus that it is time to do so.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    33/106

    Forex Generator version 4.x

    Etasoft Inc. Page 33 8/11/2011

    You can import custom indicators via Import Custom Indicatormenu.Once you import custom indicator it will be accessible viabutton available on _First Function and Second Function

    properties on Technical Analysis block.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    34/106

    Forex Generator version 4.x

    Etasoft Inc. Page 34 8/11/2011

    Use button to add custom indicator call to the TechnicalAnalysis block.

    Problem with most custom indicators found online is that theycome with zero documentation. If you drop them on the charttheyshow some graphical information but what values they return isnot documented. Without knowing what values they return it isnotpossible to understand how to integrate them into your EA. Somecustom indicators are simply not designed to be used viaExpertAdvisor. Since most custom indicators found on Internetforums are free they come with no support. Authors of thecustomndicators are usually only interested in developingindicators but not documenting or supporting them.

    Our indicator is very simple. It returns 1 when there is time tobuy (go long) and -1 when there is time to sell (go short). Italsochanges color indicating it on the chart. Because of thissimplicity there is only one Technical Analysis block for buy andoneTechnical Analysis block for sell detection.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    35/106

    Forex Generator version 4.x

    Etasoft Inc. Page 35 8/11/2011

    We setup If Order Does Not Exist blocks to make sure we do nothave already open orders of the same type. This prevents us

    rom keep on opening more orders of the same type. Because we areworking with pending orders we may have orders that arestillpending and orders that are already been filled. We want to makesure we do not open any new orders neither pending normarketorders. Thats why two If Order Does Not Exist blocks are used.First prevents open market orders and second preventsmore pendingorders.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    36/106

    Forex Generator version 4.x

    Etasoft Inc. Page 36 8/11/2011

    This If Order Does Not Exist block prevents more pending ordersto be open.

    Close any SELL orders we had open already since market signalchanged direction.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    37/106

    Forex Generator version 4.x

    Etasoft Inc. Page 37 8/11/2011

    Please note that for LIMIT orders our Ask Offset parameter isnegative number. Another important parameter is Expiration. Itisnumber of minutes how long pending order will be pending until itis filled or expires.

    We setup second branch of the diagram based on the first. It ismirror image of the existing branch with order typesreversed,example: where we have OP_BUYLIMIT we use OP_SELLLIMIT,etc.

    You can add some text objects to the diagram to explain itsexecution better.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    38/106

    Forex Generator version 4.x

    Etasoft Inc. Page 38 8/11/2011

    Compile your finished EA using Generate EA button or menu.

    EA Example 3 - DiagramUsing Bollinger Bands

    This setup is provided for illustration purposes on how to useEA Generator and it is not a final profitable Expert Advisor.

    MT5 specific: Diagrams below use building blocks specific toMT4. The differences between MT4 and MT5 block names are minorbutimportant. One important point: blocks If Order Does Not Exist inMT4 in most cases have to be replaced with blocks IfPosition DoesNot Exist. See chapter on MT5 and MT4 differences for details.

    The Bollinger Trending System with ADX Filter strategy buys,goes long, when price breaks out above the second standarddeviationBollinger Band and confirms entries with the ADX index (ADX above20). It sells, goes short, when price breaks belowhe bottom of thesecond standard deviation Bollinger Band and confirms entries withthe ADX index (ADX above 20). When the

    strategy crosses back across the first standard deviation thestrategy exits the trade. It works best in trending markets.

    This is more complicated sample that uses two indicators. Thereis first indicator to signal trade and second indicator to confirmit.Strategy also uses separate logic and one of the indicators toclose any opened positions.

    Again we start with On Every Tick block and add o ther blocksbelow it.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    39/106

    Forex Generator version 4.x

    Etasoft Inc. Page 39 8/11/2011

    We start with On Every Tick block that marks a point where ourEA will start executing on every new tick. You can also setupaparameter based on your broker support for currencyrepresentation. If broker supports 5 digits after decimal point,setup 5-digitBroker parameter to true.

    There is our simplified setup using Bollinger Bands withoutclosing signals indicated on the chart.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    40/106

    Forex Generator version 4.x

    Etasoft Inc. Page 40 8/11/2011

    We use Technical Analysis block to compare second deviation ofBollinger Bands upper line to current high value of the bar.

    There is our Bollinger Bands indicator setup.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    41/106

    Forex Generator version 4.x

    Etasoft Inc. Page 41 8/11/2011

    We compare current High value of the bar to return fromBollinger Bands indicator. You can also compare current closevalueClose[0]), previous close (Close[1]) or previous high(High[1]) values of the bar.

    This is just an example. You can use other indicators of yourchoice.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    42/106

    Forex Generator version 4.x

    Etasoft Inc. Page 42 8/11/2011

    We take result of ADX indicator and compare it to 20. If it isabove that value, there is possibility of a trend and that confirmsournitial signal that come from Bollinger Bands.

    There we check if BUY order is already open and if it is not, weexecute buy order.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    43/106

    Forex Generator version 4.x

    Etasoft Inc. Page 43 8/11/2011

    There we setup buy order (go long). Risk parameter is apercentage based on Free Account Margin.

    There we add another Technical Analysis block. This one is fororder closing.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    44/106

    Forex Generator version 4.x

    Etasoft Inc. Page 44 8/11/2011

    n second Technical Analysis block we use first deviation. Youcan also use other indicators or parameters to close the order.

    f current bar Low is below Bollinger Bands first deviation,close any buy positions we might have.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    45/106

    Forex Generator version 4.x

    Etasoft Inc. Page 45 8/11/2011

    We add block that closes any open buy positions.

    We add trailing stop block that will manage all open orders.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    46/106

    Forex Generator version 4.x

    Etasoft Inc. Page 46 8/11/2011

    We add yet another Technical Analysis block that will be usedfor opening sell orders. Now we add more blocks thatessentiallymirror first part of the setup. But now where we hadOP_BUY we use OP_SELL and where we had MODE_UPPER parameterforBollinger Bands we use MODE_LOWER, etc.

    There is complete setup.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    47/106

    Forex Generator version 4.x

    Etasoft Inc. Page 47 8/11/2011

    EA Example 4 - DiagramUsing Parabolic SAR

    This setup is provided for illustration purposes on how to useEA Generator and it is not a final profitable Expert Advisor.

    MT5 specific: Diagrams below use building blocks specific toMT4. The differences between MT4 and MT5 block names are minorbutimportant. One important point: blocks If Order Does Not Exist inMT4 in most cases have to be replaced with blocks IfPosition DoesNot Exist. See chapter on MT5 and MT4 differences for details.

    Enter long position when the current price touches Parabolic SARindicator from below and it changes its direction. Entershortposition when the current price touches Parabolic SARindicator from above and it changes its direction.

    This is simple setup that relies on just one indicator. What isdifferent about this setup it opens one type of position and doesnotopen same type of position again until opposite position hasbeen open. Example: if buy (go long) has been open, and ittakesprofit or stop loss, no more buy positions will be open. Itwill wait for sell (go short) and open only sell position. Oncesell positions open, it takes profit or stop loss, and now waitsfor a chance to open buy position.

    We start with On Every Tick block that marks a point where ourEA will start executing on every new tick. You can also setupaparameter based on your broker support for currencyrepresentation. If broker supports 5 digits after decimal point,setup 5-digitBroker parameter to true.

    n two Technical Analysis blocks we will compare values orprevious closing bars with values of Parabolic SAR. If iSARindicatorvalue 2 bars ago is greater than closing bar value 2 barsago AND iSAR indicator value 1 bar ago is lower than closing barvalue 1bar ago that means Parabolic SAR has reversed and will startgoing up (go long buy signal).Opposite is good for signal reversal.We go short sell when iSAR indicator value 2 bars ago is lower thanclosing bar value 2 barsago AND iSAR indicator value 1 bar ago isgreater than closing bar value 1 bar ago that means Parabolic SARhas reversed andwill start going down.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    48/106

    Forex Generator version 4.x

    Etasoft Inc. Page 48 8/11/2011

    There is our strategy on the chart with red dots provided byParabolic SAR indicator.

    We start with some utility blocks that help us to protectaccount from huge losses and also display useful information on thechart.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    49/106

    Forex Generator version 4.x

    Etasoft Inc. Page 49 8/11/2011

    t is p ossible to use Trailing Stop. But some trading strategiesactually are better off without Trailing Stop. It is a matter oftesting tosee if T railing Stop is worth having in any particularsetup.

    Compare value of close 2 bars ago and Parabolic SAR indicatorvalue 2 bars ago.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    50/106

    Forex Generator version 4.x

    Etasoft Inc. Page 50 8/11/2011

    Shift parameter allows us to take Parabolic SAR indicator value2 bars back from current bar.

    Compare previous close with previous (1 bar ago) iSAR to see ifit has reversed.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    51/106

    Forex Generator version 4.x

    Etasoft Inc. Page 51 8/11/2011

    Check Last Order Type can be used to determine type of last openorder from list of orders in history. If the last order in historyishe same a s Order Type then other blocks attached below will be executed.

    This setup can work without Check Last Order Type block. Whentesting this setup initially do not use Check Last Order Typeblockand you should see more buy and sell orders executed.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    52/106

    Forex Generator version 4.x

    Etasoft Inc. Page 52 8/11/2011

    There is our final trading strategy.

    Brokers and Accounts

    One and the same Expert Advisor may give different tradingresults depending on what Forex broker and account it is runningon.So you might have developed and tested your EA using one brokerand it worked fine. You moved it to a different broker andresultsare terrible: some orders do not execute, can not place tightstoploss, you are getting many requotes, etc.

    That is unfortunate truth brokers supply very differentexecution environments. While they all MetaTrader based but theyallsomewhat a little different. Forex brokers implement differentrules and there a re some specifics you m ight find:

    1. Brokers have different spreads. Thats obvious. But if you arescalping or using other method where even loss of one pipper trademeans your EA is no longer profitable, spreads become veryimportant.

    2. No hedging. Broker will not allow you to open anotheropposite position. Not even pending position. Let say youhaveopened buy (go long) position, you see it is losing, so you tryto open another position, this time sell (go short) justtocompensate for the losses. Broker that does not allow hedgingwill block second request.

    This might even have some extreme forms: you try to open twopending positions one: buy_stop and another sell_stop.So if marketmoves in either direction you close one of them. If your Forexbroker does not allow hedging, second pendingorder will not beaccepted, and you will end up with one pending order.

    3. FIFO. First-In, First-Out. Basically, if you open more thanone position on a currency pair, you must close the firstbeforeclosing the second one. Thats the NFAs not-so-straightforwardway of preventing hedging. If you only have one orderopen at atime, this is not a problem. If you open and close many orders,this can be a serious issue.

    4. Brokers have m inimal stoploss and takeprofit requirements.If you set them too low you will get errors in the log (Expertstabin the terminal).

    5. If you use pending orders brokers have additionalrequirements for order expiration and price offset. Pendingorderexpiration can not be too short. Some brokers reject pending orders that are valid only for a few minutes. Price (Ask/Bid)

    for the pending order can not be too close to current marketprice.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    53/106

    Forex Generator version 4.x

    Etasoft Inc. Page 53 8/11/2011

    6. 5-digit brokers work slightly different than 4-digitbrokers.

    7. ECN brokers have some specifics too.

    How EA Generator can help you?EA Generator tries to createresulting EA code in a way that it would work on as many differentbrokers as possible.

    Some strategies are much harder to implement. There are sometips:

    1. If you are scalping and/or opening many orders requotesbecome serious problem. Also during heavy trading hours brokersendto widen spreads and radically minimize your chances for success.You can use Spread Filter block just before you open

    any order to make sure that spreads are below expectedreasonable value.

    There are some of the techniques shown in the diagram.

    2. If you suspect that broker is cheating and using stop huntingtechnique to close your orders with occasional sudden spike youcanset stoploss parameter on your orders to very high value (like100-300 pips). But then you need a method to close ordersnside EA.One way to do it is use Close Order If block as stealth stoploss.It can close positions that drop below certain fixed

    amount. The danger is that once EA is left unattended powerfailure or some other technical problem like lost Internetconnectionwill close terminal or turn off EA and stealth stoplosswill never run.Stealth stoploss might work but the best solution issimple do not use broker that you know is stop hunting.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    54/106

    Forex Generator version 4.x

    Etasoft Inc. Page 54 8/11/2011

    Warning: Close Order If may not work if you trade using multipleorders and your broker forces FIFO rules mentioned above.

    Most building blocks use pips to indicate amounts. But CloseOrder If and Check Last Order Result blocks use parameterAmount.Amount is indicated as Profit in MT terminal.

    Scripts vs. Expert Advisors

    Basic difference is that Expert Advisors in MT4 are executed onevery tick and Scripts execute once only when you start themusingsome shortcut keystroke or drop script on the chart.Scripts areused for semi-automated trading. Use them when you need to run fewcommands at once. Example: you want to open2-5 positions at once oryou want to close multiple positions at once.

    Having good set of scripts can help you trade more effectively.You can use combination of scripts and Expert Advisor torunsemi-automated trading. Semi-automated trading could be goodoption in cases when there is no strict system when to open

    orders (the system is based on human expertise). But there isclear system on how to manage opened orders and when toclosehem.Example: create scripts to open o rders and use them tostart trades, and then start Expert Advisor to manage and closetrades.Other combinations also possible: let Expert Advisor openorders then use scripts to close orders.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    55/106

    Forex Generator version 4.x

    Etasoft Inc. Page 55 8/11/2011

    Scripts are easy to generate using Generate Script menu. Thissimple script opens few pending orders at once.

    Some building blocks do not work well in scripts because theyhave to be executed repeatedly to produce desired outcome.Example:Trailing Stop, Crawling Stop, Execute N Times, Pause blocks do notwork well in Scripts. All of these blocks rely on

    repeated execution by the terminal, and terminal repeatedlyexecutes Expert Advisors not Scripts.

    f you find yourself in situation when you need Trailing Stop orsome other order management but still want to use Scripts most ofatime, build Expert Advisor that simply runs required ordermanagement but execute this Expert Advisor only when you need it.Inhis case EA will work as a helper in semi-automated mode.

    There are many additional blocks that help you manage and logexecution. Print Info to Chart and Print Functions to Fileareuseful to see what is going on and log actual indicator valuesinto exported text file.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    56/106

    Forex Generator version 4.x

    Etasoft Inc. Page 56 8/11/2011

    Additional blocks that help log and display information.

    Testing EA

    When testing EA use both Strategy Tester for back testing anddemo account for forward testing in the terminal.

    Some building blocks do not work well in back testing and canonly be tested in demo (forward) testing. Back testing isasimulation. Functions like local time, market price spread andhistory are simulated and artificially created in terminal duringbackesting. If you want more accurate results use demo (forward)testing.

    Sometimes when you run strategy in Strategy Tester it may not beobvious why certain trades have been placed. Use VisualMode to seeexactly what is going on. Place all the indicators you use whenrunning Strategy Tester in Visual Mode. Then stop athe point whentrades are placed. It is best to use small date time periods forinitial testing - o ne to two days.

    f you run Strategy Tester all the way thru all the trades to theend without stopping, and then scroll the chart back sometimesitooks like EA entered trade for no reason. You need to run it inVisual Mode in Strategy Tester and stop at exactly the pointwhenrade is entered. Make sure to have indicators open on chartwhen in Visual Mode.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    57/106

    Forex Generator version 4.x

    Etasoft Inc. Page 57 8/11/2011

    When it is not clear why EA opens trades use visual mode inStrategy Tester.

    f you are testing EA in demo (forward) testing mode initiallyplace a lot of Print to Log blocks in your diagram. This will helpyousee what blocks have executed and what blocks have not. Log isproduced in the Experts tab in the terminal. Also use Print InfooChart or similar blocks to print diagnostic information directly tothe chart.

    Custom Code

    Professional Edition license of Generator produces both sourcecode in MQL and compiled file with extension *.ex4. Every time

    you run Generate EA or Generate Script current source code in*.mq4 file is overwritten and new source code is generated.

    f you want to add your own custom code you can take one of twosteps:

    1. Rename generated file and customize it from that point on.Now if you decide to change something in the original diagramandregenerated EA or Script you will have to move your code back intoregenerated version manually. This is forward-only approach todevelopment, and should be used most of a time since it gives youfull control over final result.

    2. Instead of taking generated MQL file and adding your owncustom code you can enter your own MQL into customgenerator blocksCustom Code or Custom If in the diagram and that way every timediagram is regenerated your codewill not be overwritten and lost.Your code will become part of the diagram.This approach should beused only if your custom code is really small. Generator is notfull EA development environmentand should not be used as completeprogramming environment. It is code generator. Thats it.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    58/106

    Forex Generator version 4.x

    Etasoft Inc. Page 58 8/11/2011

    There are custom MQL code blocks and custom if statements.

    Warning: do not use Custom Code, Custom If and Utility Codeunless you have programming experience and know MQanguage. CustomCode, Custom If and Utility Code blocks are designed to hold smallchunks of code. G enerator can not

    check syntax of the code you place into those blocks.

    nside Custom Code block you can place your own code in MQlanguage. However function name and braces { } are created byheGenerator. Function naming is left for the Generator becauseotherwise it would not be able to call the function based on

    arrows pointing to the block.

    f you need to have complete control over function names andparameters use Utility Code blocks. Utility Code blocks aretreateddifferent from any other block on the diagram. Sincegenerator does not create function names for functions insideUtility Code

    blocks they should not be connected via arrows to any o therblocks. They are stand-alone pieces of your own custom code.

    Essentially use of Custom Code vs. Utility Code is a tradeoff:

    1. When you use Custom Code you can draw arrows to it and itwill be called from the diagram based on those arrows. Butyou cannot create function name and pass any special parameters to thefunction. Your code gets wrapped with functionname and { } bracketscreated by Generator.

    2. When you use Utility Code you can not draw arrows to it. Ifyou draw arrows anyway, those arrows to and from UtilityCode willnot be used by the Generator. But inside Utility Code you can haveany number of functions and pieces ofindependent code. You can namefunctions, have them accept number of different parameters and havevarious returnvalues.

    Custom Code gets executed as part of the diagram becauseGenerator creates function names for your code. Utility Codegivesyou more freedom but you have to call it yourself from withinsome other block in the diagram.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    59/106

    Forex Generator version 4.x

    Etasoft Inc. Page 59 8/11/2011

    You can enter your own MQ code that gets wrapped into the customfunction that is called based on how arrows are arranged.

    There is resulting custom code.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    60/106

    Forex Generator version 4.x

    Etasoft Inc. Page 60 8/11/2011

    There is Custom If block example. It simply checks if it isMonday and then executes Technical Analysis block below. CustomIfcan compare indicator values, call external functions and compareresults, etc. Result of a parameter called an Expressionshouldalways evaluate to Boolean value True or False.

    n both Custom Code and Custom If you can enter variables thatare used by those blocks.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    61/106

    Forex Generator version 4.x

    Etasoft Inc. Page 61 8/11/2011

    You can also include complete functions and full code blocks viaUtility Code. Generator will not create function name andwrapping {} brackets for it. So you have to provide full function.

    You can call Utility Code functions from Custom Code or CustomIf blocks.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    62/106

    Forex Generator version 4.x

    Etasoft Inc. Page 62 8/11/2011

    You can also cut, copy and paste source code into Source Codewindow. Simply right click on it to get to pop up menuwithoptions.

    Another option for code reuse is Code Library feature. You canadd your own custom blocks to the set of existing blocks.Thoseblocks work as if they are Utility Code or Custom Code blocksbut you can have them setup on the toolbar as separateselectablebuilding blocks.

    Those blocks when dropped on the diagram are independent piecesof code (same as Utility Code or Custom Code blocks).Utility Codeblocks should not be connected using lines. Instead call them fromCustom Code blocks. Using Code Library you

    can have number of common code blocks that are used in number ofyour EA setups ready for you whenever you start newdiagram.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    63/106

    Forex Generator version 4.x

    Etasoft Inc. Page 63 8/11/2011

    Use Project->Code Library menu to add your own custom utilityblocks.

    Martingale and Semi-Martingale

    There are number of different risk management scenariospossible. Generator creates some scenarios via Buy OrderRiskManaged and Sell Order Risk Management blocks. Both blocks arerather complex and contain number of parameters thatnterplay tocalculate final risk value and lot size for current order. Usingthose blocks you can setup Martingale or Semi-

    Martingale system or some combination of both.

    Martingale risk management is typically used to double the lotsize (double the risk) on loss until profit is reached. Once profitisreached risk gets reset to initial value and it all starts again.Building blocks provide facility to double risk on profits too.fyou want to reduce risk use fractions in Risk Multiply On Loss orRisk Multiply On Profit parameters. Example: value 0.5 will

    reduce risk 2 times.

    Martingale use requires you to have large account balance andincreases possibility to have full account loss. Use withcaution.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    64/106

    Forex Generator version 4.x

    Etasoft Inc. Page 64 8/11/2011

    Martingale risk management checks previous just closed o rderfor result and if order opened with loss it increases or reducesrisk.n this screenshot it doubles down until profit is reached, atwhich point it resets the risk to initial value set in Riskparameter.

    Semi-Martingale risk management is similar to Martingale butrisk and lot size is increased more gradually. Instead ofmultiplyingrisk it adds or removes certain fixed percentage to o rfrom current risk. Use negative values for Risk Change On Loss orRiskChange On Profit if you want to reduce risk.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    65/106

    Forex Generator version 4.x

    Etasoft Inc. Page 65 8/11/2011

    This Semi-Martingale setup reduces risk on loss and increasesrisk on profit. Notice negative number in Risk Change On Loss.

    Exported Parameters

    Since version 2.05 Forex EA Generator lets you choose whatparameters can be exported from Expert Advisor and available inMTterminal Inputs screens. Once you have rounded block connected toother blocks use Project->Exported Parameters menuo change whatEA parameters can be customizable via terminal screens.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    66/106

    Forex Generator version 4.x

    Etasoft Inc. Page 66 8/11/2011

    Use Project->Exported Parameters menu to export parametersfrom Expert Advisor and make them available via Forex terminal.

    Another way to change exported parameters is via E xported tabright on the main program screen.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    67/106

    Forex Generator version 4.x

    Etasoft Inc. Page 67 8/11/2011

    Bar Values

    n MT5 Generator provides functions to access current, previous,previous previous, etc. bar values. Example: to access currentbarclose value use Close(0) in Technical Analysis block. If you wantto access previous bar value use Close(1). Previousprevious closebar value is Close(2). Same applies to Low, High and Open. Currenthigh is High(0) and previous bar high value isHigh(1), etc.f youwant to access low value of the bar 5 bars ago use Low(5). If youneed close value of the bar 10 bars ago, it is Close(10).f you wantto add or subtract some amount of pips from close, low, high oropen use *Point() function to convert pips to price point

    values.Example 1: you want to add 20 pips to previous bar closevalue: Close(1) + 20 * PipValue * Point().Example 2: you want tosubstract 30 points from current bar low value: Low(0) 30 *PipValue * Point().

    n this example on how bar values can be used in MT5 we forgot toplace PipValue variable. This still works if you use 4-digit

    brokers. But will not work on 5-digit brokers. PipValue variableadjusts pips based on what type of b roker you use. If it is missinghen EA can only be used on brokers that quote currencies in4-digits (2-digits for some currencies) but not on 5-digit(3-digit)brokers.PipValue" variable is basically a bridge thatallows EA to work with both 5-digit and 4-digit brokers. If youmiss it, your EA will not

    work when you use it on 5-digit brokers.

    n MT4 you can use the same functions to access bar values butinstead of ( ) braces you would use [ ] braces.Example 1: previousbar close value is Close[1].Example 2: previous previous bar lowvalue is Low[2].

    You need PipValue variable and Point (without ( ) braces) whenadding or subtracting pips to bar values. There is an example ifyouwant to add 20 pips to previous bar close value:Close[1] + 20 *PipValue * Point

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    68/106

    Forex Generator version 4.x

    Etasoft Inc. Page 68 8/11/2011

    Example: you want to find the difference between high and lowvalues of the previous bar and make a decision to trade ornot.High[1]-Low[1] gives a difference in price in the currency ofthe BAR high low.High[1]-Low[1]) / (PipValue * Point) gives samedifference but in pips.f you want to compare this to value of 1 00pips in Technical Anlaysis block you would enter:

    _FirstFunction as (High[1]-Low[1]) /(PipValue*Point)SecondFunction as 100Compare as < or >depends should it be less than 100 pips or more than 100 pips.

    Get the highest value on the 10 consecutive bars in the rangefrom the previous bar to the 10th index inclusive on thecurrentchart:High[iHighest(NULL,0,MODE_HIGH,10,1)];Get the lowestvalue on the 10 consecutive bars in the range from the previous barto the 10th index inclusive on the currentchart:Low[iLowest(NULL,0,MODE_HIGH,10,1)];

    mportant: Almost everything you enter in the Generator iscase-sensitive. So LOW is not the same as Low. If you enterLOW(1)nstead of Low(1) it is not going to work. If something doesnot work, recheck the syntax. Make sure you have enteredvalues,

    braces, special symbols the way they should be.

    My Diagram Does Not Work. Whats Wrong?

    You have got e xcited about the opportunity to build your ownEAs without much programming involved. Dropped 40 blocks on the

    diagram, connected them but it does not work the way you expect. Whats wrong? Why it does not work the way it should?

    Now diagram has too many blocks to understand and find where theproblem is. Best way to approach any new trading setup is tostartsmall. Start with 5 to 7 blocks. Make sure it works then grow itslowly by adding more blocks. Make backup copies of thediagram aswork progress. If you add some blocks, and you can not find whysuddenly it does not work, you can always take lastbackup copy andstart from that point again.

    1. First place to check when your EA does not work the way itshould is to check Experts tab in the terminal.2. Make sure thatyou have EA execution enabled, and live trading is allowed.3. IfExperts tab does not list any errors you need to place more Printto Log blocks into the diagram. Use Print Functions

    to Chart block to see some indicator values on the chart as EAis executed.4. Run EA backtest in Visual Mode (available in MT4).Pause execution at critical moments. Check Experts tab for Printto

    Log output.5. You can place number of graphical objects on thechart to give you some visual clues. Use Vertical Line andArrow

    blocks. Arrow block with Arrow Type set to SYMBOL_LEFTPRICE,SYMBOL_ARROWUP andSYMBOL_ARROWDOWN are most useful.Use Arrow blockwith Arrow Type set to SYMBOL_LEFTPRICE just before the block thatruns when it is not suppose torun. Example: if you have SELL blockthat runs when it should not run, place Arrow block with Arrow Typeset toSYMBOL_LEFTPRICE just before it (but after "TechnicalAnalysis" blocks). That way once EA runs SELL you will havepriceprinted right on the chart.

    Keep in mind that charts in the terminal are by default based onBid. That is important to understand. Especially for currencypairshat have wide spreads. The current price shown on an MT4 chartis the bid price. When looking at a price bar or candle, you

    need to add the spread to the high bid price to know what thehigh ask price would have been, or add the spread to the lowbidprice to know what the low ask would have been.f you are in asell (in at the Bid out at the Ask), you would not see the candlereach your stop loss if you are taken out of the trade.

    Sometimes it is hard to understand why diagram generated EAworks the way it does. The easiest way to decipher these typesofdiagrams is actually rather simple. Take a piece of paper andwrite diagram as bunch of IF statements. Each TechnicalAnalysisblock is essentially an IF.Let say you are comparing barvalues of Close in Technical Analysis 2 blocks and trading based onthat. Something like this:F Close[1] < Close[2] AND ... THENopenF Close[1] < Close[0] AND ... THEN close

    Now instead of Close[0], Close[1] and Close[2] you will insertactual numbers. Example: instead of Close[0] you will write1.4567,and so on. Make sure those are reasonable values.Rewritediagram text like this:

    F 1.4567 < 1.4444 AND ... THEN openF 1.4567 < 1.4555 AND... THEN close

    Run all "IF" statements of the diagram with actual numbers andsee which ones of the "IF" conditions trigger. Mark them onpaper.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    69/106

    Forex Generator version 4.x

    Etasoft Inc. Page 69 8/11/2011

    You might want to repeat this 15-20 times with different numbersto make sure all kinds of scenarios are covered.

    Diagram Execution

    Diagrams start EA or Script execution from rounded blocks. Yourdiagram can only have one rounded block. We recommend useOn EveryTick block for almost all diagrams.

    The difference between blocks On Every Tick and On Every New Baris huge. On Every New Bar is basically an e xtra filter onOn EveryTick block. On Every New Bar receives all the ticks (the same wayOn Every Tick block does) but it e xecutes

    connected blocks only when new bar starts. That basically meansthat if you use On Every New Bar block you a re missing manyicks.fyou are watching a movie would you like to watch it all or justwatch 1 minute of the movie out of every 5 minutes (watch 1

    minute and skip 4 minutes, watch another 1 minute skip somemore, etc.)? That is basically the difference.

    Some building blocks do not even work accurately when connectedto On Every New Bar instead of On Every Tick. Examplesare TrailingStop and BreakEven blocks. They need to run on every tick to bemost accurate.

    Lets say you have On Every Tick block on the diagram. Now allthe other blocks directly connected to On Every Tick will runonevery tick.

    Simple diagram that runs on every tick, checks if MovingAverages just crossed, executes Buy Order and runs TrailingStop.

    The diagram is not going to run the way you expect. The problemis that Trailing Stop block is connected to the wrong place.For

    Trailing Stop to execute on next bar Moving Averages need tocross again. This will probably not going to happen for thenext10-20 bars or more. So your Trailing Stop will not execute forlong time missing many ticks in between.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    70/106

    Forex Generator version 4.x

    Etasoft Inc. Page 70 8/11/2011

    There is corrected diagram. Now Trailing Stop will run on everytick not just when Moving Averages cross.General observation thatmight help you understand why certain blocks run more often thanothers if you have many blocks

    between On Every Tick block and some A block, that A block willrun only if every block on the way will also run becausesome blockswork as filters and run only under certain market conditionschances greatly reduce for the A block to run furtheraway it isfrom On Every Tick block.

    n this diagram Sell Order will execute on every tick but BuyOrder will execute only when specific market conditions aremet.Conditions are set via three Technical Analysis blocks. Obviousthat Sell Order will execute much more often than Buy Order.

    f you have all the blocks in the diagram but generated EA doesnot run properly it is likely because blocks areconnectedncorrectly. You can check e xecution of EA by insertingPrint to Lo g blocks in between other blocks in the diagram. Printto Log

    will output text into Experts tab in the terminal and help youunderstand order of execution of the blocks inside the diagram.

    Before Going Live

    Before you start using generated EA for live trading there aresome important points to consider:

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    71/106

    Forex Generator version 4.x

    Etasoft Inc. Page 71 8/11/2011

    1. Make sure you have both backtested and demo (forward) testedyour EA for at least 2 weeks.2. After you start trading live usingyour EA, do not leave it unattended for the first 2 weeks of livetrading. That means,

    monitor your EA trading and do not leave it running by itself.3.Use various blocks and techniques that protect your profits orminimize losses. Example: use Stoploss, do not set it to

    zero.4. There are number of blocks that can stop EA execution ifcertain losses are reached. Those blocks are helpful when you

    start running EA in fully automated (unattended) mode. Such asrunning overnight or running during the day when you are

    busy at your day job.5. There are blocks that do not trade ifspreads increase. Spreads eat your profits when you are usingnon-ECN broker.

    Spreads increase during high volatility. If your strategydepends on low spread values use blocks that check for spreadsanddo not open new trades at the moments when spreads increase.

    MT5 and MT4 Differences

    Visually MT5 m ight not seem that different from MT4 when youlook at it. You have mostly the same screens and someadditionaleatures. But MT5 is very different in terms ofprogramming of Expert Advisors and Scripts. MQ language has numberof changes

    and code written for MT4 can not be easily reused in MT5. Alsonew language seems to be more verbose and generated EAs andscriptsin most cases contain more code.

    There some new concepts in MT5 that just have to be understood.Term Order now a pplies to unexecuted or pending orders.

    Once order gets executed and is filled, it becomes Position.Therefore in version 3.x of the Generator there are two maingroupsof building blocks. Group 1 is for Orders that deal withpending orders or orders that will run and become Position. Group 2isor Positions (already executed market orders).

    Examples: Buy Order, Sell Order, Buy Pending Order all work withOrders while Trailing Stop, Close Position, BreakEven blocks workon Positions.

    At the time of this writing MT5 does not seem to support VisualMode in Strategy Tester. It was the main tool to test execution ofExpert Advisors in MT4. MT5 Debugger runs very slow and does notseem to help much.

    Custom Indicator Mode (new since Generator version 4)

    Since Forex Generator version 4 you can also build customindicators using Custom Indicator Mode. Simply switch to thismodeusing Options screen.

    You can switch to Custom Indicator Generator mode using Optionsscreen.

    MPORTANT: Indicators differ in number of ways how they workinside the terminal. Indicators are executed different thanExpertAdvisors (EA). Once you drop EA on the chart it starts executing main body of code on the first tick. But indicator droppedon the

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    72/106

    Forex Generator version 4.x

    Etasoft Inc. Page 72 8/11/2011

    chart execute (recalculate) its values on all bars prior to thisone. Therefore while EA may use formulas like Close[0] toaccesscurrent bars close value or High[1] to access previous barhigh value, indicator can not use fixed index but has to usecurrent orcurrent+1 value. So inside indicator values of bars arerelative to current bar and can be accessed as C lose[current] forcurrentclose or High[current+1] for previous bars high, and soon.

    Examples:Close[current] is current bars close.Close[current+1]previous bars close.

    Close[current+2] previous previous bars close.Close[current+3]previous previous previous bars close.Open[current] is current barsopen.Open[current+1] is previous bars open.Open[current+2] isprevious previous bars open.

    Same applies to the indicators. So instead of Shift parameterbeing set to zero (0) it should be set to word current (noquotes).

    Shift is set to current bar. Only problem with using wordcurrent bar in Shift is that it can not be exported as parametervariable.

    Expert Advisors usually rely on signals from indicatorstherefore they mostly contain signal processing and ordermanagementcode that is not very math intensive because calculationsare done inside indicators outside of EA. Custom Indicators areusuallymore complex in terms of mathematical calculations thanaverage Expert Advisor. Creating custom indicator in mostcasesrequires more math skills or some background in computerscience.

    Since Custom Indicators (CI) execute on every previous bar onceCI is dropped on the chart special care is required in usingblockslike Send Email, Alert and Beep. If you set Technical Analysisblock incorrect and it will execute attached Send Email oneverybar, as a result you will get as many emails as many bars aredisplayed on the screen. It could be 50 to a 100 emails atonce.Same applies to Alert and Beep. Alert will be repeatedly displayedand beep will sound constantly. Instead of using SendEmail, Alertand Beep try using Print to Log block first, and see what does getprinted in the log.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    73/106

    Forex Generator version 4.x

    Etasoft Inc. Page 73 8/11/2011

    While Expert Advisor development required extensive use ofTechnical Analysis and Technical Analysis 2 blocks mostCustomndicators (CI) need blocks called Chart Line, Histogram,Dotted Line, etc.

    Most Custom Indicator building blocks listed under Indicatorsection. Calculation is only block that does not displayanynformation on the chart. It is used to create calculationsinside custom indicator. Those calculations can be used in yourExpert

    Advisors or Scripts. O ther b locks from Indicator sectionreturn result of the calculations as well and can be used inExpertAdvisors but they also display some graphical information onthe charts.

    CI Example 1 High Low as Histogram

    We start our examples with the simplest Custom Indicator (CI)you can build in minutes. The first one is histogram typeindicator

    hat simply shows difference between High of current bar(High[current]) and Low of the current bar (Low[current]). It isnot veryuseful but shows basics of how to create customindicator.

    We build it using only two blocks from the list of availableblocks. That is On Every Tick and Histogram. On Every Tickblockholds general indicator parameters such as Indicator Name,Indicator Window, etc. Histogram block helps us setup simplesinglecolor histogram on the chart or separate section of the window nextto the main chart.

    There is our indicator open on EURUSD chart. As you can see thisis simple histogram type indicator with only one type ofgraphicalinformation in it. Indicators may have number of lines and graphicobjects. We start small and show how to built simplehingsfirst.

    One indicator can contain few histograms and lines all packagedtogether.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    74/106

    Forex Generator version 4.x

    Etasoft Inc. Page 74 8/11/2011

    nternally each histogram or chart line gets unique indexassigned to it. Forex Generator manages this for you automaticallyandassigns unique index to each histogram or chart line you placein the indicator diagram. But MT4 terminal limits number ofbufferndices to 8 (internally they are presented by numbers from 0to 7). T hat basically means you should limit your indicator to 8chartines or histograms in one indicator.f you place more than 8histograms or chart lines your indicator will most likely stillwork, but Expert Advisors or Scripts that use

    your new indicator will only be able to access calculations forthe first 8 histograms or c hart lines of your indicator.

    This limitation is lifted for MT5 terminal. You can haveunlimited number of histograms or chart lines per indicator andaccess themall from EA or Script.

    Blue square indicates actual indicator setup. We simply selectedto add Histogram block then we took High of current barandsubtracted Low of current bar (High[current]-Low[current]).

    CI Example 2 Detrend Price Oscillator as Chart Line

    This second example is different since it uses Chart Lineinstead of Histogram. It is called Detrended Price Oscillator. Ittrieso capture the short-term trend changes. Indicator's cross withzero is the best indication of such change.ndicator takes currentbar close value and subtracts current Moving Average (iMA) withspecific parameters. This setup is also

    very simple. Main difficulty is to get Moving Average parametersentered correctly.

    http://www.pdfpdf.com/
  • 7/22/2019 ETAsoft Forex Generator

    75/106

    Forex Generator version 4.x

    Etasoft Inc. Page 75 8/11/2011

    Whole formula is Close[current] - iMA(NULL,NULL,14,8,MODE_SMA,PRICE_CLOSE,current) .

    You can enter this expression easier by using .. buttondisplayed next to the Formula parameter. Click on .. button. In thenewscreen simply select iMA indicator from the drop down list andenter all the parameters for Moving Average. Then click OK inhatdialog. Once you get expression back into main screen, addClose[current]- before the iMA() expression.

    http://www.pdfpdf.com/
  • 7/22/2

ETAsoft Forex Generator - [PDF Document] (2024)
Top Articles
Latest Posts
Article information

Author: Errol Quitzon

Last Updated:

Views: 6029

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Errol Quitzon

Birthday: 1993-04-02

Address: 70604 Haley Lane, Port Weldonside, TN 99233-0942

Phone: +9665282866296

Job: Product Retail Agent

Hobby: Computer programming, Horseback riding, Hooping, Dance, Ice skating, Backpacking, Rafting

Introduction: My name is Errol Quitzon, I am a fair, cute, fancy, clean, attractive, sparkling, kind person who loves writing and wants to share my knowledge and understanding with you.