METATRADER EXPERT ADVISORS & INDICATORS, MQL4 CODING
http://blog.iticsoftware.com
Metatrader Expert Advisors | Forex Robots | Metatrader Indicators | MQL4

Money Management for FOREX Trading

Money Management is a big factor in any trade. In any trade two different traders can do the money management separately even they are not in the same trade. If we talk about two draftee traders who has the best high chance set-up, as well as both of them are on the different side of the trade so that result can be know easily it might be happen that they will not lose money in future. It is also possible that if both of the trader’s direction is towards each other they will not earn money or they stop to earn money. Some people say that what is the difference in between them? What is the factor which separates the experienced traders from amateurs? A proper management of money only is the answer.

-----------------------------------------------------------------------------------------------------------------------------------
Forex Scalper Stomper
REAL
Account Trading perfomance:


 expert advisor europe monitoring

Read More about Metatrader Expert Advisor Stomper EURGBP>>>

-----------------------------------------------------------------------------------------------------------------------------------
Some time each person has to lose something to gain something. As when a person wants to get fit then he has to take the healthy food like this for money management people has to pay something. Some time people have to have their eyes on their position and they have to take the risk of loss. Some people even love to do it. This activity some time looks like a troublesome as it is not a pleasant activity. It does not mean that we should take loses for a very long time it will affect on our success.

Amount of Equity Lost

Amount of Return Necessary to Restore to Original Equity Value 

250%      

330%

500%

1000%

750%

4000%

900%

10000%

Figure 1 - This table shows just how difficult it is to recover from a debilitating loss.

 It is not easy to recover from the loss the above table shows you that if a person gets the loss of 50 % then he has to earn the 100 % on his capital to come at his/ her original position. So it is not easy to recover from loss.
The big One
            Many people ignored this thing while they know about the fact mentioned in the above table. In some magazines there are lots of stories of many traders who loose their money in the trade and their profit for two to five years was finished by taking a wrong decision in trade. If you r management is poor enough then it will result into a not stopped loss.
There are many traders in the world that started their career knowingly or unknowingly watching the Big One. 
Many people believe that only one trade will make them a milliner and they will get a life which is care free and in a very young age they will get retired and will have a luxuries life but in the traditional market this dream of people is rock hard.
Nobody can forget the about George Soros who “broke the bank of England ” by just shorting a pound away and by doing this only he became the owner of $1-billion profit with in one day only but does not happen always. Many people have seen that most of the times people gain a big loss instead of big win. They lose the game in their life such that, they would never be able to come back into the game.
Learning Tough Lesions


If traders stop losses then they can easily overcome these fates and control them. Larry Hite was one of the biggest trader in 1989 he also advised that time that you must never take a risk of more than 1% in your trade. By using this theory they won’t loss their complete capital even if they get wrong twenty times. 
After that also they will be the owner of at least 80% of their equity if every time they get wrong.
But there are very few traders who follow this rule continuously. As a child learns that he should not touch a hot stove otherwise he would be burnt like this only many traders learn this lesion of not to take a major risk on their equity.
When you are going to enter in this trade then you must use your speculative capital. When you begin your business and the novices ask you that with how much amount do you want to start your trade at that time you must select an amount which would not affect your life materially. Now divide this amount by five because it may be that in some few starting chances you would be wrong. So in the beginning of trading you must not invest your full amount.
 
Money management style
            We can mange our money successfully in two ways. First one is a trader must take many regular as well as small stops and attempt to gain the profit from it by winning some chances. Another way is that he /she opts for many small squirrel-like gains and takes noncontiguous but big stops. He /she must thinks in the way that a big loss can be recover by many small profits. If a trader opts for first method then it generates several instances of psychological pain, but it produces a few moments of happiness also. While by opting second option, the trader will be offered many small instances of happiness and there will be the experience of big losses. 
