Jun 15, 2009

Protect MQ4

Without protecting your MQL4 code it will be waste of time to try to commercialize your programs, that's why I'm writing this article.

Source code verse binary:

Just as a review and to emphasis that we are talking about how to protect the .ex4 files read the next section:
There are two kinds of files that you use with MetaTrader; the program files and the executable files:

The program files are normal text files but have one of these extensions: .mq4 and .mgh.
These files are the source code of the programs wrote in MQL4 programming language; source code means they could be opened for viewing or editing in MetaEditor.

The executable files are binary files (you can't open them for viewing or editing) and has the extension .ex4.
These files are the result of compiling the .mq4 files using MetaEditor, and these are the files that you can load them in MetaTrader and use them.

Compiling is an operation taken by a special program (called a compiler) to convert the program from text (readable) format to the binary format which the computer can understand (computers think in binary).
This is the general definition of compiling. Compiling in our case is converting the mq4 files to ex4 for file using MetaEditor program.

We are doing this by opening the mq4 files in MetaEditor then pressing F5 hot key. MetaEditor will compile (convert) the file to ex4 format and keeping the mq4 file untouched MetaEditor will place the generated ex4 file at the same path as the mq4 file. We compile the mq4 files because the MetaTrader can't load any files except ex4 files.

The source code of MQL4 programs can't be protect because it's in text format and when you distribute it you intend to give the receiver the access to the source code of the program.
The executable version of the program is the only version that you can protect it. You protect it by write the protection code in the source code of the program then compile it to the ex4 format then distribute it to the user.

Kinds (ideas) of the protection:

We are going to discuss some ideas of MQL4 programs protection, maybe they are not the best but they are the common ideas, we are going to write some code to apply these ideas:
Password protection code:

This the widely used method to protect softwares in general and can be used to protect MQL4 programs.
When the user buy your program you send him the program with a password and he can use the program without the password.

This is a simple code to apply password protection method:

int start() {
    extern string Please_Enter_Password = "0";
   // your code here.... --- Put your code here ----
int start() {
    if (password != "viva metatrader")  {  //change to the password you give the user!
       Alert ("Wrong password!");
    return (0);
    }
   // your code here.... --- Put your code here ----
}

In the code above the password is "viva metatrader" which is hard coded in the MQL4 file. You have to compile the program after adding this piece of code and send it to the user with the password.

Trial period protection:

If you want to give the user of the program a try-before-buy program you can limit the usage of your program by limited period of time and after this period the program will not work.
Use the code below to limit your program for period of time.

int start() {
   string expire_date = "2006.31.06"; // <-- hard coded datetime
   datetime e_d = StrToTime(expire_date);
   if (CurTime() >= e_d) {
       Alert ("The trial version has been expired!");
       return(0);
   }
   // your code here.... --- Put your code here ----
   return(0);
}

Limited account number protection:


In this method of protection you will ask the user to give you his account number and you write the following code to prevent the program to work with another accounts:

int start() {
   int hard_accnt = 11111; //<-- type the user account here before compiling int 
   accnt = AccountNumber();
   if (accnt != hard_accnt) {
       Alert ("You can not use this account (" + DoubleToStr(accnt,0) + ") with this program!");
       return(0);
    }
   // your code here.... --- Put your normal code here ----
return(0);
}

Limited account type protection: 

In this method of protection you will allow the user to use the program in demo mode only and prevent him to use the program in live trading.
It's not strong protection because the user can host the program in another instance of MetaTrader that runs in demo mode and trade manually in the real account instance.

int start() {
    bool demo_account = IsDemo();
    if (!demo_account) {
         Alert ("You can not use the program with a real account!");
         return(0);
    }  
// your code here.... --- Put your normal code here ----
return(0);
}

Re-Edit From : http://www.metatrader.info

-EOF-
... read More !..

May 13, 2009

Forex Neural Networks 1

Arrgghhh long time no write my blog log... today i want to write somethin i have to learn.
Yes.. its all about my forex still.. on my boree of my life, but i want to did something usefull for me and you, readers of course.. :D

Now i have think and i want to learn about Neural Networks Spot, Forex Forecasting... for now on, I dont know WTF this Syatem. I grab this articles from MQ4 dot com. it will separated on 4 Post by meh. latter.. edit this... blablabla


Introduction

During the last several years we observe the explosion of interest towards neural networks, successfully used in different spheres - business, medicine, technology, geology, physics. Neural networks are widely used in spheres that require forecasting, classification and management. Such an impressive success is determined by several reasons:

* Wide possibilities. Neural networks are a very powerful modelling tool, allowing the reproduction of immensely complicated relations. In particular, neural networks are nonlinear by nature. Over a period of many years linear modelling was the main method of modelling in the majority of spheres, because optimization procedures for it are well developed. In tasks, where linear approximation is not enough, linear models operate poorly. Besides, neural networks overcome "the curse of dimensionality", which does not allow modelling linear relations in case of a large number of variables.
* Easy usage. Neural networks learn by examples. The user of a neural network collates representative data and then starts the algorithm of training, which automatically accepts the data structure. Of course the user should have a set of heuristic knowledge about the way of selecting and preparing data, of choosing the appropriate network architecture and interpreting results. However, the knowledge level, needed for a successful use of neural networks, is much lower, than that needed in traditional statistics methods.

Neural networks are attractive from the point of view intuition, because they are based on the primitive biological model of nervous systems. In future, the development of such neuro-biological models can lead to the creation of really intelligent computers. [1]

Forecasting financial time series is a primary member of any investment activity. The whole idea of investment - investing money now with the purpose of getting profit in future - is based on the idea of forecasting future. Accordingly, forecasting financial time series lies at the root of the investment industry - all stock exchanges and over-the-counter (OTC) markets.

It is known, that 99% of all trades are speculative, i.e. are aimed not at a real trade turnover, but at taking profit using the scheme "buy cheap - sell dear". They are all based on the forecasts of price movements by a trade participants. What is important - forecasts of the trade participants are contrary to each other. So the amount of speculative operations characterizes the difference in the forecasts of the market participants, i. e. actually - the unpredictability of financial time series.

This most important feature of market time series underlie the theory of the "efficient" market, described in the thesis of L. Bachelier in 1900. According to this thesis, an investor can rely only on the average market profitability, assessed by indexes, like Dow Jones or S&P500 for New-York Exchange. Any speculative profit is of random nature and is like gambling (there is something attractive in it, isn't there?). The reason for the unpredictable nature of market curves is the same, as why money rarely lies on the ground in public places: too many people wishing to take it.

Naturally, the theory of an efficient market is not supported by the market participants (which are looking for the money lying about). Many of them think that, despite the seeming stochasticity, all time series are full of hidden regularities, i.e. are predictable, at least partially. The founder of a wave analysis R. Elliot tried to find such hidden empirical regularities in his articles in the 30s.

In the 80s this point of view was unexpectedly supported in the newly appeared theory of dynamic chaos. This theory is based on the contraposition of the chaotic state and stochasticity (randomness). Chaotic series only seem random, but as a deterministic dynamic process they allow short-term forecasting. The sphere of probable forecasting is restricted in time by the horizon of forecasting, but this can be enough for getting real profit from forecasting (Chorafas, 1994). And those, who use the best mathematics methods of extracting regularities from noisy chaotic series, can expect large profits - at the expense of less equipped fellows.

The last decade was characterised by a persistent growth of the popularity of technical analysis - a set of empirical rules, based on different indicators of the market behaviour. The technical analysis focuses on the individual behaviour of this financial instrument, apart from other securities. But technical analysis is very subjective and works inefficiently on the right edge of a chart - exactly where we need the forecast of a price direction. That is why more popularity is gained by the neuro-network analysis, because, as opposed to the technical one, it does not set any restrictions on the type of the entry information. This may be indicators of the given indicator series, as well as the information about the behaviour of other market instruments. Not in vain neural networks are widely used by institutional investors (for example large pension capital funds), working with large portfolios, placing great importance on the correlation between different markets.

Pure neuro-network modelling is based only on data, not using any antecedent arguments. This is its strong and week point at the same time. The available data may be insufficient for training, dimensionality of potential entries may be too large.

That is why for a good forecast one should use neuropackages with large functionality.


... read More !..

Jan 4, 2009

Lesson 4. What is a Forex deal?

The investor's goal in Forex trading is to profit from foreign currency movements.

More than 95% of all Forex trading performed today is for speculative purpose (e.g. profit from currency movement). The rest belongs to hedging (managing business exposures to various currencies) and other activities.

Forex trades (trading onboard internet platforms) are non-delivery trades: currencies are not physically traded, but rather there are currency contracts which are agreed upon and performed. Both parties to such contracts (the trader and the trading platform) undertake to fulfill their obligation: one side undertakes to sell the amount specified, and the other undertakes to buy it. As mentioned, over 95% of the market activity is for speculative purposes, so there is no intention on either side ti actually perform the contract (the physical delivery of the currencies). Thus, the contract ends by offsetting it against an opposite position, resulting in the profit and loss og the parties involved.
... read More !..

Search By Google



Here You can find Tutorial How to Trade in Forex Market... Especialy For Newbies

Who Ami

My Photo
Praetorian'Fx
Bandung, JB, Indonesia
My Desc was Simple $o$ :::>>> Low Profile High Profit
View my complete profile

Sponsored By


Tutorial Forex

Delivered By

Forex News