Help on making Automated Trader

 

I use Mt4 connected to BTC-E to do trading in bitcoin.  The of programming the advisers use is currently a bit confusing, and I wish to learn to create one as there is not one really available for Bitcoin trading.

 

I want to be able to start with a code with specific requirements, and then start from there to learn.

 

 How I envision the advisor to work is as follows:

 

 If the price has risen on each of the previous 3 updates, then a buy order is opened, with a take profit at 110% and Stop Loss at 99% of the buy value

if the price has dropped on each of the previous 3 updates, then a sell order is opened, with take profit at 90% and stoploss at 101% of the sell value

If after a price rise of 3 updates is followed by a price drop of 2 updates, then all open Buy Orders that are profitable are closed

If after a price drop of 3 updates is followed by a price rise of 2 updates, then all open Sell Orders that are profitable are closed

 

Lots start at .01, and are adjusted based on half the profit/twice the loss of a closed order.  (if profit is 3.00, then lot is raised by  1.5/close price. if loss is 3, then lot is dropped by 6/close price)

The lot should be allowed to drop to 0. This should keep a crash from causing investor to lose all the money. 

 

Whether someone can make the code, or begin helping me make the code myself will be grateful, though making the code myself helps me learn more. THanks in advance for any help!