By using this method it is also possible that a trader will get loss for a full wear or a complete month. But the method you opt for also depends on your personality. The FX market provides you one benefit that it allows both of the style equally and a retail trader does not have to pay some extra cost for it. As FX is a spread-based market so each transaction has the same cost and it does not take care of the size of the trader’s position.
Ex. In EUR/USD a 3 pip spread will be encountered by most of the traders which is equal to the cost of 3/100th of 1% of the original position. This cost will not be common, in the terms of percentages, it does not mean that the traders wants to deal in 100 units lots or one million unit lots of currency. It means if a trader want to invest the $10,000 then the spread will cost $3 while if he is investing $100 only then the spread cost will be $0.03. Main problem arise when it comes to the commission because this amount vary according to the number of units in 100 units commission charges are 2% while in case of 1000 units commission charges are only 0.2%. This variability affects the trader very much and it also affects the transaction cost.


Four type of Stops
If you start your business once and you also select a serious approach to your business then there are four stops for you as follows.

1. Equity Stop-

In all of the stops this stop is very simple risk of the trader is determined before trading this amount is only the amount of his / her account or single trade. With the help of a common metric we can know easily that this risk is only 2% of any account on any given transaction. Means on a transaction of $10,000 a trader can have the risk of $200 only or 200 points.


There are many violent traders in the market who may consider using 5% equity stops but this amount does not consider the upper limit because if that person is wrong for regular ten times then he would get a loss of 50% that is a huge amount.
 
2. Chart Stop
If we analysis it technical we can find a lots of stops there which are driven by the price action of the chart or by various indicator signals technically. There are many technically oriented traders in the market who loves to mix these exit points with the regular equity rules to formulate chart stops.
 
3. Volatility Stop
Volatility is a more complicated edition of the chart stop. Chart stops uses volatility rather then price action to set-up the risk factors. Main concept behind it is that when environment is very much volatile, when prices traverse wide ranges, every trader like to work on the condition which is currently in the market. He does not want that any variation of the market should affect his/ her stops. This is applicable in both of the situation when environment volatility is low or high.
 Bollinger band is one important way by which we can easily know the volatility. It utilizes the regular difference to know the variance price.
4. Margin Stop
The fourth stop is margin stop which helps the trader to invest his / her money properly and at a very low risk.  This method is very much effective in FX if it is used astutely even it is the most unconventional money management strategy in all other strategies.
FX market operates 24 hours a day which is not the trend of any exchange market. So FX dealers as soon as receive the margin calls they can settle their customers position easily. As computers in FX market automatically close out all position if any customer is going into negative balance, customers never can get the negative balance into their accounts.
But is the customer wants to use this strategy then he / she has to divide his /her money in ten equal parts. 
Ex. If a customer has $20,000 then he will have to open the ten accounts of $2,000 each with his FX dealer. At the time of transaction customer can rope only $2,000 and the remaining $18,000 will be in his bank account.
 
A trader can control one regular 200,000 – unit lot because most if the FX dealers offer 100:1 influence. So $2,000 would allow him to control $200,000. Though, even a 1 point move against the trader would trigger a margin call because $2,000 is minimum amount that a dealer requires to trade.
 
Conclusion
            By all of above examples we can reach on a conclusion that FX market is very much flexible and money management in this market is also flexible. Money management varies very much according to the market variation. The one and only widespread rule of the market is that if a trader want to get succeed then he has to try all of the form available in the market. He must practice all the forms to get succeed. 


We can add your own money management or our MM
 
Money Management Parameters:
extern string _tmp2_ = " --- MM section ---";
extern bool EnableMM = true; //switch on dynamic lot yes/no
extern double LotBalancePcnt = 10; //calculate lot = 10%balance
extern double MinLot = 0.1; //minimum permissible lot
extern double MaxLot = 5; //maximum permissible lot
extern int LotPrec = 1; //   1 - for standard account  (lot 0.1); 2 - for mini accounts (lot 0.01)

www.iticsoftware.com

 del.icio.us  Stumbleupon  Technorati  Digg 

What is hedging?

What is hedging? Hedging is the process of risks insurance or risk reduction. Hedging is applicable in different areas, here we would consider only forex market's risk hedging. In forex market, hedging becomes more complicated than hedging in other field of investing. You can dream about a world where profit potential is limitless  and risk free, however  hedging can't help you to escape the hard reality of the risk-return tradeoff. A reduction in risk will always mean a reduction in potential profits. So, hedging, for the most part, is a technique not by which you will make money but by which you can reduce potential loss.
 
