Coding for Revised-Martingale and Martingale strategy

MQL4 Komut dosyaları

İş tamamlandı

Tamamlanma süresi: 3 gün
Müşteri tarafından geri bildirim
He fully understood.what I need and delivered the code efficiently, fast response and helpful, he is definitly a good programmer
Geliştirici tarafından geri bildirim
Very good customer, thanks for the job. I hope we can work again

İş Gereklilikleri

I would like to have a Revised-Martingale code and an Anti Martingale code as trading method for my different strategy. 

The trading signal is EMA 24 & 60 crossing (crossing up = buy, crossing down = sell), but it is not the key point for this code (the Revised-Martingale code and Anti Martingale are), it need to easy to be replaced by other buy/sell signal in future by myself

For Revised-Martingale
Please pay attention, the revised-Martingale I want is little bit different with the regular/traditional Martingale, in the regular Martingale, it only raise the trading size by double it when the trade is lose, however, the revised-Martingale I want is, no matter the trade is lose or win, the size will still raise (but not by double). And in the regular Martingale, the maximum of trade is unlimited, but revised-Martingale is limited.

The following code is I coded by myself, just want to demonstrate what I am thinking, it may not correct, and you may or may not use it, it is your call.


extern int max_num_trade = 5; //The maximum number of trade, after this number of trade, it will return to 1 for next trade, it will only add +1 no matter is win or loss
extern int basic_size 0.1; //The basic_ size (0.1 lot) is used to calculated the size of each trade. 
int size_each_trade = max_num_trade x basic_size // it shows the calculation for size of each trade. e.g. if it is the first trade, will be 1 X 0.1 = 0.1, if it is the second trade, will be 2 X 0.1 = 0.2…etc. (so as you see, it is different from regular Martingale, cos it is not double.)

extern int target_profit = 500; //every trade have the same TP
extern int cut_loss = 300; //every trade have the same CL

Here is a demo example, to assume that I start my trade for XAU at 1900. (spread is not concern here)
For Anti Martingale
Basically, it is very similar with the revised-martingale, the only differences are the position will raise when the trade is win, if the trade is loss, then the next trade will reset to be the first trade.

Again, the following code is I coded by myself, just want to demonstrate what I am thinking, it may not correct, you may or may not use it, it is your call.

extern int max_num_trade = 5; //The maximum number of trade, after this number of trade, it will return to 1 for next trade, it will only add +1 only when is win trade, if lose, then back to 1 and count again.

extern int basic_size 0.1; //The basic_ size (0.1 lot) is used to calculated the size of each trade. 
int size_each_trade = max_num_trade x basic_ size // it shows the calculation for size of each trade. e.g. if it is the first trade, will be 1 X 0.1 = 0.1, if it is the second trade, will be 2 X 0.1 = 0.2…etc. (so as you see, it is different from regular Anti-Martingale, cos it is not double.)

extern int target_profit = 500; //every trade have the same TP
extern int cut_loss = 300; //every trade have the same CL

Here is a demo example, to assume that I start my trade for XAU at 1900. (spread is not concern here)

2


Finally , since i am a rookie of programming, i hope you can give me simple description on important line of code , and the code must be testable by backtest , then i can check it faster and pay you faster, and both of us win-wn.

If you have any inquiry, pls let me know.

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(15)
Projeler
23
9%
Arabuluculuk
7
29% / 57%
Süresi dolmuş
2
9%
Serbest
2
Geliştirici 2
Derecelendirme
(64)
Projeler
68
25%
Arabuluculuk
12
42% / 42%
Süresi dolmuş
4
6%
Serbest
3
Geliştirici 3
Derecelendirme
(70)
Projeler
91
25%
Arabuluculuk
26
19% / 54%
Süresi dolmuş
25
27%
Serbest
4
Geliştirici 4
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest

Proje bilgisi

Bütçe
30+ USD
Son teslim tarihi
to 5 gün