FAQ E-mail


If you have any issues first read this FAQ, then read the manual and search the support forum. If you cannot find a solution, please post your problem at www.molanis.com/forum
For faster resolution post your strategy (.mol file) and your custom indicators (if any).


Expert Advisor Generation


Setup and Usage



The Strategy Builder doesn’t work. It doesn’t run. How do I run it?
Molanis products are written in Java so you need the latest Java version installed in your pc. You can get it at www.java.com. Please install java to solve the problem.

The Strategy Builder doesn’t work. It opens another software (Winzip, software to compress/uncompress file/ Nokia software/). How do I fix it and run it?
Windows uses file associations to make a link between programs. For example pictures are opened with paint, docs with MS Word, Jar files with Java. Jar is also a way to compress files so sometimes Jar is associated with a software to compress files. Molanis software is a jar file. It should be executed with Java. The easiest solution to this issue is to reinstall Java and the file association will be changed automatically. Another option is to change the file association manually.
An alternate solution is to edit the properties of the icon - link to Molanis on your desktop to :
C:\WINDOWS\system32\java.exe -jar C:\Molanis\Strategy_Builder\molanisSB3xx.jar
(xx is your installed version)

Where is the Molanis Executable .exe?
Molanis Strategy Builder is written in Java so its executable is a .jar file. Executables Java programs have a .jar extension. Not all executables are .exe You can execute Molanis from the icon on your desktop, from the Windows Task Bar under Molanis, or going directly to the Molanis installation directory.


Where is the product manual/user guide?
The product manual is in the installation directory. It’s a PDF file. You can also access it from the Windows Task Bar under the Molanis folder

How do I run the debug mode?
Open the installation directory and click on Debug.

How do I send the content of the debug window to Molanis support?
Right-click the title bar of the debug window, go to Edit, and then click on Mark.
Select all the text with your mouse
Right-click the title bar, go to Edit, and then click on Copy.
Position your mouse cursor where you want the text to be inserted (i.e. email)
Right-click, and then click Paste.
We appreciate if you send us the text and not a screenshot.


Where is the software PCCode located? How do I find out my computer's MAC or PCCode?

PCCode is located in the directory where you installed our products. i.e. C:/Molanis/Strategy_Builder . You can also find the PCCode in Windows task bar under the Molanis directory.


To find out your PCCode (MAC address of the active network or wireless card), run the software PCCode - just click the icon PCCode and a new window will appear (see below) showing your PCCode.


In the example, the computer's PCCode is 001A4B46A828 - This is what we need for license generation.


How do I install the license file?
The license file is sent by email as an attachment. The license file name is license.xml Each product has its own license so you may expect one email per purchased product.


To install the license, save the license file (license.xml) in the directory where you installed our product. For example the Strategy Builder is installed by default in C:\Molanis\Strategy_Builder.



Thus to install the license right click on the attachment, click on save as, search the directory C:\Molanis\Strategy_Builder, and click on the Save button (Steps may change depending on your email client)


In the directory C:\Molanis\Strategy_Builder you will find an existing license.xml file. That file is the old or demo license. You need to replace it with the new license file. So click on Yes when asked Do you want to replace it?


Please note that each product has itw own directory and requires its own license file. The following are the default installation directories:


Using MetaTrader 5 in new Windows versions
Windows Vista and Windows 7 users: If you want to avoid headaches, do not install MT5 under the Program Files directory. Why?
New versions of windows have a security feature to protect the directory Program Files and its subdirectories. With this features files are also saved under C:\Users\YourUserName\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5 . This causes problem, since MT5 look for the files to display in the Navigator under C:\Users\YourUserName\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5 and not under C:\Program Files\MetaTrader 5\MQL5
So if you see your file in C:\Program Files\MetaTrader 5\MQL5\Experts or in C:\Program Files\MetaTrader 5\MQL5\Indicators but you do not see it in the MT5 Navigator (the place where you drag and drop it in the chart) probably the syncronization between C:\Program Files\MetaTrader 5\MQL5 and C:\Users\YourUserName\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5 is not working. The fix is to copy the files manually from C:\Program Files\MetaTrader 5\MQL5 to C:\Users\YourUserName\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5 (take into account that YourUserName is your windows user and D0E8209F77C8CF37AD8BF550E51FF075 may be different.)

EA Generation

How do I solve the "The Expert Advisor couldn't be created" issue?
(This only applies to old MT4 versions. Starting on MT4 build 600 this is not a problem anymore)
Seldom users have issues when creating the EA. The Builder gives them a message advising to verify the MT4 configuration. They click in the Verify button and the configuration is not wrong. This happens in Windows Vista and 7 most of the time.
The problem is not the Strategy Builder. It’s not Java. The problem is that Windows security settings are not the same among all MT4 installations. People that get the standard MT4 (provided by Metaquotes) do not have any issues. The issues are faced by people that get MT4 from certain brokers who do not give writing rights to the MT4 directory to the normal windows users (Your user – not admin users). In plain English, when the Strategy Builder tries to create the EA in the experts directory it fails because the normal windows users (your user) does not have the right to create files in the experts directory.
To solve the problem you can either run the Strategy Builder as a Windows admin user or become an admin user (which is difficult for some users). Some users had some success reinstalling MT4 in any directory but avoiding C:\Program Files. The best solution is to change the windows permission on the MT4 directory. The following graph shows the right permissions on the left and the wrong ones on the right.