Technically, in order to fulfill the hedging you should invest in two currencies with negative correlations. If the investment you are hedging against makes money, you will have typically reduced the profit that you could have made, and if the investment loses money, your hedge, if successful, will reduce that loss. The main challenge of hedging  in the forex market is the selection of portfolio of negatively correlated currencies.
 
Metatrader Expert Advisor HedgeOptima, enters the market according t the signal which is based on the appearance of a certain pattern.  The metatrader expert adviser trades the currencies portfolio using the hedging of the currencies with a negative correlation.  This approach reduces the risks and smoothes the profit curve.
 
The weak point of this strategy is that market turbulence increases volatility of one or more currencies in the portfolio, which causes an imbalance of hedging. So as any strategy hedging is us just tool not a Grail, however the results of it are very impressive.



BJF Trading Group
http://iticsoftware.com

 del.icio.us  Stumbleupon  Technorati  Digg 

The use of neuro networks for financial series prediction

Currently, we observe the explosion of interest to neural networks in  different field. Neural networks are a powerful tool for forecasting nonlinear dependencies.  Because neural networks  are widely used  for financial time series predicting. To solve a problem, where linear approximation working poor, the use of linear models are not entirely correct. Neural networks are based on primitive biological model of nervous systems. The concept arose in the study of processes in the brain while thinking, and when trying to simulate these processes.  Neural network consists of connected and interacting with each other artificial neurons. Neural networks represents a special case of pattern recognition techniques or discriminant analysis.
Forex Fully Automated Trading System
Metatrader Expert Advisor Forexy GBPUSD Independent Monitoring
expert advisor forexy gbpusd monitoring 


The use of financial series prediction.

I would like to note that prediction is possible only when the future to some extent depends on the past. Unable to create Grail for trading on the forex market with the help of neural networks. But to improve the current trading system by properly setting objectives and the preparation of the data will turn out.



Stages in developing networks to predict the behaviour of currencies.

1y Stage - Choice network topology
To predict the financial series most applicable multilayered pertseptron or network Vorda, because expert assessment already laid in the original data and can be allocated among them.


Pic. 1
Multilayered Pertseptron


 
2y Phase Selection network characteristics
For pertseptron we can  selected number of layers.

3rd Phase Selection of learning parameters


4y Stage Network training

 
We can split the data sampling on learning sampling and test sampling, which checks learning outcomes.
If performance on the test sample that improved, education can be considered successful.
In our opinion, the most promising is the development of networks to complete the existing trading systems.  
let us suppose, if we have a trading system has been successful in the trend phases of forex market (for the trend part most applicable linear model) and impressions on Drawdown on flat part.  
In this case, develop a network to flat part of forex  market should complement and improve existing trend system.
 
Flat -A price that is neither rising nor declining.
Trend - The general direction of a market or of the price of an asset. Trends can vary in length from short, to intermediate, to long term. If you can identify a trend, it can be highly profitable, because you will be able to trade with the trend.

 
BJF Trading Group
http://iticsoftware.com

 del.icio.us  Stumbleupon  Technorati  Digg 

Metatrader Expert Advisor Forexy Back and Forward tests - Video

Metatrader Expert Advisor Forexy Back and Forward tests - Video

 del.icio.us  Stumbleupon  Technorati  Digg 

Metatrader Expert Advisor CHINCHILLA Review


    Volatility is a measure of dispersion. We can calculate volatility by using the standard deviation.     
Standard deviation show us how tightly the currencies price is grouped around the moving average (MA). The standard deviation is small when the prices are tightly bunched together.
When the currencies prices are grouped together, the standard deviation is small and vice versa - when the prices are grouped severally, the standard deviation is large.
            The reversals  of trends, occur at high levels of volatility. New trends arise at low levels of volatility.




pic.1 GBPUSD Trend reversal -
high levels of volatility

Metatrader Expert Advisors Chinchilla EURCAD and  Chinchilla GBPUSD
Concept: End of trading session and recoil of the price, the analysis of volatility, some orders at different levels.

Metatrader Expert advisor Chinchilla EURCAD Forward Test - demo account independent monitoring.

Started: 06.12.2007. Days: 194. (more then 6 months) 
Initial deposit: 10 000 USD
Profit: in USD:   $11 401.36  Profit in pips: 685








Drawdown
We have two zone of drawdown A and B


Back Test for same period (06.12.2007 - 16.06.2008)




