I would to share a simple EA based on non-martingale grid system, and I'll be very grateful to people who will hel me understanding logical implications of these systems.
1. Sorry for my english but I'm not english-speaking.
2. please note that code is very bad, there isn't filtering by magic, nor by pair...it is just to play with settings
The idea is taken from other grid systems on the net, also in this forum:
- - place n buystop and n sellstop orders, incrementing lots as you go far from current price
- - distance from each order is fixed
- - input the same take profit for all orders
for(int ciclo=1;ciclo<=ncicli;ciclo++) { OrderSend(Symbol(), OP_BUYSTOP, lotti, NormalizeDouble(Ask+distanza,Digits), 0, 0,NormalizeDouble(Ask+distanza+tp,Digits), "eva", 0, scadenza, Green); OrderSend(Symbol(), OP_SELLSTOP, lotti, NormalizeDouble(Bid-distanza,Digits), 0, 0,NormalizeDouble(Bid-distanza-tp,Digits), "eva", 0, scadenza, Green); if (ciclo==ncicli) { distanza=d; lotti = lot; } else { distanza=distanza+d; lotti = lotti+lot; } }
Then I put some conditions:
- close all orders when a profit for the while basket is reached, or a total loss is reached
- close all and restart when just one order is opened and there aren't other pending orders
- close all when there are only sellstop or only buystop odrers
Tha aim is to avoid that one order remains opened for long time far from original price, thath pendind orders remain placed and current price is far from it...so I accept little losses just to restart with complete grid and earn with first orders in gain.
Now, as I discovered the power of optimization, I tried to find settings which can lead me to profit; as I don't use martingale, it seems just statistics and optimized settings can halp me.
The best result I had is for 1 year optimization with eurusd:
275 1743.69 1629 1.21 1.07 715.78 78.69% 0.00000000 profit=26 distance=3 Total_loss=-90 ncicli=8 attiva_scadenza=0 lot=0.01 moltipl=1 loss=0 My_Money_Profit_Target=100 perdita_massima=-999 expiration=0 attiva_exp=0 minuti=0
I had 1629 EUR of profit starting from 100 EUR balance, with max drawdown of 78.69%, in 1year.
Of course repeating backtest with another 1year period don't gave me same good result.
So my quesiton: is this pure random system? Do you think there is an adequate period for optimization so that, basing on big numbers theory, I could have reasonable profit for the future?
I thinked 1year was a big period for testing, but is not...
I hope I explained, and if someone would reason with me on this I'll share the while code and answer your questions.
Thanks to all!