MetaTrader Windows Permission

Using MT4 Build 600 or higher

In build 600 MT4 had some drastic changes. The directory structure and file names changed to be like MT5 - this is part of MetaQuotes strategy to join MT4 and MT5 in a new product. If you use MT4 build 600 or higher please install version 3.2

If you use MT4 Build 600 or newer, in the Strategy Builder you need to setup:
1. the MT4 directory (the directory where the MT4 Editor MetaEditor.exe is located i.e. C:\Program Files\MetaTrader 4).
2. the MQL4 Folder:
To find your MQL4 Folder open MetaTrader and go to menu File - Open Data Folder. Then click on MQL4.
Here there are two options:
-If you use MT4 Build 600 or newer on Windows XP, Professional or older Windows versions, your MT4 MQL4 Folder should be something like C:\Program Files\MetaTrader 4\MQL4 - that directory is where the Experts and Indicators directories are located. EAs will be saved on C:\Program Files\MetaTrader 4\MQL4\Experts, Indicators will be saved on C:\Program Files\MetaTrader 4\MQL4\Indicators
-If you use MT4 Build 600 or newer on Windows Vista or newer Windows versions (i.e Windows 7 and 8), your MT4 MQL4 Folder should be something like C:\Users\YourWindowsUser\AppData\Roaming\MetaQuotes\Terminal\YourTerminalID\MQL4. Expert Advisors will be located on C:\Users\YourWindowsUser\AppData\Roaming\MetaQuotes\Terminal\YourTerminalID\MQL4\Experts and indicators will be located on C:\Users\YourWindowsUser\AppData\Roaming\MetaQuotes\Terminal\YourTerminalID\MQL4\Indicators.


How to find the MQL4 Folder?
To find your MQL4 Folder open MetaTrader and go to menu File - Open Data Folder. Then click on MQL4. The MQL4 Folder contains the Experts and Indicators directories.

MQL4 Foder


I can’t see the EA code (MQL Code). What’s wrong?
Evaluation and Standard versions do not show the MQL code. If you want to see the MQL code, you need a Pro license.



What’s a tick?
A tick is a common word to refer to the price in a specific time.

What’s a Multi timeframe EA?

It’s an EA that gets signals from different timeframes. For example, one signal is a moving average from a 1min graph, another signal is a moving average from a 5 min graph. When creating muti timeframe EAs you should add your EA to the smallest time frame.

What’s an M-Warning (Molanis Warnings) ?
M-Warnings are messages generated by the EA that you can see in MT4 clicking on the tab Experts. There you can see when orders are sent to the server or when trading conditions are evaluated. If the message is important and requires attention you will also see an alert.

Why my EA shows as a gray icon in MT4 and others EAs are yellow (aka Grayed out EA)?
In MT4 Navigator, a gray icon for an EA means that you can use it and trade but you can't change the code. User with Standard installations have EAs with grey icons because thy do not have access to the MQL code.

Do you support 4 and 5 decimals brokers?
Yes, there will be an option for users to select the number of digits.

Do you support hedging?
MT5 does not support hedging. For MT4, Molanis Strategy Builder does support hedging (since version 3.15). If hedging is not active, before going long (buying a currency pair) the software will close all short positions. In the same way, before going short (selling a currency pair) the software will close all long positions. As a consequence, if you are not hedging, you do not need to use CLOSELONG and CLOSESHORT to close open positions before opening a new position. The system does that for you. If you hedge, you need to use CLOSELONG and CLOSESHORT to close open positions before opening a new position.


Setup and Usage

My trading diagram has errors. How do I fix it?
Move your mouse cursor over the big X that identifies the error. An error description and possible solution will be shown.

How can I add my indicators / custom indicators to the Strategy Builder?
You can add any well written custom indicator with the Import Custom Indicator feature. Under a TA block, select Custom Indicator and then click on Import Custom Indicator.
Custom indicators must be located in the indicators directory (C:\Program Files\MetaTrader 4\experts\indicators for standard installations of MT4) . Unless you know in advance the indicator signals, you need both the mq4 file (MQL) and the compiled ex4 file.

How do I find out the variables of my custom indicator?
The variables of your custom indicator are visible in MetaTrader when you add the indicator to a graph. For more information look here.

What’s the difference between completed Bars and Every Tick in the Execution Mode option (block START)?
MetaTrader receives ticks (prices) constantly. In every candle, MT4 paints the Open. High, Low, and Close prices. Between the Open and Close price there are a number of ticks that are not painted. Just imaging in a 1 hour graph, a 1 hour candle could have thousands of ticks (price updates).
If you trade using the option Completed Bars, your EA will ignore all the ticks between Open and Close, and it will trade just after the Close of the previous bar and when the current bar starts to be formed.
If you trade using every tick, your EA will be executed every time MT4 receives a new price (tick). If your EA is still being evaluated when MT4 receives the next tick, the new tick will be ignored. Take into account that if you do not get new prices, your EA won’t be executed.
Choosing between Completed Bars and Every Tick is a personal option that depends on your trading style and strategy.