Back Test for the all period (2004.08.02- 16.06.2008)



Summary: Sufficiently stable metatrader expert advisor. The test on historical data (same period) coincides with the test on an live demo  account.

View: Test on historical date (Back Test)
View: Test on live demo account (Real time independent monitoring -Forward Test)

Metatrader Expert Advisor Chinchilla GBPUSD have same concept.

View
Test on historical date (Back Test)

Metatrader Expert Advisors Page>>>

BJF Trading Group
www.iticsoftwre.com


 del.icio.us  Stumbleupon  Technorati  Digg 

Meatrader Expert Advisor Martingale Theory Back and Forward tests - Video

 del.icio.us  Stumbleupon  Technorati  Digg 

MetaTrader Indicator PowerSTLM and MetaTrader Indicator STLM-Div Adjustment

This article  about, how correctly to adjust indicators on the basis of the low frequency filter (similar to STLM and FTLM).
Forex Indicators of FTLM (Fast Trend Line Momentum) and STLM (Slow Trend Line Momentum) show the tempo of change (fall or growth) of FATL and SATL and are calculated similarly to indicator Momentum by formulas:
 
  FTLM (k) = FATL (k) - RFTL (k),
  STLM (k) = SATL (k) - RSTL (k).

 
Main difference of FTLM and STLM from classical technical instrument Momentum is that for its calculation not the close prices but smoothed (leveled) in the result of filtration values of the trend line are used. In the result FTLM and STLM turn out more leveled (smoothed) and regular functions than the classical instrument Momentum, and therefore have more forecasting value. FTLM and STLM lines were calculated with observance of all the rules of discrete mathematics as the first differences between the two nearest independent points of range bound channel processes.
 
Metatrader Indicators based on the low frequency filters:
 
MetaTrader Indicator PowerSTLM
Metatrader Indicator PowerSTLM combines the power of STLM (Low Frequency Digital Filter) and Bollinger Bands with the usability of Tick Volumes. The indicator shows a possible trend change, when the blue line of oscillator crosses the red median. It determines when the market is overbought/oversold “ when the blue line goes out of the area marked with yellow dotted lines. PowerSTLM provides fine leading signals with a pretty high level of reliability.




 
MetaTrader Indicator STLM-Div
 
Metatrader Indicator STLM-Div indicates fractal divergence by STLM Low Frequency Digital Filter. When divergence appears between STLM Filter and the price, it indicates that the current trend will finish soon. A signal to buy is when a new Low-fractal is formed below the previous one and a corresponding STLM value is higher than the previous one. A signal to sell is when a new Up-fractal is formed above the previous one and a corresponding STLM value is lower than the previous value. The indicator has a lot of customizable settings.




 
ADJUSTMENT
 
First Step – Spectral analysis.

For example Let's adjust the indicators for work on currency GBPUSD timeframe h1
-         Open metatrader 4
-         Open new chart: GBPUSD File/New Chart/GBPUSD
-         Save GBPUSD H1 quotations: Ctrl +S   (ASCII Text (*.csv))

-         open one quotation in the spectral analyzer Digital Methods Generator: Ctrl+ O  (Copyright © 2004-2005, Sergey Iljukhin) ( you can download Spectrym Analyzer for free)




We have defined the maximal peak of the spectrogram for pair GBPUSD timeframe H1 -47 bars   (two-days cycle)
 
 
Second Step MetaTrader Indicator PowerSTLM Adjustment
-add MetaTrader Indicator PowerSTLM to chart (gbpusd h1)
-open MetaTrader Indicator PowerSTLM properties
-open laying Inputs


 
Pass band cutoff frequency of LPF, P1.  

 

 

 

Normally a LPF is characterized by a cutoff frequency but for our purposes we will be using the cutoff expressed in bars. All swings of the price of the period more than P1 will be suppressed. In classical MA it corresponds to the moving average period.  

 

 

 

Stop band frequency, D1  

 

 

 

The sharpness of the transition from stop band to pass band can not be ideal due to a computer limited speed. The recommended value for FATL is 2 days. For slow filters such SATL the difference between D1 and P1 need to be more significant.  

 

 

 

Ripples in the pass band, R.  

 

 

 

That value needs to be set up as low as possible in order to decrease distortions.  

 

 

 

Stop Band attenuation, A1.  

 

 

 

That value defines attenuation in stop band region. The recommended value is -40dB. -40dB corresponds to 100 times attenuation.  

 

 

Delay, Bar.  

 



P1  = 47 bar  -maximal peak

D1 we select it in such a way that the filter's order should not exceed 1500 elements (that's a limitation of the dll); if the maximum value is used, the filter is faster but less smooth. For example D1=40

A1 = 40-70

Delay2, Bar.  Roughly = P1/2 = 47/2 = 23


MetaTrader Indicator STLM-Div adjustment

 
-add MetaTrader Indicator STLM-Div to chart (gbpusd h1)




- change Filters properties same as for MetaTrader Indicator PowerSTLM

P1=47   D1 = 40  A1= 40  Delay2 = 23





BJF Trading Group

http://iticsoftware.com

 del.icio.us  Stumbleupon  Technorati  Digg 

Metatrader Expert Advisors Portfolio

From our point of view, it is less risky to use not only one Expert Advisor for Forex trade, but to create portfolio, which consists of a few expert advisors. This article is devoted to this issue. Choose a few MetaTrader Expert Advisors which work on different currencies and which trade with different frequency in the different intervals of times. It will create the additional protection of deposit from losses. In our example we will consider 3 expert advisors: Forexy GBPUSD (Concept: Disruption of the middle of a day time range and origin of a trend),  Upstream EURJPY (Concept: Superposition of market fluctuations) and Chinchilla EURCAD (Concept: End of trading session and recoil of the price, the analysis of volatility, some orders at different levels). Let's do back test for each expert advisor separately and make a table with the data. We execute all tests, beginning from an identical date (2006.06.01)

 

 

Expert Advisor:

Maximal drawdown

Total net profit

Trading Time

1

Forexy GBPUSD

29.17%

14777.73

Round-the-clock

2

Upstream EURJPY

21.07%

51866.95

Round-the-clock

3

Chinchilla EURCAD

12.41%

22866.37

17:00-0:00, 0:00-11:00 GMT

 

 

 

If we look at the graphics of tests, it is possible to see the places of drawdown’s (marked in black color (circle)).

Chinchilla EURCAD H1 Strategy Tester Report




Forexy CBPUSD H1 Strategy Tester Report




Upstream EURJPY H1 Strategy Tester Report



 


We take the data of three tests in the Excel table; we sort by the date and we get the report of tester of strategies of portfolio, consisting of 3 experts. We get more smooth curve without obvious drawdown cavities




Limited time OFFER:  10% Extra Discount for Expert Advisors Portfolio (Chinchilla EURCAD + Forexy GBPUD + Upstream EURJPY)
Cost: $589.85 - 15% = $501.37  -10% = 451 USD
BUY NOW!

BJF Trading Group
http://iticsoftware.com

 del.icio.us  Stumbleupon  Technorati  Digg 

INSTALLATION, OPTIMIZATION and BACK TESTING EXPERT ADVISORS

Metatrader Expert advisor should has ex4 or mq4 file extenshion. mq4- sourse code, ex4- compiled code. First of all it is necessary to copy this file to the folder experts of working directory. Under a working directory we understand a root directory, in which we installed MetaTrader 4 terminal.





The second step is to restart MetaTrader . After the restart the expert should be added to the list of experts in the window Navigator . It necessary to stress that the colored icon corresponds to mq4 file. If you have an ex4 file only, an icon in the window Navigator will be grey. The same grey color may mean that the errors in a source code appeared.

 

 


In order to check expert errors, you may press F4, the editor of language MQL4 , and then it is necessary to load the source code of expert into the editor. Press F5 in order to compile the expert advisor. In case of success, the sentence '0 errors' will appear in conclusion window. Warnings are not errors and their presence does not hinder the successful compiling.



 
 

  Now MetaTrader identifies our metatrader expert advisor and the source code of forex expert does not contain errors. Next logical step will be to specify working pair and timeframe for the expert. The easiest way to do it is to apply the technology Drag-and-Drop . For this purpose it is necessary to select metatrader expert, press the left mouse button and drag it on the required chart, then release the button. There is another way. After the selection of metatrader expert advisor, press the right mouse button for context menu, then choose from the menu Attach to and chart .