What is the difference between selecting Current Symbol and selecting a symbol?
Current Symbol means that the value of the symbol is taken from the currency graph. If you add your EA to USD/CAD then the Current Symbol becomes USD/CAD when executing your strategy. If you are not going to trade or get signals from multiple currencies you should use Current Symbol. This way you can use the same EA for any symbol.

What is the difference between selecting Current Timeframe and selecting an actual timeframe?
Current Timeframe means that the timeframe is taken from the currency graph. If you add your EA to 1 min graph then the Current Timeframe becomes 1 minute. If you are not going to trade or get signals from multiple timeframes you should use Current Timeframe. This way you can use the same EA for any timeframe.

How do I setup the expert advisor to send signals instead of trading?
On the START block (or in the EA input variables), use the following options:
TradeOrAlert = True (for trading)
TradeOrAlert = False (to send alerts)
When TradeOrAlert = False, the EA does not trade. It shows alerts. If eMail Mode = ON, you will also receive emails.

How can I create a signal to initiate a trade when my indicator crosses a level (i.e. Zero, 30, 70 like in MACD>0 or RSI>55)?
On a TA block, compare your indicator to User Defined Number - UserNumber ( which accept positive and negative numbers) or User Defined Price - UserPrice (accepts positive number only).

When should I use the AND block?
It should be used when you want to execute a trade when both (or more) conditions from TA blocks are true. AND allows the execution of the next block when ALL of its preceding trading blocks are true.

When should I use the OR block?
It should be used when you want to execute a trade when at least one of the conditions from TA blocks is true. OR executes the next block when one or more of its preceding trading blocks are true. This means you can create as many TA blocks as you want and connect them to an OR, and then to a BUY (or a SELL) block.
You can use OR and AND as many times you want. The limit is the screen size.

What is shift and how do I use it?
As per MetaTrader :
Shift: Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Shift is which bar the calculation is being performed upon. The current bar is bar 0. Bars are numbered 1, 2, 3, 4, 5, 6, 7, etc as you go back in time on the chart. Changing the shift option is similar to moving the indicator line into the future or the past.
In plain English, use:
shift = 0 for current bar (still forming)
shift = 1 previous bar
shift = 2 bar before the previous bar (shift =1)
If you want to compare the current bar with the previous bar you can use the option shift.
For example, on a TA block select the Momentum indicator on the left side, use shift of 0 (0 means current bar). On the right select Momentum indicator but use a shift of 1 (1 means the previous bar).
If the indicator with shift = 0 is higher than the indicator with shift = 1, the momentum of the current bar is higher than the previous bar. This should be used with care since the current bar has not been formed - it may change. You could also use shift = 1 and shift = 2 with this you make sure you are comparing formed bars

How do I know the server time?
When you attach an EA to a graph, it prints the server and terminal (your computer) time. Just look for it under MT4 logs (Tab experts in MetaTrader).

How do I compare the current bar with the previous bar?
Please see shift question

How do I change the default sound?
Make sure that on the START block the play sound option is on (Play Sound = ON)
In MT4, add your EA to a graph - under the Inputs you will find a MySound variable. Change the name to the sound you want to hear (default is alert.wav) It has to be a sound file located in C:\Program Files\MetaTrader 4\sounds (or your MT4 installation directory)

When should I use a CloseLong or CloseShort block?
Most of the time you don't need to use CloseLong or CloseShort since every time you want to BUY the system closes all shorts first and before you SELL all longs are closed. If you need to use them just connect them after a TA block. Most likely you will use them if you want to close a position but do not want to open a new trade.

Error 130 invalid stops but stops are ok. How do I fix it?
Most likely your broker does not accept the order with the stops at the same time. On the START block change the option Buy/Sell orders include TP/SL to NO. This means the position is opened and after an execution confirmation is received, the stops are added.
Does this affect my trading? In some cases like scalping. Changing brokers could be a solution.

My backtesting is not stable. What can I do to improve it?
Backtesting multiple timeframes is difficult and results are not as stable - make sure you have data for all timeframes in the EA. MT4 official documentation can be found here
Read the information in this link to improve your backtesting

Cannot generate EA with Windows 64 bits
To generate EAs in Windows 64 bits go to the MetaTrader directory and copy Metalang64.exe to Metalang.exe, and copy MetaEditor64.exe to MetaEditor.exe

Which variables should I use to backtest lot size, TP or SL?
When you add the EA to the graph, a new window is shown. Click on the input tab. then scroll down and you will find the MT4 variables for you to use in backtesting.
Variables are generated automatically and look like this (for a EURCAD strategy):
They follow this standard:
Order Type First letter (Buy or Sell) + Currency Pair + Variable Use (LS, TP, SL,TS) + Reference Number
LS=lot size, TP=take profit, SL=stop loss, TS=trailing stops
Thus S_EURCAD_LS_0 is the lot size for EURCAD when you SELL
B_EURCAD_LS_0 is the lot size for EURCAD when you BUY




Quick Links