If you made the steps mentioned above correctly, you should see the window of expert settings, where you should let the expert trade.
Do not forget about the button  Expert Advisors , which is located on one of standard tool bars of the terminal. The button must be pressed.


 


In the case of correct execution of all above-described actions, the name of forex expert advisor and smiling face must appear in the right overhead corner of the chart. It means that an expert is installed and ready to work.


 

  An metatrader expert advisor is almost ready to work. Now we can look over or change operating parameters.
Properties of expert are accessible by pressing F7 , or from context menu of active chart.
 
The changed parameters can be saved by pressing the button Save . The button Load serves for the load of the values, which were stored before. A file with the expert parameters has extension set and this file is kept in the directory experts\presets of your terminal. The button Reset restores the values of parameters on those which are prescribed in an expert itself.
 





All important information about expert work or appeared errors is accessible from the log of metatrader expert advisors. This information is duplicated in a log file which is located in the directory experts\logs . The file name coincides with a current date.







QUOTATIONS
Quotations of the various Metatrader brokers have distinctions, therefore it is necessary to make optimization and backtesting of expert advisors on broker quotations, which you plan to work with. We make tests of our Metatrader expert advisors on quotations of broker AlpariUK, as this broker gives minute and daily quotations from 2004 ( http://www.alpari-idc.com/en/dc/databank.html ) So in order to upload quotations in Metatrader
1. Get and save on your computer minute quotations of necessary pair from AlpariUK History Center for MetaTrader 4.
2. Decompress an archive.
3. Open the window Options MetaTrader 4 by pressing Ctrl +O or from menu Tools/Options . On the inset of Charts, set Max. Bars history and Max. bars charts 2100000000


 

4. Open the window History Center Metatrader 4 terminal by pressing  F2 or from menu  Tools/ History Center





5. Choose minute quotations of necessary currency and press Import . Specify a path to the folder with minute quotations (read points 1 and 2) in the opened window and press OK




In order for the quality of modeling (while backtesting) to be 90%, it is necessary to generate quotation m5, m15, m30 from the minute quotations. It is possible to do using indicator Period Converter




 
IMPORTANT! Testing of experts for other brokers is possible on more short time of history, as the brokers do not give the archives of quotations. It is also important to understand that taking advantage of the button download in the window History Center Metatrader 4 you will upload quotations of Metaquotes but not quotation of your broker. Quotations of Metaquotes can substantially differ from quotations of your broker.



OPTIMIZATION OF EXPERT ADVISORS

Let's examine the optimization of expert advisors on the example of advisor upstream EURJPY. We will optimize the size of stop loss and take profit. If you make optimization for Metatrader broker AlpariUK, then the period of optimization will be: start is 07.2004; the end is the current date.
We recommend to conduct optimization not up to the end of period = to the current date, but up to the end of period = current date – N of days N is chosen directly for every expert and depends on how often expert opens and closes orders. More orders are opened by an expert, less is N. The segment of history beginning of the period = (current date – N of days), the end of period = a current date will enable us to do a backtest of advisor on the area of quotations, which did not participate in optimization. So you are doing so called forward test of advisor.

So for the expert optimization, you should:
terminal, you should:
  1. Open the window strategy tester by pressing Ctrl+R or by pressing the right mouse button on graphic arts to which we added adviser and choose strategy tester.



2.In the window strategy tester , open the window expert properties
3. Select optimized parameters ( in our example stop-loss and stop-profit)
4.Enter the initial values of the optimized parameters, step and stop
5.close a window
6.Select Optimization
7.Choose a model for optimization ( a model “ Open prices only (fastest method to analyze the bar just completed)” corresponds to the most advisors, although for greater accuracy it is possible to test on Every tick (based on all available least timeframes) but then time of optimization substantially will be increased.



8.Press start
9. After completion of optimization, open Optimization result and choose parameters considering a highest income and minimum drawdown. (obviously income should be high and drawdown should be less)
 
TESTING OF EXPERT ON HISTORY ( BACK TESTING)
 
  1. Open the window strategy tester by pressing Ctrl+R or by pressing the right mouse button on graphic arts to which we added advisor and choose strategy tester.
  2. Set a testing model. We recommend to use Every tick model.
  3. Set a testing period and press a start.